[FL-3226] Deep Sleep Idle (#2569)

* Improve RNG error handling
* Sync RTC shadow registers on Stop mode exit
* Implement working STOP2 mode
* Fix formatting
* FuriHal: disable SWD pins if debug is disabled
* Power: cleanup battery info view, handle zero current report from gauge
* Fbt: add command line argument for extra global defines
* FuriHal: cleanup debug defines in power and os, drop deep_insomnia counter.
* Add a setting to disable deep sleep
* Clean up furi_hal_power
* FuriHal,FapLoader,Debug: implement debug in stop mode, workaround resume in stop
* FuriHal: document OS and power subsystems debugging
* Furi: enable debug interface on crash

---------

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Georgii Surkov
2023-04-13 17:47:38 +03:00
committed by GitHub
parent 5d7bdca835
commit 37fb330b36
26 changed files with 246 additions and 120 deletions

View File

@@ -18,6 +18,9 @@ void furi_hal_debug_enable();
/** Disable MCU debug */
void furi_hal_debug_disable();
/** Check if GDB debug session is active */
bool furi_hal_debug_is_gdb_session_active();
#ifdef __cplusplus
}
#endif

View File

@@ -58,12 +58,6 @@ void furi_hal_power_insomnia_exit();
*/
bool furi_hal_power_sleep_available();
/** Check if deep sleep availble
*
* @return true if available
*/
bool furi_hal_power_deep_sleep_available();
/** Go to sleep
*/
void furi_hal_power_sleep();

View File

@@ -30,6 +30,7 @@ typedef enum {
FuriHalRtcFlagLock = (1 << 2),
FuriHalRtcFlagC2Update = (1 << 3),
FuriHalRtcFlagHandOrient = (1 << 4),
FuriHalRtcFlagLegacySleep = (1 << 5),
} FuriHalRtcFlag;
typedef enum {
@@ -85,6 +86,9 @@ void furi_hal_rtc_deinit_early();
/** Initialize RTC subsystem */
void furi_hal_rtc_init();
/** Force sync shadow registers */
void furi_hal_rtc_sync_shadow();
/** Get RTC register content
*
* @param[in] reg The register identifier