diff --git a/src/boot.cpp b/src/boot.cpp index c4679a95..28202243 100644 --- a/src/boot.cpp +++ b/src/boot.cpp @@ -95,7 +95,7 @@ void start_boot_menu(void) { // setup watchdog, based on esp32 timer2 interrupt wdTimer = timerBegin(0, 80, true); // timer 0, div 80, countup - timerAttachInterrupt(wdTimer, &watchdog, true); // callback for device reset + timerAttachInterrupt(wdTimer, &watchdog, false); // callback for device reset timerAlarmWrite(wdTimer, BOOTDELAY * 1000000, false); // set time in us timerAlarmEnable(wdTimer); // enable watchdog diff --git a/src/i2c.cpp b/src/i2c.cpp index 2d882043..530dee4c 100644 --- a/src/i2c.cpp +++ b/src/i2c.cpp @@ -7,9 +7,12 @@ static const char TAG[] = __FILE__; SemaphoreHandle_t I2Caccess; -void i2c_init(void) { Wire.begin(MY_DISPLAY_SDA, MY_DISPLAY_SCL, 100000); } +void i2c_init(void) { + Wire.setPins(MY_DISPLAY_SDA, MY_DISPLAY_SCL); + Wire.begin(); +} -void i2c_deinit(void) { Wire.~TwoWire(); } +void i2c_deinit(void) { Wire.end(); } void i2c_scan(void) { diff --git a/src/lmic_config.h b/src/lmic_config.h index 51e40e9c..51c7b63f 100644 --- a/src/lmic_config.h +++ b/src/lmic_config.h @@ -1,5 +1,8 @@ // COUNTRY AND PROJECT SPECIFIC DEFINITIONS FOR LMIC STACK +// workaround for arduino-espressif32 v2.0.0 (see isse #714 @ MCCI_LMIC) +#define hal_init LMICHAL_init + // COUNTRY SETTINGS // --> please check with you local regulations for ISM band frequency use! diff --git a/src/main.cpp b/src/main.cpp index 2e20fb76..6292380e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -450,7 +450,7 @@ void setup() { // https://techtutorialsx.com/2017/10/07/esp32-arduino-timer-interrupts/ // prescaler 80 -> divides 80 MHz CPU freq to 1 MHz, timer 0, count up displayIRQ = timerBegin(0, 80, true); - timerAttachInterrupt(displayIRQ, &DisplayIRQ, true); + timerAttachInterrupt(displayIRQ, &DisplayIRQ, false); timerAlarmWrite(displayIRQ, DISPLAYREFRESH_MS * 1000, true); timerAlarmEnable(displayIRQ); #endif @@ -460,7 +460,7 @@ void setup() { // https://techtutorialsx.com/2017/10/07/esp32-arduino-timer-interrupts/ // prescaler 80 -> divides 80 MHz CPU freq to 1 MHz, timer 3, count up matrixDisplayIRQ = timerBegin(3, 80, true); - timerAttachInterrupt(matrixDisplayIRQ, &MatrixDisplayIRQ, true); + timerAttachInterrupt(matrixDisplayIRQ, &MatrixDisplayIRQ, false); timerAlarmWrite(matrixDisplayIRQ, MATRIX_DISPLAY_SCAN_US, true); timerAlarmEnable(matrixDisplayIRQ); #endif @@ -480,14 +480,14 @@ void setup() { cyclicTimer.attach(HOMECYCLE, setCyclicIRQ); // only if we have a timesource we do timesync -#if ((TIME_SYNC_LORAWAN) || (TIME_SYNC_LORASERVER) || (HAS_GPS) || (HAS_RTC)) +#if ((HAS_LORA_TIME) || (HAS_GPS) || (HAS_RTC)) #if (defined HAS_IF482 || defined HAS_DCF77) ESP_LOGI(TAG, "Starting Clock Controller..."); clock_init(); #endif -#if (TIME_SYNC_LORASERVER) || (TIME_SYNC_LORAWAN) +#if (HAS_LORA_TIME) timesync_init(); // create loraserver time sync task #endif