Furi: core refactoring and CMSIS removal part 2 (#1410)
* Furi: rename and move core * Furi: drop CMSIS_OS header and unused api, partially refactor and cleanup the rest * Furi: CMSIS_OS drop and refactoring. * Furi: refactoring, remove cmsis legacy * Furi: fix incorrect assert on queue deallocation, cleanup timer * Furi: improve delay api, get rid of floats * hal: dropped furi_hal_crc * Furi: move DWT based delay to cortex HAL * Furi: update core documentation Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
@@ -26,7 +26,7 @@ int32_t rfal_platform_irq_thread(void* context) {
|
||||
UNUSED(context);
|
||||
|
||||
while(1) {
|
||||
uint32_t flags = furi_thread_flags_wait(0x1, osFlagsWaitAny, osWaitForever);
|
||||
uint32_t flags = furi_thread_flags_wait(0x1, FuriFlagWaitAny, FuriWaitForever);
|
||||
if(flags & 0x1) {
|
||||
rfal_platform.callback();
|
||||
}
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <limits.h>
|
||||
#include <cmsis_os2.h>
|
||||
#include "timer.h"
|
||||
#include "math.h"
|
||||
#include <furi_hal_gpio.h>
|
||||
@@ -104,10 +103,9 @@ void rfal_platform_spi_release();
|
||||
timerCalculateTimer(t) /*!< Create a timer with the given time (ms) */
|
||||
#define platformTimerIsExpired(timer) \
|
||||
timerIsExpired(timer) /*!< Checks if the given timer is expired */
|
||||
#define platformDelay(t) osDelay(t) /*!< Performs a delay for the given time (ms) */
|
||||
#define platformDelay(t) furi_delay_ms(t) /*!< Performs a delay for the given time (ms) */
|
||||
|
||||
#define platformGetSysTick() \
|
||||
osKernelGetTickCount() /*!< Get System Tick (1 tick = 1 ms) */
|
||||
#define platformGetSysTick() furi_get_tick() /*!< Get System Tick (1 tick = 1 ms) */
|
||||
|
||||
#define platformAssert(exp) assert_param(exp) /*!< Asserts whether the given expression is true*/
|
||||
|
||||
|
@@ -41,7 +41,7 @@
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "timer.h"
|
||||
#include <furi_hal_delay.h>
|
||||
#include <furi.h>
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
@@ -65,7 +65,7 @@ static uint32_t timerStopwatchTick;
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t timerCalculateTimer(uint16_t time) {
|
||||
return (furi_hal_get_tick() + time);
|
||||
return (furi_get_tick() + time);
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
@@ -73,7 +73,7 @@ bool timerIsExpired(uint32_t timer) {
|
||||
uint32_t uDiff;
|
||||
int32_t sDiff;
|
||||
|
||||
uDiff = (timer - furi_hal_get_tick()); /* Calculate the diff between the timers */
|
||||
uDiff = (timer - furi_get_tick()); /* Calculate the diff between the timers */
|
||||
sDiff = uDiff; /* Convert the diff to a signed var */
|
||||
|
||||
/* Check if the given timer has expired already */
|
||||
@@ -96,10 +96,10 @@ void timerDelay(uint16_t tOut) {
|
||||
|
||||
/*******************************************************************************/
|
||||
void timerStopwatchStart(void) {
|
||||
timerStopwatchTick = furi_hal_get_tick();
|
||||
timerStopwatchTick = furi_get_tick();
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t timerStopwatchMeasure(void) {
|
||||
return (uint32_t)(furi_hal_get_tick() - timerStopwatchTick);
|
||||
return (uint32_t)(furi_get_tick() - timerStopwatchTick);
|
||||
}
|
||||
|
Reference in New Issue
Block a user