Skip to content

Commit

Permalink
Can be bypassed by measurements when there is no E-Ink update
Browse files Browse the repository at this point in the history
  • Loading branch information
pvvx committed Jan 22, 2022
1 parent 33afaac commit 0992708
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0992708

Please sign in to comment.