#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" #include "esp_log.h" #include "driver/rmt.h" #include "toshiba_ir.h" #include "ir_transmit.h" #include "config.h" #ifdef IR_TRANSMIT extern uint8_t bitReverse(uint8_t b); // RMT values #define RMT_TX_CHANNEL RMT_CHANNEL_0 #define RMT_TX_GPIO GPIO_NUM_26 // channel clock period = 1 uS #define RMT_CLK_DIV 80 // Variable that holds the IR protocol transmission. 1 start bit, 8*8+19*8 data bits and one stop bit #define STATIC_PRE_BYTES 8 #define DYN_DATA_BYTES 19 #define TOT_DATA_BYTES (STATIC_PRE_BYTES+DYN_DATA_BYTES) #define RMT_BITS (1+(STATIC_PRE_BYTES*8)+1+1+(DYN_DATA_BYTES*8)+1+1) // 221 bits in total rmt_item32_t toshiba_rmt[RMT_BITS]; uint8_t irTxData[TOT_DATA_BYTES]; QueueHandle_t toshibaTxQueue = NULL; void copyDataToRmtArray( const uint8_t rmtStartBit, const uint8_t* data, const uint8_t noOfBytes, const bool reverseByte) { for(uint8_t b=0;b