mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Furi, FuriHal: remove FreeRTOS headers leaks (#3179)
* Furi: remove direct FreeRTOS timers use * Furi: eliminate FreeRTOS headers leak. What did it cost? Everything... * SubGhz: proper public api for protocols. Format Sources. * Furi: slightly less redundant declarations * Desktop: proper types in printf * Sync API Symbols * Furi: add timer reset and fix dolphin service, fix unit tests * Furi: proper timer restart method naming and correct behavior in timer stopped state. --------- Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
|
||||
#include <hsem_map.h>
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
|
||||
#define TAG "FuriHalFlash"
|
||||
|
||||
#define FURI_HAL_CRITICAL_MSG "Critical flash operation fail"
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
|
||||
#define TAG "FuriHalOs"
|
||||
|
||||
#define FURI_HAL_IDLE_TIMER_CLK_HZ 32768
|
||||
|
||||
@@ -459,10 +459,10 @@ void furi_hal_power_disable_external_3_3v() {
|
||||
}
|
||||
|
||||
void furi_hal_power_suppress_charge_enter() {
|
||||
vTaskSuspendAll();
|
||||
FURI_CRITICAL_ENTER();
|
||||
bool disable_charging = furi_hal_power.suppress_charge == 0;
|
||||
furi_hal_power.suppress_charge++;
|
||||
xTaskResumeAll();
|
||||
FURI_CRITICAL_EXIT();
|
||||
|
||||
if(disable_charging) {
|
||||
furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
|
||||
@@ -472,10 +472,10 @@ void furi_hal_power_suppress_charge_enter() {
|
||||
}
|
||||
|
||||
void furi_hal_power_suppress_charge_exit() {
|
||||
vTaskSuspendAll();
|
||||
FURI_CRITICAL_ENTER();
|
||||
furi_hal_power.suppress_charge--;
|
||||
bool enable_charging = furi_hal_power.suppress_charge == 0;
|
||||
xTaskResumeAll();
|
||||
FURI_CRITICAL_EXIT();
|
||||
|
||||
if(enable_charging) {
|
||||
furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
|
||||
|
||||
@@ -200,7 +200,7 @@ bool furi_hal_spi_bus_trx_dma(
|
||||
furi_assert(size > 0);
|
||||
|
||||
// If scheduler is not running, use blocking mode
|
||||
if(xTaskGetSchedulerState() != taskSCHEDULER_RUNNING) {
|
||||
if(furi_kernel_is_running()) {
|
||||
return furi_hal_spi_bus_trx(handle, tx_buffer, rx_buffer, size, timeout_ms);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user