[FL-2975] Bug fixes and improvements: Furi, Input, Cli (#2004)
* Furi: configurable heap allocation tracking * Furi: relax restriction in thread heap setter asserts, apply heap tracking setting on app start instead of thread allocation * Furi: hide dangerous heap tracking levels in release build * Input: fix non-working debounce
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,7.4,,
|
||||
Version,+,7.5,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
Header,+,applications/services/cli/cli_vcp.h,,
|
||||
@@ -1260,6 +1260,7 @@ Function,+,furi_hal_rtc_deinit_early,void,
|
||||
Function,+,furi_hal_rtc_get_boot_mode,FuriHalRtcBootMode,
|
||||
Function,+,furi_hal_rtc_get_datetime,void,FuriHalRtcDateTime*
|
||||
Function,+,furi_hal_rtc_get_fault_data,uint32_t,
|
||||
Function,+,furi_hal_rtc_get_heap_track_mode,FuriHalRtcHeapTrackMode,
|
||||
Function,+,furi_hal_rtc_get_log_level,uint8_t,
|
||||
Function,+,furi_hal_rtc_get_pin_fails,uint32_t,
|
||||
Function,+,furi_hal_rtc_get_register,uint32_t,FuriHalRtcRegister
|
||||
@@ -1272,6 +1273,7 @@ Function,+,furi_hal_rtc_set_boot_mode,void,FuriHalRtcBootMode
|
||||
Function,+,furi_hal_rtc_set_datetime,void,FuriHalRtcDateTime*
|
||||
Function,+,furi_hal_rtc_set_fault_data,void,uint32_t
|
||||
Function,+,furi_hal_rtc_set_flag,void,FuriHalRtcFlag
|
||||
Function,+,furi_hal_rtc_set_heap_track_mode,void,FuriHalRtcHeapTrackMode
|
||||
Function,+,furi_hal_rtc_set_log_level,void,uint8_t
|
||||
Function,+,furi_hal_rtc_set_pin_fails,void,uint32_t
|
||||
Function,+,furi_hal_rtc_set_register,void,"FuriHalRtcRegister, uint32_t"
|
||||
|
|
@@ -10,7 +10,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* Input Related Constants */
|
||||
#define INPUT_DEBOUNCE_TICKS 30
|
||||
#define INPUT_DEBOUNCE_TICKS 4
|
||||
|
||||
/* Input Keys */
|
||||
typedef enum {
|
||||
|
@@ -30,7 +30,8 @@ typedef struct {
|
||||
uint8_t log_reserved : 4;
|
||||
uint8_t flags;
|
||||
uint8_t boot_mode : 4;
|
||||
uint16_t reserved : 12;
|
||||
uint8_t heap_track_mode : 2;
|
||||
uint16_t reserved : 10;
|
||||
} DeveloperReg;
|
||||
|
||||
_Static_assert(sizeof(DeveloperReg) == 4, "DeveloperReg size mismatch");
|
||||
@@ -224,6 +225,19 @@ FuriHalRtcBootMode furi_hal_rtc_get_boot_mode() {
|
||||
return (FuriHalRtcBootMode)data->boot_mode;
|
||||
}
|
||||
|
||||
void furi_hal_rtc_set_heap_track_mode(FuriHalRtcHeapTrackMode mode) {
|
||||
uint32_t data_reg = furi_hal_rtc_get_register(FuriHalRtcRegisterSystem);
|
||||
DeveloperReg* data = (DeveloperReg*)&data_reg;
|
||||
data->heap_track_mode = mode;
|
||||
furi_hal_rtc_set_register(FuriHalRtcRegisterSystem, data_reg);
|
||||
}
|
||||
|
||||
FuriHalRtcHeapTrackMode furi_hal_rtc_get_heap_track_mode() {
|
||||
uint32_t data_reg = furi_hal_rtc_get_register(FuriHalRtcRegisterSystem);
|
||||
DeveloperReg* data = (DeveloperReg*)&data_reg;
|
||||
return (FuriHalRtcHeapTrackMode)data->heap_track_mode;
|
||||
}
|
||||
|
||||
void furi_hal_rtc_set_datetime(FuriHalRtcDateTime* datetime) {
|
||||
furi_assert(datetime);
|
||||
|
||||
|
@@ -39,6 +39,13 @@ typedef enum {
|
||||
FuriHalRtcBootModePostUpdate, /**< Boot to Update, post update */
|
||||
} FuriHalRtcBootMode;
|
||||
|
||||
typedef enum {
|
||||
FuriHalRtcHeapTrackModeNone = 0, /**< Disable allocation tracking */
|
||||
FuriHalRtcHeapTrackModeMain, /**< Enable allocation tracking for main application thread */
|
||||
FuriHalRtcHeapTrackModeTree, /**< Enable allocation tracking for main and children application threads */
|
||||
FuriHalRtcHeapTrackModeAll, /**< Enable allocation tracking for all threads */
|
||||
} FuriHalRtcHeapTrackMode;
|
||||
|
||||
typedef enum {
|
||||
FuriHalRtcRegisterHeader, /**< RTC structure header */
|
||||
FuriHalRtcRegisterSystem, /**< Various system bits */
|
||||
@@ -79,6 +86,10 @@ void furi_hal_rtc_set_boot_mode(FuriHalRtcBootMode mode);
|
||||
|
||||
FuriHalRtcBootMode furi_hal_rtc_get_boot_mode();
|
||||
|
||||
void furi_hal_rtc_set_heap_track_mode(FuriHalRtcHeapTrackMode mode);
|
||||
|
||||
FuriHalRtcHeapTrackMode furi_hal_rtc_get_heap_track_mode();
|
||||
|
||||
void furi_hal_rtc_set_datetime(FuriHalRtcDateTime* datetime);
|
||||
|
||||
void furi_hal_rtc_get_datetime(FuriHalRtcDateTime* datetime);
|
||||
|
Reference in New Issue
Block a user