#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 "config.h" // 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, 72 data bits and one stop bit rmt_item32_t toshiba_rmt[1 + 72 + 1 + 1]; QueueHandle_t toshibaTxQueue = NULL; void toshibaTxTask(void *pvParameter) { ESP_LOGI("TX", "toshibaTxTask() starting."); uint8_t data[8]; while( true ) { if( xQueueReceive( toshibaTxQueue, data, 100 ) == pdTRUE ) { ESP_LOGI("TOSHIBA","Received a TX from MQTT"); uint8_t irPair = 1; for(uint8_t b=0;b