set timezone offset in hours and minutes
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | TZ_HOURS_EEPROM_ADDR 4 |
#define | TZ_MINUTES_EEPROM_ADDR 5 |
Functions | |
PROGMEM_DECLARE (char const, tz_hours_title[]) | |
PROGMEM_DECLARE (char const, tz_n12[]) | |
PROGMEM_DECLARE (char const, tz_n11[]) | |
PROGMEM_DECLARE (char const, tz_n10[]) | |
PROGMEM_DECLARE (char const, tz_n09[]) | |
PROGMEM_DECLARE (char const, tz_n08[]) | |
PROGMEM_DECLARE (char const, tz_n07[]) | |
PROGMEM_DECLARE (char const, tz_n06[]) | |
PROGMEM_DECLARE (char const, tz_n05[]) | |
PROGMEM_DECLARE (char const, tz_n04[]) | |
PROGMEM_DECLARE (char const, tz_n03[]) | |
PROGMEM_DECLARE (char const, tz_n02[]) | |
PROGMEM_DECLARE (char const, tz_n01[]) | |
PROGMEM_DECLARE (char const, tz_00[]) | |
PROGMEM_DECLARE (char const, tz_01[]) | |
PROGMEM_DECLARE (char const, tz_02[]) | |
PROGMEM_DECLARE (char const, tz_03[]) | |
PROGMEM_DECLARE (char const, tz_04[]) | |
PROGMEM_DECLARE (char const, tz_05[]) | |
PROGMEM_DECLARE (char const, tz_06[]) | |
PROGMEM_DECLARE (char const, tz_07[]) | |
PROGMEM_DECLARE (char const, tz_08[]) | |
PROGMEM_DECLARE (char const, tz_09[]) | |
PROGMEM_DECLARE (char const, tz_10[]) | |
PROGMEM_DECLARE (char const, tz_11[]) | |
PROGMEM_DECLARE (char const, tz_12[]) | |
PROGMEM_DECLARE (char const, tz_minutes_title[]) | |
PROGMEM_DECLARE (char const, tz_min_00[]) | |
PROGMEM_DECLARE (char const, tz_min_15[]) | |
PROGMEM_DECLARE (char const, tz_min_30[]) | |
PROGMEM_DECLARE (char const, tz_min_45[]) | |
int8_t | timezone_get_hours (void) |
get the current timezone offset (hours) More... | |
int8_t | timezone_get_minutes (void) |
get the current timezone offset (minutes) More... | |
void | timezone_init (void) |
get and set timezone stored in EEPROM More... | |
void | timezone_select_application (void) |
Select timezone application. More... | |
int8_t | tz_index_to_minutes (uint8_t tz_minutes_index) |
Convert from tz_minute_menu index to actual minutes. More... | |
Variables | |
static int8_t | tz_hours |
struct gfx_mono_menu | tz_hours_menu |
PROGMEM_STRING_T | tz_hours_strings [] |
static int8_t | tz_minutes |
struct gfx_mono_menu | tz_minutes_menu |
PROGMEM_STRING_T | tz_minutes_strings [] |
#define TZ_HOURS_EEPROM_ADDR 4 |
Referenced by timezone_init(), and timezone_select_application().
#define TZ_MINUTES_EEPROM_ADDR 5 |
Referenced by timezone_init(), and timezone_select_application().
PROGMEM_DECLARE | ( | char | const, |
tz_hours_title | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n12 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n11 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n10 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n09 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n08 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n07 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n06 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n05 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n04 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n03 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n02 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_n01 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_00 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_01 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_02 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_03 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_04 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_05 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_06 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_07 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_08 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_09 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_10 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_11 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_12 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_minutes_title | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_min_00 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_min_15 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_min_30 | [] | ||
) |
PROGMEM_DECLARE | ( | char | const, |
tz_min_45 | [] | ||
) |
int8_t timezone_get_hours | ( | void | ) |
get the current timezone offset (hours)
timezone | offset (hours) |
References tz_hours.
Referenced by display_date_time_application(), set_date_application(), and set_time_application().
int8_t timezone_get_minutes | ( | void | ) |
get the current timezone offset (minutes)
timezone | offset (minutes) |
References tz_minutes.
Referenced by display_date_time_application(), set_date_application(), and set_time_application().
void timezone_init | ( | void | ) |
get and set timezone stored in EEPROM
This function will check if a timezone has been stored in EEPROM. If this is the case it will be set, and used by the date&time application. If it is not set, the "select timezone" application will be started to set it
References gfx_mono_menu::current_selection, nvm_eeprom_read_byte(), temp, timezone_select_application(), tz_hours, TZ_HOURS_EEPROM_ADDR, tz_index_to_minutes(), tz_minutes, and TZ_MINUTES_EEPROM_ADDR.
Referenced by main().
void timezone_select_application | ( | void | ) |
Select timezone application.
This application will show a menu with available timezone offset and set the selected timezone to be used by the date&time application. If the timezone setting differs from the already stored setting in EEPROM, the EEPROM value will be updated with the new selection.
References GFX_MONO_MENU_EVENT_EXIT, GFX_MONO_MENU_EVENT_IDLE, gfx_mono_menu_init(), gfx_mono_menu_process_key(), keyboard_get_key_state(), KEYBOARD_RELEASE, keyboard_event::keycode, nvm_eeprom_read_byte(), nvm_eeprom_write_byte(), keyboard_event::type, tz_hours, TZ_HOURS_EEPROM_ADDR, tz_index_to_minutes(), tz_minutes, and TZ_MINUTES_EEPROM_ADDR.
Referenced by date_time_application(), and timezone_init().
int8_t tz_index_to_minutes | ( | uint8_t | tz_minutes_index | ) |
Convert from tz_minute_menu index to actual minutes.
tz_minutes_index | index in tz_minutes menu |
actual | number of minutes timezone offset |
Referenced by timezone_init(), and timezone_select_application().
|
static |
Referenced by set_date_application(), set_time_application(), timezone_get_hours(), timezone_init(), and timezone_select_application().
struct gfx_mono_menu tz_hours_menu |
PROGMEM_STRING_T tz_hours_strings[] |
|
static |
struct gfx_mono_menu tz_minutes_menu |
PROGMEM_STRING_T tz_minutes_strings[] |