fix(bootloader): Fix compilation issue in bootloader build during verbose+sb+fe

This commit is contained in:
nilesh.kale
2023-10-06 17:17:05 +05:30
parent 202bcadfd3
commit 59c5b5fe6b
25 changed files with 160 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -270,10 +270,17 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
__attribute__((constructor))
static void enable_timer_group0_for_calibration(void)
{
#ifndef BOOTLOADER_BUILD
PERIPH_RCC_ACQUIRE_ATOMIC(PERIPH_TIMG0_MODULE, ref_count) {
if (ref_count == 0) {
timer_ll_enable_bus_clock(0, true);
timer_ll_reset_register(0);
}
}
#else
// no critical section is needed for bootloader
int __DECLARE_RCC_RC_ATOMIC_ENV;
timer_ll_enable_bus_clock(0, true);
timer_ll_reset_register(0);
#endif
}