[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:
あく
2022-11-12 17:46:04 +09:00
committed by GitHub
parent 721ab717d7
commit 90cefe7c71
10 changed files with 186 additions and 25 deletions

View File

@@ -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);