[FL-3289] Various Furi/FuriHal bug fixes and improvements (#2637)
* Furi: properly handle thread free before TCB scrapping, add furi_free - more invasive version of free to memmgr. FuriHal: add DWT comparator api to cortex. Updater, RPC: refactor various thread shanenigans. Code cleanup. * Rollback free macros and related changes
This commit is contained in:
@@ -56,6 +56,53 @@ bool furi_hal_cortex_timer_is_expired(FuriHalCortexTimer cortex_timer);
|
||||
*/
|
||||
void furi_hal_cortex_timer_wait(FuriHalCortexTimer cortex_timer);
|
||||
|
||||
typedef enum {
|
||||
FuriHalCortexComp0,
|
||||
FuriHalCortexComp1,
|
||||
FuriHalCortexComp2,
|
||||
FuriHalCortexComp3,
|
||||
} FuriHalCortexComp;
|
||||
|
||||
typedef enum {
|
||||
FuriHalCortexCompSizeWord = 0b10,
|
||||
FuriHalCortexCompSizeHalfWord = 0b01,
|
||||
FuriHalCortexCompSizeByte = 0b00,
|
||||
} FuriHalCortexCompSize;
|
||||
|
||||
typedef enum {
|
||||
FuriHalCortexCompFunctionPC = 0b100,
|
||||
FuriHalCortexCompFunctionRead = 0b101,
|
||||
FuriHalCortexCompFunctionWrite = 0b110,
|
||||
FuriHalCortexCompFunctionReadWrite = 0b110,
|
||||
} FuriHalCortexCompFunction;
|
||||
|
||||
/** Enable DWT comparator
|
||||
*
|
||||
* Allows to programmatically set instruction/data breakpoints.
|
||||
*
|
||||
* More details on how it works can be found in armv7m official documentation:
|
||||
* https://developer.arm.com/documentation/ddi0403/d/Debug-Architecture/ARMv7-M-Debug/The-Data-Watchpoint-and-Trace-unit/The-DWT-comparators
|
||||
* https://developer.arm.com/documentation/ddi0403/d/Debug-Architecture/ARMv7-M-Debug/The-Data-Watchpoint-and-Trace-unit/Comparator-Function-registers--DWT-FUNCTIONn
|
||||
*
|
||||
* @param[in] comp The Comparator
|
||||
* @param[in] function The Comparator Function to use
|
||||
* @param[in] value The value
|
||||
* @param[in] mask The mask
|
||||
* @param[in] size The size
|
||||
*/
|
||||
void furi_hal_cortex_comp_enable(
|
||||
FuriHalCortexComp comp,
|
||||
FuriHalCortexCompFunction function,
|
||||
uint32_t value,
|
||||
uint32_t mask,
|
||||
FuriHalCortexCompSize size);
|
||||
|
||||
/** Reset DWT comparator
|
||||
*
|
||||
* @param[in] comp The Comparator
|
||||
*/
|
||||
void furi_hal_cortex_comp_reset(FuriHalCortexComp comp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user