1
0
Fork 0
forked from len0rd/rockbox

Sansa Connect: Implement RTC functionality

Use 32-bit monotime AVR counter for time tracking. Set the time by
adding fixed offset to the counter value. Store the offset in rockbox
directory to make it persistent between reboots.

Do not implement alarm functionality as wakeup is only possible from
sleep and not from complete power off.

Change-Id: I615c7eb4df8ab0619dcbfcff107bc7051a15aace
This commit is contained in:
Tomasz Moń 2021-06-23 17:15:36 +02:00
parent 635ec5bbbd
commit 3738510953
No known key found for this signature in database
GPG key ID: 92BA8820D4D517C8
4 changed files with 176 additions and 25 deletions

View file

@ -73,6 +73,18 @@ static const struct button_mapping button_context_yesno[] = {
LAST_ITEM_IN_LIST
}; /* button_context_yesno */
static const struct button_mapping button_context_settings_time[] = {
{ACTION_STD_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV},
{ACTION_STD_PREVREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV},
{ACTION_STD_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT},
{ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT},
{ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT},
{ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
{ACTION_SETTINGS_INC, BUTTON_SCROLL_FWD, BUTTON_NONE},
{ACTION_SETTINGS_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE},
LAST_ITEM_IN_LIST
}; /* button_context_settings_time */
static const struct button_mapping button_context_keyboard[] = {
{ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE},
{ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
@ -113,7 +125,9 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_KEYBOARD:
case CONTEXT_MORSE_INPUT:
return button_context_keyboard;
case CONTEXT_SETTINGS_TIME:
return button_context_settings_time;
case CONTEXT_TREE:
case CONTEXT_LIST:
case CONTEXT_MAINMENU: