mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Fix backlightpin and sleep initial value bug
This commit is contained in:
parent
097d9ce5be
commit
dcb8389bb9
@ -245,9 +245,9 @@ void guiSetup()
|
|||||||
/* Initialize the Virtual Device Buffers */
|
/* Initialize the Virtual Device Buffers */
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
/* allocate on iram (or psram ?) */
|
/* allocate on iram (or psram ?) */
|
||||||
static lv_disp_buf_t disp_buf;
|
|
||||||
|
|
||||||
#ifdef USE_DMA_TO_TFT
|
#ifdef USE_DMA_TO_TFT
|
||||||
|
static lv_disp_buf_t disp_buf;
|
||||||
static lv_color_t *guiVdbBuffer1, *guiVdbBuffer2 = NULL;
|
static lv_color_t *guiVdbBuffer1, *guiVdbBuffer2 = NULL;
|
||||||
// DMA: len must be less than 32767
|
// DMA: len must be less than 32767
|
||||||
size_t guiVDBsize = 15 * 1024u; // 15 KBytes * 2
|
size_t guiVDBsize = 15 * 1024u; // 15 KBytes * 2
|
||||||
@ -256,6 +256,7 @@ void guiSetup()
|
|||||||
// guiVdbBuffer2 = (lv_color_t *)heap_caps_malloc(sizeof(lv_color_t) * guiVDBsize, MALLOC_CAP_DMA);
|
// guiVdbBuffer2 = (lv_color_t *)heap_caps_malloc(sizeof(lv_color_t) * guiVDBsize, MALLOC_CAP_DMA);
|
||||||
// lv_disp_buf_init(&disp_buf, guiVdbBuffer1, guiVdbBuffer2, guiVDBsize);
|
// lv_disp_buf_init(&disp_buf, guiVdbBuffer1, guiVdbBuffer2, guiVDBsize);
|
||||||
#else
|
#else
|
||||||
|
static lv_disp_buf_t disp_buf;
|
||||||
static lv_color_t * guiVdbBuffer1;
|
static lv_color_t * guiVdbBuffer1;
|
||||||
size_t guiVDBsize = 16 * 1024u; // 32 KBytes * 2
|
size_t guiVDBsize = 16 * 1024u; // 32 KBytes * 2
|
||||||
guiVdbBuffer1 =
|
guiVdbBuffer1 =
|
||||||
@ -267,16 +268,16 @@ void guiSetup()
|
|||||||
// lv_disp_buf_init(&disp_buf, guiVdbBuffer1, guiVdbBuffer2, guiVDBsize);
|
// lv_disp_buf_init(&disp_buf, guiVdbBuffer1, guiVdbBuffer2, guiVDBsize);
|
||||||
#elif defined(ARDUINO_ARCH_ESP8266)
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
/* allocate on heap */
|
/* allocate on heap */
|
||||||
static lv_disp_buf_t disp_buf;
|
|
||||||
static lv_color_t guiVdbBuffer1[4 * 512u]; // 4 KBytes
|
|
||||||
size_t guiVDBsize = sizeof(guiVdbBuffer1) / sizeof(guiVdbBuffer1[0]);
|
|
||||||
lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize);
|
|
||||||
|
|
||||||
// static lv_disp_buf_t disp_buf;
|
// static lv_disp_buf_t disp_buf;
|
||||||
// static lv_color_t * guiVdbBuffer1;
|
// static lv_color_t guiVdbBuffer1[2 * 512u]; // 4 KBytes
|
||||||
// guiVDBsize = 4 * 512u; // 4 KBytes * 2
|
// size_t guiVDBsize = sizeof(guiVdbBuffer1) / sizeof(guiVdbBuffer1[0]);
|
||||||
// guiVdbBuffer1 = (lv_color_t *)malloc(sizeof(lv_color_t) * guiVDBsize);
|
|
||||||
// lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize);
|
// lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize);
|
||||||
|
|
||||||
|
static lv_disp_buf_t disp_buf;
|
||||||
|
static lv_color_t * guiVdbBuffer1;
|
||||||
|
size_t guiVDBsize = 2 * 512u; // 4 KBytes * 2
|
||||||
|
guiVdbBuffer1 = (lv_color_t *)malloc(sizeof(lv_color_t) * guiVDBsize);
|
||||||
|
lv_disp_buf_init(&disp_buf, guiVdbBuffer1, NULL, guiVDBsize);
|
||||||
#else
|
#else
|
||||||
static lv_disp_buf_t disp_buf;
|
static lv_disp_buf_t disp_buf;
|
||||||
static lv_color_t guiVdbBuffer1[16 * 512u]; // 16 KBytes
|
static lv_color_t guiVdbBuffer1[16 * 512u]; // 16 KBytes
|
||||||
@ -560,6 +561,8 @@ bool guiSetConfig(const JsonObject & settings)
|
|||||||
uint16_t guiSleepTime1;
|
uint16_t guiSleepTime1;
|
||||||
uint16_t guiSleepTime2;
|
uint16_t guiSleepTime2;
|
||||||
|
|
||||||
|
hasp_get_sleep_time(guiSleepTime1, guiSleepTime2);
|
||||||
|
|
||||||
changed |= configSet(guiTickPeriod, settings[FPSTR(F_GUI_TICKPERIOD)], F("guiTickPeriod"));
|
changed |= configSet(guiTickPeriod, settings[FPSTR(F_GUI_TICKPERIOD)], F("guiTickPeriod"));
|
||||||
changed |= configSet(guiBacklightPin, settings[FPSTR(F_GUI_BACKLIGHTPIN)], F("guiBacklightPin"));
|
changed |= configSet(guiBacklightPin, settings[FPSTR(F_GUI_BACKLIGHTPIN)], F("guiBacklightPin"));
|
||||||
changed |= configSet(guiSleepTime1, settings[FPSTR(F_GUI_IDLEPERIOD1)], F("guiSleepTime1"));
|
changed |= configSet(guiSleepTime1, settings[FPSTR(F_GUI_IDLEPERIOD1)], F("guiSleepTime1"));
|
||||||
|
@ -1103,7 +1103,7 @@ void webHandleGuiConfig()
|
|||||||
httpMessage += F("><b>Show Pointer</b>");
|
httpMessage += F("><b>Show Pointer</b>");
|
||||||
|
|
||||||
int8_t bcklpin = settings[FPSTR(F_GUI_BACKLIGHTPIN)].as<int8_t>();
|
int8_t bcklpin = settings[FPSTR(F_GUI_BACKLIGHTPIN)].as<int8_t>();
|
||||||
httpMessage += F("<p><b>Backlight Control</b> <select id='bcklpin' name='bcklpin'>");
|
httpMessage += F("<p><b>Backlight Control</b> <select id='bckl' name='bckl'>");
|
||||||
httpMessage += getOption(-1, F("None"), bcklpin == -1);
|
httpMessage += getOption(-1, F("None"), bcklpin == -1);
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
httpMessage += getOption(5, F("GPIO 5"), bcklpin == 5); // D8 on ESP32 for D1 mini 32
|
httpMessage += getOption(5, F("GPIO 5"), bcklpin == 5); // D8 on ESP32 for D1 mini 32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user