Skip to content

Commit c59b42c

Browse files
committed
Merge branch 'fix/fix_h4_wrong_spinlock' into 'master'
fix(esp_system): fix wrong spinlock num on H4 See merge request espressif/esp-idf!39924
2 parents a2b98b3 + e6e898e commit c59b42c

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

components/esp_hw_support/ldo/esp_ldo_regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct ldo_regulator_channel_t {
2727
} flags;
2828
} ldo_regulator_channel_t;
2929

30-
static portMUX_TYPE s_spinlock = portMUX_INITIALIZER_UNLOCKED;
30+
static __attribute__((unused)) portMUX_TYPE s_spinlock = portMUX_INITIALIZER_UNLOCKED;
3131

3232
static const uint32_t s_ldo_channel_adjustable_mask = LDO_LL_ADJUSTABLE_CHAN_MASK; // each bit represents if the LDO channel is adjustable in hardware
3333

components/esp_hw_support/port/esp32p4/io_mux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#define RTCIO_RCC_ATOMIC() PERIPH_RCC_ATOMIC()
2020

21-
static portMUX_TYPE s_io_mux_spinlock = portMUX_INITIALIZER_UNLOCKED;
21+
static __attribute__((unused)) portMUX_TYPE s_io_mux_spinlock = portMUX_INITIALIZER_UNLOCKED;
2222
static soc_module_clk_t s_io_mux_clk_src = 0; // by default, the clock source is not set explicitly by any consumer (e.g. SDM, Filter)
2323

2424
#if CONFIG_ULP_COPROC_ENABLED

components/esp_system/include/esp_private/critical_section.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
extern "C" {
2323
#endif
2424

25-
#if (CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32P4) && !NON_OS_BUILD
25+
/**
26+
* In theory, OS_SPINLOCK should only be defined in a multi-core environment, because critical-section-related
27+
* functions there take a lock as a parameter. In practice, since the Xtensa FreeRTOS port layer is the same
28+
* for the ESP32, S3, and S2, the latter also requires a parameter in its critical-section-related functions.
29+
*/
30+
#if (!CONFIG_FREERTOS_UNICORE || CONFIG_IDF_TARGET_ARCH_XTENSA) && !NON_OS_BUILD
2631
/**
2732
* This macro also helps users switching between spinlock declarations/definitions for multi-/single core environments
2833
* if the macros below aren't sufficient.

0 commit comments

Comments
 (0)