mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-13 14:26:39 +00:00
Fix esp8266 compile errors
This commit is contained in:
parent
882ccaf79c
commit
09b8fa72a7
@ -196,7 +196,7 @@ build_flags=
|
|||||||
; -- lvgl build options -----------------------------
|
; -- lvgl build options -----------------------------
|
||||||
-D LV_MEM_SIZE=12288U ; 12kB lvgl memory
|
-D LV_MEM_SIZE=12288U ; 12kB lvgl memory
|
||||||
-D LV_ATTRIBUTE_FAST_MEM=
|
-D LV_ATTRIBUTE_FAST_MEM=
|
||||||
-D LV_ATTRIBUTE_TASK_HANDLER=IRAM_ATTR
|
-D LV_ATTRIBUTE_TASK_HANDLER=
|
||||||
; -- ArduinoJson build options ----------------------------
|
; -- ArduinoJson build options ----------------------------
|
||||||
-D ARDUINOJSON_ENABLE_PROGMEM=1 ; for PROGMEM arguments
|
-D ARDUINOJSON_ENABLE_PROGMEM=1 ; for PROGMEM arguments
|
||||||
-D ARDUINOJSON_ENABLE_STD_STRING=1 ; for std::string
|
-D ARDUINOJSON_ENABLE_STD_STRING=1 ; for std::string
|
||||||
|
@ -48,8 +48,8 @@ static inline void gpio_update_group(uint8_t group, lv_obj_t* obj, bool power, i
|
|||||||
#include "driver/uart.h"
|
#include "driver/uart.h"
|
||||||
#include <driver/dac.h>
|
#include <driver/dac.h>
|
||||||
|
|
||||||
volatile bool touchdetected = false;
|
volatile bool touchdetected = false;
|
||||||
RTC_DATA_ATTR int recordCounter = 0;
|
RTC_DATA_ATTR int rtcRecordCounter = 0;
|
||||||
|
|
||||||
void gotTouch()
|
void gotTouch()
|
||||||
{
|
{
|
||||||
@ -96,8 +96,8 @@ static void gpio_event_handler(AceButton* button, uint8_t eventType, uint8_t but
|
|||||||
} else {
|
} else {
|
||||||
eventid = HASP_EVENT_DOWN;
|
eventid = HASP_EVENT_DOWN;
|
||||||
}
|
}
|
||||||
state = true;
|
state = true;
|
||||||
touchdetected = false;
|
// touchdetected = false;
|
||||||
break;
|
break;
|
||||||
case 2: // AceButton::kEventClicked:
|
case 2: // AceButton::kEventClicked:
|
||||||
eventid = HASP_EVENT_UP;
|
eventid = HASP_EVENT_UP;
|
||||||
@ -224,12 +224,14 @@ static void gpio_setup_pin(uint8_t index)
|
|||||||
pinMode(gpio->pin, INPUT_PULLUP);
|
pinMode(gpio->pin, INPUT_PULLUP);
|
||||||
gpio->max = 0;
|
gpio->max = 0;
|
||||||
break;
|
break;
|
||||||
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
case hasp_gpio_type_t::TOUCH:
|
case hasp_gpio_type_t::TOUCH:
|
||||||
if(gpio->btn) delete gpio->btn;
|
if(gpio->btn) delete gpio->btn;
|
||||||
gpio->btn = new AceButton(&touchConfig, gpio->pin, HIGH, index);
|
gpio->btn = new AceButton(&touchConfig, gpio->pin, HIGH, index);
|
||||||
gpio->max = 0;
|
gpio->max = 0;
|
||||||
// touchAttachInterrupt(gpio->pin, gotTouch, 33);
|
// touchAttachInterrupt(gpio->pin, gotTouch, 33);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case hasp_gpio_type_t::POWER_RELAY:
|
case hasp_gpio_type_t::POWER_RELAY:
|
||||||
case hasp_gpio_type_t::LIGHT_RELAY:
|
case hasp_gpio_type_t::LIGHT_RELAY:
|
||||||
@ -294,7 +296,9 @@ static void gpio_setup_pin(uint8_t index)
|
|||||||
void gpioSetup()
|
void gpioSetup()
|
||||||
{
|
{
|
||||||
LOG_INFO(TAG_GPIO, F(D_SERVICE_STARTING));
|
LOG_INFO(TAG_GPIO, F(D_SERVICE_STARTING));
|
||||||
LOG_WARNING(TAG_GPIO, F("Reboot counter %d"), recordCounter++);
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
|
LOG_WARNING(TAG_GPIO, F("Reboot counter %d"), rtcRecordCounter++);
|
||||||
|
#endif
|
||||||
|
|
||||||
aceButtonSetup();
|
aceButtonSetup();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user