dst sys info

This commit is contained in:
olikraus 2017-06-11 15:39:48 +02:00
parent f5edc62a29
commit 86395a699d
4 changed files with 32 additions and 0 deletions

View File

@ -130,6 +130,21 @@ uint32_t get_wakeup_count(void)
return RTCWUCount;
}
int is_dst_by_date(uint8_t region);
uint32_t get_dst_by_date(void)
{
return is_dst_by_date(1);
}
uint32_t get_dst_by_RTC(void)
{
uint32_t dst_state = 0;
if ( RTC->CR & RTC_CR_BCK ) /* BKP flag in the CR register */
dst_state = 1;
return dst_state;
}
/*============================================*/
/* output */

View File

@ -114,6 +114,8 @@ uint32_t get_boot_status_register(void);
uint32_t get_pwr_status_register(void);
uint32_t get_reset_reason(void);
uint32_t get_wakeup_count(void);
uint32_t get_dst_by_date(void);
uint32_t get_dst_by_RTC(void);
void enable_alarm(void);
void disable_alarm(void);

View File

@ -82,6 +82,16 @@ uint32_t get_wakeup_count(void)
return 0;
}
uint32_t get_dst_by_date(void)
{
return -1;
}
uint32_t get_dst_by_RTC(void)
{
return 0;
}
/*============================================*/
/* output */

View File

@ -568,6 +568,11 @@ int me_action_handle_boot_info(menu_t *menu, const me_t *me, uint8_t msg)
u8g2_DrawStr(menu->u8g2, 0, 40-1, "Wakeups");
u8g2_DrawStr(menu->u8g2, 64, 40-1, u8x8_u16toa(get_wakeup_count(), 5));
u8g2_DrawStr(menu->u8g2, 0, 48-1, "DST by Date:");
u8g2_DrawStr(menu->u8g2, 50, 48-1, u8x8_u16toa(get_dst_by_date(), 2));
u8g2_DrawStr(menu->u8g2, 64, 48-1, "by RTC:");
u8g2_DrawStr(menu->u8g2, 95, 48-1, u8x8_u16toa(get_dst_by_RTC(), 1));
}