Create global 'time' variable which holds RTC value

This commit is contained in:
2020-11-19 22:03:35 +01:00
parent ca61a84220
commit 29c593c2a4
9 changed files with 46 additions and 46 deletions

View File

@@ -1,5 +1,6 @@
#include "nightm.h"
#include "led.h"
#include "rtc.h"
#define TIME2INT(TIME) ((TIME).hour*60 + (TIME).minute)
@@ -9,11 +10,11 @@ void nightm_config(struct NIGHTM_CFG* cfg)
dump_ram2eem();
}
void nightm_handle(struct TIME_HMS* curr_time)
void nightm_handle(void)
{
if(ram_cfg.night_mode.led_btnes >= 0)
{
uint16_t current = TIME2INT(*curr_time);
uint16_t current = TIME2INT(time);
uint16_t begin = TIME2INT(ram_cfg.night_mode.begin);
uint16_t end = TIME2INT(ram_cfg.night_mode.end);