timezone settings
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
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) |
Convert from tz_minute_menu index to actual minutes. More... | |
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(), 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().