From 1dd3ec4db76bc3204007f2e7e34d419ec7a1131b Mon Sep 17 00:00:00 2001 From: solosky Date: Thu, 26 Sep 2024 22:14:26 +0800 Subject: [PATCH] Fixed #281: Add Go Sleep menu in settings --- .../app/settings/scene/settings_scene_main.c | 6 + fw/application/src/i18n/de_DE.c | 1 + fw/application/src/i18n/en_US.c | 1 + fw/application/src/i18n/es_ES.c | 1 + fw/application/src/i18n/fr_FR.c | 1 + fw/application/src/i18n/hu_HU.c | 1 + fw/application/src/i18n/it_IT.c | 1 + fw/application/src/i18n/ja_JP.c | 1 + fw/application/src/i18n/nl_NL.c | 1 + fw/application/src/i18n/pt_BR.c | 1 + fw/application/src/i18n/ru_RU.c | 1 + fw/application/src/i18n/string_id.h | 1 + fw/application/src/i18n/zh_Hans.c | 1 + fw/application/src/i18n/zh_TW.c | 1 + .../src/mui/u8g2_font_wqy12_t_gb2312a.c | 272 +++++++++--------- fw/application/src/utils.c | 26 +- fw/application/src/utils2.h | 10 +- fw/data/i18n.csv | 1 + 18 files changed, 173 insertions(+), 155 deletions(-) diff --git a/fw/application/src/app/settings/scene/settings_scene_main.c b/fw/application/src/app/settings/scene/settings_scene_main.c index 3ccf26d7..f66435fd 100644 --- a/fw/application/src/app/settings/scene/settings_scene_main.c +++ b/fw/application/src/app/settings/scene/settings_scene_main.c @@ -19,6 +19,7 @@ enum settings_main_menu_t { SETTINGS_MAIN_MENU_SHOW_MEM_USAGE, SETTINGS_MAIN_MENU_SLEEP_TIMEOUT, SETTINGS_MAIN_MENU_ANIM_ENABLED, + SETTINGS_MAIN_MENU_GO_SLEEP, SETTINGS_MAIN_MENU_DFU, SETTINGS_MAIN_MENU_REBOOT, SETTINGS_MAIN_MENU_RESET_DEFAULT, @@ -84,6 +85,10 @@ static void settings_scene_main_list_view_on_selected(mui_list_view_event_t even mui_scene_dispatcher_next_scene(app->p_scene_dispatcher, SETTINGS_SCENE_LANGUAGE); break; + case SETTINGS_MAIN_MENU_GO_SLEEP: + go_sleep(); + break; + case SETTINGS_MAIN_MENU_DFU: enter_dfu(); break; @@ -205,6 +210,7 @@ static void settings_scene_main_reload(void *user_data) { mui_list_view_add_item_ext(app->p_list_view, 0xe1c9, _T(APP_SET_SLEEP_TIMEOUT), txt, (void *)SETTINGS_MAIN_MENU_SLEEP_TIMEOUT); + mui_list_view_add_item(app->p_list_view, 0xe1c9, _T(APP_SET_GO_SLEEP), (void *)SETTINGS_MAIN_MENU_GO_SLEEP); mui_list_view_add_item(app->p_list_view, 0xe1ca, _T(APP_SET_DFU), (void *)SETTINGS_MAIN_MENU_DFU); mui_list_view_add_item(app->p_list_view, 0xe1cb, _T(APP_SET_REBOOT), (void *)SETTINGS_MAIN_MENU_REBOOT); mui_list_view_add_item(app->p_list_view, 0xe1ce, _T(APP_SET_RESET_DEFAULT), diff --git a/fw/application/src/i18n/de_DE.c b/fw/application/src/i18n/de_DE.c index 9b58ea72..9fd7ad18 100644 --- a/fw/application/src/i18n/de_DE.c +++ b/fw/application/src/i18n/de_DE.c @@ -26,6 +26,7 @@ const char * const lang_de_DE[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Schnelles Aufwachen", [_L_APP_SET_SLEEP_TIMEOUT] = "Standby nach", [_L_APP_SET_LANGUAGE] = "Sprache", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "Firmw. Aktualisierung", [_L_APP_SET_REBOOT] = "System Neustart", [_L_APP_SET_RESET_DEFAULT] = "Standardeinstellungen", diff --git a/fw/application/src/i18n/en_US.c b/fw/application/src/i18n/en_US.c index d452ecc4..658a74d0 100644 --- a/fw/application/src/i18n/en_US.c +++ b/fw/application/src/i18n/en_US.c @@ -26,6 +26,7 @@ const char * const lang_en_US[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Fast Wakeup", [_L_APP_SET_SLEEP_TIMEOUT] = "Sleep Timeout", [_L_APP_SET_LANGUAGE] = "Language", + [_L_APP_SET_GO_SLEEP] = "Go Sleep", [_L_APP_SET_DFU] = "Firmware Update", [_L_APP_SET_REBOOT] = "System Reboot", [_L_APP_SET_RESET_DEFAULT] = "Reset Default Setting", diff --git a/fw/application/src/i18n/es_ES.c b/fw/application/src/i18n/es_ES.c index b3e737c9..977ba09b 100644 --- a/fw/application/src/i18n/es_ES.c +++ b/fw/application/src/i18n/es_ES.c @@ -26,6 +26,7 @@ const char * const lang_es_ES[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Hibernar", [_L_APP_SET_SLEEP_TIMEOUT] = "Dormir en:", [_L_APP_SET_LANGUAGE] = "Idioma", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "Actualizar firmware", [_L_APP_SET_REBOOT] = "Reiniciar", [_L_APP_SET_RESET_DEFAULT] = "Restablecer config.", diff --git a/fw/application/src/i18n/fr_FR.c b/fw/application/src/i18n/fr_FR.c index 73dc43b5..f6696005 100644 --- a/fw/application/src/i18n/fr_FR.c +++ b/fw/application/src/i18n/fr_FR.c @@ -26,6 +26,7 @@ const char * const lang_fr_FR[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Réveil Rapide", [_L_APP_SET_SLEEP_TIMEOUT] = "Délai de mise en veille", [_L_APP_SET_LANGUAGE] = "Langue", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "Mise à Jour du Micrologiciel", [_L_APP_SET_REBOOT] = "Redémarrage du Système", [_L_APP_SET_RESET_DEFAULT] = "Rétablir les Paramètres par Défaut", diff --git a/fw/application/src/i18n/hu_HU.c b/fw/application/src/i18n/hu_HU.c index 62145bfd..f66c057c 100644 --- a/fw/application/src/i18n/hu_HU.c +++ b/fw/application/src/i18n/hu_HU.c @@ -26,6 +26,7 @@ const char * const lang_hu_HU[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Gyors Ébresztés", [_L_APP_SET_SLEEP_TIMEOUT] = "Alvási Időkorlát", [_L_APP_SET_LANGUAGE] = "Nyelv", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "Firmware Frissítés", [_L_APP_SET_REBOOT] = "Rendszer Újraindítása", [_L_APP_SET_RESET_DEFAULT] = "Alapért. Beállítás Visszaállítása", diff --git a/fw/application/src/i18n/it_IT.c b/fw/application/src/i18n/it_IT.c index ff1cda27..34fa8f7b 100644 --- a/fw/application/src/i18n/it_IT.c +++ b/fw/application/src/i18n/it_IT.c @@ -26,6 +26,7 @@ const char * const lang_it_IT[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Risveglio rapido", [_L_APP_SET_SLEEP_TIMEOUT] = "Timeout di sospensione", [_L_APP_SET_LANGUAGE] = "Lingua", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "Aggiornamento firmware", [_L_APP_SET_REBOOT] = "Riavvio del sistema", [_L_APP_SET_RESET_DEFAULT] = "Ripristina impostazioni predefinite", diff --git a/fw/application/src/i18n/ja_JP.c b/fw/application/src/i18n/ja_JP.c index ed3eb507..b9db0380 100644 --- a/fw/application/src/i18n/ja_JP.c +++ b/fw/application/src/i18n/ja_JP.c @@ -26,6 +26,7 @@ const char * const lang_ja_JP[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "高速起動", [_L_APP_SET_SLEEP_TIMEOUT] = "スリープタイムアウト", [_L_APP_SET_LANGUAGE] = "言語", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "ファームウェア更新", [_L_APP_SET_REBOOT] = "システム再起動", [_L_APP_SET_RESET_DEFAULT] = "デフォルト設定に戻す", diff --git a/fw/application/src/i18n/nl_NL.c b/fw/application/src/i18n/nl_NL.c index c7e8562c..c199cc6e 100644 --- a/fw/application/src/i18n/nl_NL.c +++ b/fw/application/src/i18n/nl_NL.c @@ -26,6 +26,7 @@ const char * const lang_nl_NL[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Snel Ontwaken", [_L_APP_SET_SLEEP_TIMEOUT] = "Time-out Slaapstand", [_L_APP_SET_LANGUAGE] = "Taal", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "Firmware Bijwerken", [_L_APP_SET_REBOOT] = "Systeem Herstarten", [_L_APP_SET_RESET_DEFAULT] = "Terugzetten Naar Standaardwaarden", diff --git a/fw/application/src/i18n/pt_BR.c b/fw/application/src/i18n/pt_BR.c index 8b9976a4..94973874 100644 --- a/fw/application/src/i18n/pt_BR.c +++ b/fw/application/src/i18n/pt_BR.c @@ -26,6 +26,7 @@ const char * const lang_pt_BR[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Despertar Rápido", [_L_APP_SET_SLEEP_TIMEOUT] = "Tempo Limite de Suspensão", [_L_APP_SET_LANGUAGE] = "Idioma", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "Atualização de Firmware", [_L_APP_SET_REBOOT] = "Reinicialização do Sistema", [_L_APP_SET_RESET_DEFAULT] = "Restaurar Configurações Padrão", diff --git a/fw/application/src/i18n/ru_RU.c b/fw/application/src/i18n/ru_RU.c index 3c406c2b..ad09c9ba 100644 --- a/fw/application/src/i18n/ru_RU.c +++ b/fw/application/src/i18n/ru_RU.c @@ -26,6 +26,7 @@ const char * const lang_ru_RU[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "Гибернация", [_L_APP_SET_SLEEP_TIMEOUT] = "Таймаут сна", [_L_APP_SET_LANGUAGE] = "Язык", + [_L_APP_SET_GO_SLEEP] = "", [_L_APP_SET_DFU] = "Обновление ПО", [_L_APP_SET_REBOOT] = "Перезагрузка", [_L_APP_SET_RESET_DEFAULT] = "Сброс настроек", diff --git a/fw/application/src/i18n/string_id.h b/fw/application/src/i18n/string_id.h index e643be5c..0e77b56f 100644 --- a/fw/application/src/i18n/string_id.h +++ b/fw/application/src/i18n/string_id.h @@ -27,6 +27,7 @@ typedef enum { _L_APP_SET_HIBERNATE, _L_APP_SET_SLEEP_TIMEOUT, _L_APP_SET_LANGUAGE, + _L_APP_SET_GO_SLEEP, _L_APP_SET_DFU, _L_APP_SET_REBOOT, _L_APP_SET_RESET_DEFAULT, diff --git a/fw/application/src/i18n/zh_Hans.c b/fw/application/src/i18n/zh_Hans.c index 3c3d1183..719a6087 100644 --- a/fw/application/src/i18n/zh_Hans.c +++ b/fw/application/src/i18n/zh_Hans.c @@ -26,6 +26,7 @@ const char * const lang_zh_Hans[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "快速唤醒", [_L_APP_SET_SLEEP_TIMEOUT] = "休眠时间", [_L_APP_SET_LANGUAGE] = "系统语言", + [_L_APP_SET_GO_SLEEP] = "进入休眠", [_L_APP_SET_DFU] = "固件更新", [_L_APP_SET_REBOOT] = "重启设备", [_L_APP_SET_RESET_DEFAULT] = "重置默认配置", diff --git a/fw/application/src/i18n/zh_TW.c b/fw/application/src/i18n/zh_TW.c index 3ea80660..6df779ee 100644 --- a/fw/application/src/i18n/zh_TW.c +++ b/fw/application/src/i18n/zh_TW.c @@ -26,6 +26,7 @@ const char * const lang_zh_TW[_L_COUNT] = { [_L_APP_SET_HIBERNATE] = "快速喚醒", [_L_APP_SET_SLEEP_TIMEOUT] = "休眠時間", [_L_APP_SET_LANGUAGE] = "系統語言", + [_L_APP_SET_GO_SLEEP] = "進入休眠", [_L_APP_SET_DFU] = "軟體升級", [_L_APP_SET_REBOOT] = "重啟設備", [_L_APP_SET_RESET_DEFAULT] = "重置默認配置", diff --git a/fw/application/src/mui/u8g2_font_wqy12_t_gb2312a.c b/fw/application/src/mui/u8g2_font_wqy12_t_gb2312a.c index b733fd5d..eb9a131f 100644 --- a/fw/application/src/mui/u8g2_font_wqy12_t_gb2312a.c +++ b/fw/application/src/mui/u8g2_font_wqy12_t_gb2312a.c @@ -6,12 +6,12 @@ /* Fontname: -wenquanyi-wenquanyi bitmap song-medium-r-normal--12-120-75-75-P-119-ISO10646-1 Copyright: (null) - Glyphs: 1624/30503 + Glyphs: 1625/30503 BBX Build Mode: 0 */ #ifdef U8G2_USE_LARGE_FONTS -const uint8_t u8g2_font_wqy12_t_gb2312a[40228] U8G2_FONT_SECTION("u8g2_font_wqy12_t_gb2312a") = - "X\0\3\2\4\4\4\4\5\14\15\0\376\10\376\12\377\1d\2\331\5t \5\0\230\26!\7\221\212" +const uint8_t u8g2_font_wqy12_t_gb2312a[40254] U8G2_FONT_SECTION("u8g2_font_wqy12_t_gb2312a") = + "Y\0\3\2\4\4\4\4\5\14\15\0\376\10\376\12\377\1d\2\331\5t \5\0\230\26!\7\221\212" "\26\247\0\42\7\64\371\26\221)#\16\226\210\67Q\313\260D\275\14K\324\2$\17\245xV\331RQ" "\62QK\224\312\26\1%\20\226x\66Q\322EK\302\64\211\222.Z\2&\16\205\210VY\22%Y" "eJ\242H\11'\6\61\372\25\3(\13\263yVI\224D\335\242,)\14\263y\26Y\224E]\242" @@ -1136,137 +1136,137 @@ const uint8_t u8g2_font_wqy12_t_gb2312a[40228] U8G2_FONT_SECTION("u8g2_font_wqy1 "\33\273x\65&\215Z\0\226b\35\273x\34C\24FY%\31N\251\22\15J" - "\224G\303!)U\242\212V\221R\1\226d\36\273x\34CV\252DI\224%R\262(a\26\15\247" - ",\233\222\266(\222\262H\325\0\226\206 \273x\34C\222F\311\240T\264D\234\222D\233\222Z\224\14" - "\7)K\242A\211\263h\30\4\226\217 \273x\34c\226(\303\220\64j\203R\213\222\344\220tJ\244" - "dH\262$J\62\65\212\6\1\226\220\42\273x\34C\62D\225\250\222\14\213\222&\245A\211\322$J" - "\6E\211\302$Q\232\222(\21\207\10\226\250!\273x\34CVR\206%*i\303\220\204IiY\242" - "\244eH\222\245\224\264%Q\22eC\0\226\274\30\273x\134Y<\134\264\60\31\6\255<\14Zy\70" - "\207\303A\16\1\226\276\35\273x\334I\64DI\232\14C\64eI)\214\206\251-I\206\245\251\30\345" - "\303\0\226\304\37\273x|\345(\211\206\203\224%a\244dI\64(\245$*\15K\226\204I\333\220\14" - "\2\226\306\33\273x|I\236\245\303A\211\362a\320\242|\30\264(\35\16ZR\233\242\1\226\314\37\273" - "x\134I\224&\215I\62,\203\22%\225a\351\224T\206\245S\62(\221\224\14r\10\226\350\30\273x" - "\34\17j\216\305\303)+%\235\42O\225NY)\213\24\0\226\352\31\273x<\303\71\35\36CEI" - "\224\34\35\356X\66\14:\26\15\27\0\226\366\30\273x<\303\71\35\236\222R\70k\222\226I\303\220C" - "\371\216i\0\226\367\30\273x<\303\71\35\36CEI\224\64\36NYi\70e\245\341\2\226\373\30\273" - "x<\303\71\35^\242J\62\234\262\322p\312J\303\71L\207\1\227\0\31\273x<\303\71\35^\224D" - "I\323\341 \346\303\251\22\265D-\211\2\227\6\34\273x<\303\71\35^\242\312\240\14Z\30.\203\230" - "\205\311\60H\71\242\14\203\0\227\23\33\273x<\303\71\35^\242J\62\15Q\36\15\311\20\345\321p\214" - "\262!\33\4\227\36\32\273x<\303\71\35\236\222\322\260\14Q\61\32Na\24\15IT\325\242I\227\62" - "\36\273x<\303\71\35\236\222\322 \15I\224H\311\220\211\221\264\34\222Z\224\14\321\220\0\227\70\34\273" - "x<\303\71\35\236\222\322p\220*Q\62(C\322)\31\16Y)\213\42\5\227R\27\273x\274\361p" - "\316\207!O\207\203\26\246\303\32\246\303\32F\0\227Y\37\273x\134a\66,[%\33\222!\13\223d" - "\70(Q%R\222!J\244\60*&\66\0\227^\34\273x\234I\216\24\7e\20\223\34\251\16\311\220" - "&\71R\34\224ALr\244\10\227`\34\273x\134\365a\220\262t\70Hi\70\14q\22\16\312 &" - "\341\240\14b\22\2\227b\30\272y\34\17a\216\304\303A*IC$\225\244!\222J\303;\22\227i" - "\30\273x|\265\341\240\225\7\35\311\207!\214\212\303\220\247\303AM\1\227\215\35\273x<\265l\70(" - "\215\311\226\206\331\360RJ\222A\211\262P\32\244$\213\264\0\227\363\31\273x\274\361p\314\362$\34\16" - ":<\14a\32\16C\230\206\303\20\1\227\365\34\273x\134Y\70(a\226\14J\343\260dy\64\254Z" - "\244\14\203\246\245\303\246\0\230\5\31\273x\274\303AJ\243a*F\321\60\25\243\341\240\205\351\60G\251" - "\30\230\30\36\273x|\311\60\211Y\224\14K\244\225\206C\222\205\311\240\224\262(\33\264\250\230\204\1\230" - "^\36\273x\34IeP\306\332pH\262d\32\226\266(\33\16I\26e\203RKj[\0\230o\42" - "\273x<\203\62$Y\224\15\312\220dI\224\14\312\220D\211\24)\311\220tJ\224aH\372\267\0\230" - "u\31\273x\34\17j>\14a\32F\305\250\30\25#%\216\342P\222\23\0\230y\32\273x\274\303A" - "J\243a*F\225\250%j\211\242!\211V\35\211R\61\230\177\35\273x\134\331 \245\321\240\14R\226" - ")]\224.\303\322\224%\245$\13\265$\326\2\230\206\33\273x|\321\240\205\225(\224\206!\252\305I" - "eH\32\223\266\260%\214\262\0\230\221\37\273x|\321\240\24\263d\30\224R\66\14J-J\272(-" - "JE\252\224\302$\321\264\0\230\230!\273x\65&\215Z\0\226b\35\273x\34C\24FY%\31N\251\22\15J\224G\303!)U" + "\242\212V\221R\1\226d\36\273x\34CV\252DI\224%R\262(a\26\15\247,\233\222\266(\222" + "\262H\325\0\226\206 \273x\34C\222F\311\240T\264D\234\222D\233\222Z\224\14\7)K\242A\211" + "\263h\30\4\226\217 \273x\34c\226(\303\220\64j\203R\213\222\344\220tJ\244dH\262$J\62" + "\65\212\6\1\226\220\42\273x\34C\62D\225\250\222\14\213\222&\245A\211\322$J\6E\211\302$Q" + "\232\222(\21\207\10\226\250!\273x\34CVR\206%*i\303\220\204IiY\242\244eH\222\245\224" + "\264%Q\22eC\0\226\274\30\273x\134Y<\134\264\60\31\6\255<\14Zy\70\207\303A\16\1\226" + "\276\35\273x\334I\64DI\232\14C\64eI)\214\206\251-I\206\245\251\30\345\303\0\226\304\37\273" + "x|\345(\211\206\203\224%a\244dI\64(\245$*\15K\226\204I\333\220\14\2\226\306\33\273x" + "|I\236\245\303A\211\362a\320\242|\30\264(\35\16ZR\233\242\1\226\314\37\273x\134I\224&\215" + "I\62,\203\22%\225a\351\224T\206\245S\62(\221\224\14r\10\226\350\30\273x\34\17j\216\305\303" + ")+%\235\42O\225NY)\213\24\0\226\352\31\273x<\303\71\35\36CEI\224\34\35\356X\66" + "\14:\26\15\27\0\226\366\30\273x<\303\71\35\236\222R\70k\222\226I\303\220C\371\216i\0\226\367" + "\30\273x<\303\71\35\36CEI\224\64\36NYi\70e\245\341\2\226\373\30\273x<\303\71\35^" + "\242J\62\234\262\322p\312J\303\71L\207\1\227\0\31\273x<\303\71\35^\224DI\323\341 \346\303" + "\251\22\265D-\211\2\227\6\34\273x<\303\71\35^\242\312\240\14Z\30.\203\230\205\311\60H\71\242" + "\14\203\0\227\23\33\273x<\303\71\35^\242J\62\15Q\36\15\311\20\345\321p\214\262!\33\4\227\36" + "\32\273x<\303\71\35\236\222\322\260\14Q\61\32Na\24\15IT\325\242I\227\62\36\273x<\303\71" + "\35\236\222\322 \15I\224H\311\220\211\221\264\34\222Z\224\14\321\220\0\227\70\34\273x<\303\71\35\236" + "\222\322p\220*Q\62(C\322)\31\16Y)\213\42\5\227R\27\273x\274\361p\316\207!O\207\203" + "\26\246\303\32\246\303\32F\0\227Y\37\273x\134a\66,[%\33\222!\13\223d\70(Q%R\222" + "!J\244\60*&\66\0\227^\34\273x\234I\216\24\7e\20\223\34\251\16\311\220&\71R\34\224A" + "Lr\244\10\227`\34\273x\134\365a\220\262t\70Hi\70\14q\22\16\312 &\341\240\14b\22\2" + "\227b\30\272y\34\17a\216\304\303A*IC$\225\244!\222J\303;\22\227i\30\273x|\265\341" + "\240\225\7\35\311\207!\214\212\303\220\247\303AM\1\227\215\35\273x<\265l\70(\215\311\226\206\331\360" + "RJ\222A\211\262P\32\244$\213\264\0\227\363\31\273x\274\361p\314\362$\34\16:<\14a\32\16" + "C\230\206\303\20\1\227\365\34\273x\134Y\70(a\226\14J\343\260dy\64\254Z\244\14\203\246\245\303" + "\246\0\230\5\31\273x\274\303AJ\243a*F\321\60\25\243\341\240\205\351\60G\251\30\230\30\36\273x" + "|\311\60\211Y\224\14K\244\225\206C\222\205\311\240\224\262(\33\264\250\230\204\1\230^\36\273x\34I" + "eP\306\332pH\262d\32\226\266(\33\16I\26e\203RKj[\0\230o\42\273x<\203\62$" + "Y\224\15\312\220dI\224\14\312\220D\211\24)\311\220tJ\224aH\372\267\0\230u\31\273x\34\17" + "j>\14a\32F\305\250\30\25#%\216\342P\222\23\0\230y\32\273x\274\303AJ\243a*F\225" + "\250%j\211\242!\211V\35\211R\61\230\177\35\273x\134\331 \245\321\240\14R\226)]\224.\303\322" + "\224%\245$\13\265$\326\2\230\206\33\273x|\321\240\205\225(\224\206!\252\305IeH\32\223\266\260" + "%\214\262\0\230\221\37\273x|\321\240\24\263d\30\224R\66\14J-J\272(-JE\252\224\302$" + "\321\264\0\230\230!\273xDEVICEID[0]), 4); memcpy(p_device_id + 4, &(NRF_FICR->DEVICEID[1]), 4); } -void int32_to_bytes_le(uint32_t val, uint8_t* data) { - data[0] = val>>24; - data[1] = val>>16; - data[2] = val>>8; - data[3] = val>>0; +void int32_to_bytes_le(uint32_t val, uint8_t *data) { + data[0] = val >> 24; + data[1] = val >> 16; + data[2] = val >> 8; + data[3] = val >> 0; } void enter_dfu() { @@ -39,6 +39,6 @@ void enter_dfu() { sd_nvic_SystemReset(); } -void system_reboot(){ - sd_nvic_SystemReset(); -} \ No newline at end of file +void system_reboot() { sd_nvic_SystemReset(); } + +void go_sleep() { nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF); } \ No newline at end of file diff --git a/fw/application/src/utils2.h b/fw/application/src/utils2.h index 77fa0bad..f990f5bc 100644 --- a/fw/application/src/utils2.h +++ b/fw/application/src/utils2.h @@ -8,16 +8,14 @@ #ifndef UTILS2_H_ #define UTILS2_H_ -#include #include "sdk_errors.h" +#include ret_code_t utils_rand_bytes(uint8_t rand[], uint8_t bytes); -void int32_to_bytes_le(uint32_t val, uint8_t* data) ; -void utils_get_device_id(uint8_t* p_device_id); +void int32_to_bytes_le(uint32_t val, uint8_t *data); +void utils_get_device_id(uint8_t *p_device_id); void enter_dfu(); void system_reboot(); - - - +void go_sleep(); #endif /* UTILS_H_ */ diff --git a/fw/data/i18n.csv b/fw/data/i18n.csv index 6a187eed..522e4fa7 100644 --- a/fw/data/i18n.csv +++ b/fw/data/i18n.csv @@ -25,6 +25,7 @@ _L_APP_SET_SHOW_MEM_USAGE,Memory Used,内存使用率,記憶體使用率,Estad. _L_APP_SET_HIBERNATE,Fast Wakeup,快速唤醒,快速喚醒,Hibernar,Gyors Ébresztés,Schnelles Aufwachen,Réveil Rapide,Snel Ontwaken,Despertar Rápido,高速起動,Risveglio rapido,Гибернация _L_APP_SET_SLEEP_TIMEOUT,Sleep Timeout,休眠时间,休眠時間,Dormir en:,Alvási Időkorlát,Standby nach,Délai de mise en veille,Time-out Slaapstand,Tempo Limite de Suspensão,スリープタイムアウト,Timeout di sospensione,Таймаут сна _L_APP_SET_LANGUAGE,Language,系统语言,系統語言,Idioma,Nyelv,Sprache,Langue,Taal,Idioma,言語,Lingua,Язык +_L_APP_SET_GO_SLEEP,Go Sleep,进入休眠,進入休眠,,,,,,,,, _L_APP_SET_DFU,Firmware Update,固件更新,軟體升級,Actualizar firmware,Firmware Frissítés,Firmw. Aktualisierung,Mise à Jour du Micrologiciel,Firmware Bijwerken,Atualização de Firmware,ファームウェア更新,Aggiornamento firmware,Обновление ПО _L_APP_SET_REBOOT,System Reboot,重启设备,重啟設備,Reiniciar,Rendszer Újraindítása,System Neustart,Redémarrage du Système,Systeem Herstarten,Reinicialização do Sistema,システム再起動,Riavvio del sistema,Перезагрузка _L_APP_SET_RESET_DEFAULT,Reset Default Setting,重置默认配置,重置默認配置,Restablecer config.,Alapért. Beállítás Visszaállítása,Standardeinstellungen,Rétablir les Paramètres par Défaut,Terugzetten Naar Standaardwaarden,Restaurar Configurações Padrão,デフォルト設定に戻す,Ripristina impostazioni predefinite,Сброс настроек