Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into release-candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes committed Jun 14, 2023
2 parents 1ac1f0b + b6dbf25 commit 60baf2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions firmware/targets/f7/furi_hal/furi_hal_clock.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <furi_hal_clock.h>
#include <furi_hal_resources.h>
#include <furi_hal_rtc.h>
#include <furi.h>

#include <stm32wbxx_ll_pwr.h>
Expand Down Expand Up @@ -143,7 +142,10 @@ void furi_hal_clock_switch_to_hsi() {
}

void furi_hal_clock_switch_to_pll() {
#ifdef FURI_HAL_CLOCK_TRACK_STARTUP
uint32_t clock_start_time = DWT->CYCCNT;
#endif

LL_RCC_HSE_Enable();
LL_RCC_PLL_Enable();
LL_RCC_PLLSAI1_Enable();
Expand All @@ -166,11 +168,12 @@ void furi_hal_clock_switch_to_pll() {
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
;

#ifdef FURI_HAL_CLOCK_TRACK_STARTUP
uint32_t total = DWT->CYCCNT - clock_start_time;
if(total > (20 * 0x148)) {
furi_hal_rtc_set_flag(FuriHalRtcFlagLegacySleep);
furi_crash("Slow HSE/PLL startup");
}
#endif
}

void furi_hal_clock_suspend_tick() {
Expand Down
4 changes: 2 additions & 2 deletions firmware/targets/f7/furi_hal/furi_hal_nfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ bool furi_hal_nfc_emulate_nfca(
buff_tx,
buff_tx_len,
buff_rx,
sizeof(buff_rx),
rfalConvBytesToBits(buff_rx_size),
&buff_rx_len,
data_type,
RFAL_FWT_NONE);
Expand All @@ -491,7 +491,7 @@ bool furi_hal_nfc_emulate_nfca(
buff_tx,
buff_tx_len,
buff_rx,
sizeof(buff_rx),
rfalConvBytesToBits(buff_rx_size),
&buff_rx_len,
data_type,
RFAL_FWT_NONE);
Expand Down

0 comments on commit 60baf2a

Please sign in to comment.