Added check in RFControl to allow for backwards compatibility with Arduino-ESP 1.0.6

To do: Disable watchdog timer in ESP32-C3
This commit is contained in:
Gregg 2021-10-03 22:01:37 -05:00
parent ae1037946a
commit 641e2ca955
2 changed files with 3 additions and 4 deletions

View File

@ -22,7 +22,9 @@ RFControl::RFControl(uint8_t pin){
config->rmt_mode=RMT_MODE_TX;
config->tx_config.carrier_en=false;
config->channel=(rmt_channel_t)nChannels;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
config->flags=0;
#endif
config->clk_div = 1;
config->mem_block_num=1;
config->gpio_num=(gpio_num_t)pin;

View File

@ -10,11 +10,8 @@ void setup() {
Serial.println("\n\nHomeSpan RF Transmitter Example");
RFControl rf(19); // create an instance of RFControl with signal output to pin 6
RFControl rf(18); // create an instance of RFControl with signal output to pin 6
for(int i=0;i<8;i++)
new RFControl(18);
#define NPOINTS 3
uint32_t data[NPOINTS];