From c1d9a463b734a52a3b0e309d18c98af3bd1bb7f2 Mon Sep 17 00:00:00 2001 From: pvvx Date: Sat, 22 Jan 2022 03:52:55 +0300 Subject: [PATCH] Can be bypassed by measurements when there is no E-Ink update https://github.com/pvvx/ATC_MiThermometer/issues/180 --- src/app.c | 10 ++++++---- src/app_config.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app.c b/src/app.c index 45ece476..15193f09 100644 --- a/src/app.c +++ b/src/app.c @@ -548,9 +548,12 @@ _attribute_ram_code_ void main_loop(void) { } } if (new - tim_measure >= measurement_step_time) { - start_measure = 1; tim_measure = new; + start_measure = 1; } +#if (DEVICE_TYPE == DEVICE_CGG1) // Can be bypassed by measurements when there is no E-Ink update (https://github.com/pvvx/ATC_MiThermometer/issues/180) + else +#endif if (new - tim_last_chow >= min_step_time_update_lcd) { if (!lcd_flg.b.ext_data) { lcd_flg.b.new_update = lcd_flg.b.notify_on; @@ -574,10 +577,9 @@ _attribute_ram_code_ void main_loop(void) { if(wrk_measure == 0 && stage_lcd) { if(gpio_read(EPD_BUSY) && (!task_lcd())) { cpu_set_gpio_wakeup(EPD_BUSY, Level_High, 0); // pad high wakeup deepsleep disable - } - else if(stage_lcd && ((bls_pm_getSystemWakeupTick() - clock_time())) > 25 * CLOCK_16M_SYS_TIMER_CLK_1MS) { + } else if((bls_pm_getSystemWakeupTick() - clock_time()) > 25 * CLOCK_16M_SYS_TIMER_CLK_1MS) { cpu_set_gpio_wakeup(EPD_BUSY, Level_High, 1); // pad high wakeup deepsleep enable - bls_pm_setWakeupSource(PM_WAKEUP_PAD);//|PM_WAKEUP_TIMER); // gpio pad wakeup suspend/deepsleep + bls_pm_setWakeupSource(PM_WAKEUP_PAD); // gpio pad wakeup suspend/deepsleep } } #endif diff --git a/src/app_config.h b/src/app_config.h index 8a6e7055..68d2b96b 100644 --- a/src/app_config.h +++ b/src/app_config.h @@ -46,8 +46,8 @@ extern "C" { // GPIO_PD2 - used EPD_CSB // GPIO_PD7 - used EPD_SCL -#define SHL_ADC_VBAT 6 // "B5P" in adc.h -#define GPIO_VBAT GPIO_PB5 // missing pin on case TLSR8251F512ET24 +#define SHL_ADC_VBAT 1 // "B0P" in adc.h +#define GPIO_VBAT GPIO_PB0 // missing pin on case TLSR8251F512ET24 #define I2C_SCL GPIO_PC2 #define I2C_SDA GPIO_PC3