Guard RCC registers access with critical section (#854)

* Core: critical section macros. FuriHal: guard rcc registers access with critical section, fix condition race.
* FuriHal: update documentation.

Co-authored-by: SG <who.just.the.doctor@gmail.com>
This commit is contained in:
あく
2021-12-01 01:07:17 +03:00
committed by GitHub
parent 6f7d93fe72
commit 418c0939a0
14 changed files with 148 additions and 78 deletions

View File

@@ -136,8 +136,10 @@ static void furi_hal_irda_tim_rx_isr() {
void furi_hal_irda_async_rx_start(void) {
furi_assert(furi_hal_irda_state == IrdaStateIdle);
FURI_CRITICAL_ENTER();
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM2);
LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA);
FURI_CRITICAL_EXIT();
hal_gpio_init_ex(&gpio_irda_rx, GpioModeAltFunctionPushPull, GpioPullNo, GpioSpeedLow, GpioAltFn1TIM2);