[FL-2480] Use SysTick as the main OS timer (#1140)
* Use SysTick as OS tick timer * Use LPTIM2 as tickless idle timer * Remove dummy LPTIM2 IRQ handler * Clean up clock init code * Rename os timer to idle timer * Advance hal ticks along with FreeRTOS's * Improve SysTick control during tickless idle * Improve idle timer precision * Correct SysTick IRQ priority * Main, FuriHal: move system startup to separate thread * Minor code cleanup Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
|
||||
#define TAG "FuriHalDelay"
|
||||
|
||||
static volatile uint32_t tick_cnt = 0;
|
||||
|
||||
void furi_hal_delay_init() {
|
||||
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
|
||||
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
|
||||
@@ -18,12 +16,8 @@ uint32_t furi_hal_delay_instructions_per_microsecond() {
|
||||
return SystemCoreClock / 1000000;
|
||||
}
|
||||
|
||||
void furi_hal_tick(void) {
|
||||
tick_cnt++;
|
||||
}
|
||||
|
||||
uint32_t furi_hal_get_tick(void) {
|
||||
return tick_cnt;
|
||||
return osKernelGetTickCount();
|
||||
}
|
||||
|
||||
uint32_t furi_hal_ms_to_ticks(float milliseconds) {
|
||||
|
Reference in New Issue
Block a user