@@ -90,9 +90,8 @@ typedef enum {
90
90
91
91
static bool is_soft_reset = 0 ;
92
92
93
- #if CONFIG_IDF_TARGET_ESP32C3
94
- int esp_clk_cpu_freq (void );
95
- #endif
93
+ // Note: this is from a private IDF header
94
+ extern int esp_clk_cpu_freq (void );
96
95
97
96
static mp_obj_t mp_machine_get_freq (void ) {
98
97
return mp_obj_new_int (esp_rom_get_cpu_ticks_per_us () * 1000000 );
@@ -101,11 +100,11 @@ static mp_obj_t mp_machine_get_freq(void) {
101
100
static void mp_machine_set_freq (size_t n_args , const mp_obj_t * args ) {
102
101
mp_int_t freq = mp_obj_get_int (args [0 ]) / 1000000 ;
103
102
if (freq != 20 && freq != 40 && freq != 80 && freq != 160
104
- #if !CONFIG_IDF_TARGET_ESP32C3
103
+ #if !( CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 )
105
104
&& freq != 240
106
105
#endif
107
106
) {
108
- #if CONFIG_IDF_TARGET_ESP32C3
107
+ #if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
109
108
mp_raise_ValueError (MP_ERROR_TEXT ("frequency must be 20MHz, 40MHz, 80Mhz or 160MHz" ));
110
109
#else
111
110
mp_raise_ValueError (MP_ERROR_TEXT ("frequency must be 20MHz, 40MHz, 80Mhz, 160MHz or 240MHz" ));
@@ -118,6 +117,8 @@ static void mp_machine_set_freq(size_t n_args, const mp_obj_t *args) {
118
117
esp_pm_config_esp32_t pm ;
119
118
#elif CONFIG_IDF_TARGET_ESP32C3
120
119
esp_pm_config_esp32c3_t pm ;
120
+ #elif CONFIG_IDF_TARGET_ESP32C6
121
+ esp_pm_config_esp32c6_t pm ;
121
122
#elif CONFIG_IDF_TARGET_ESP32S2
122
123
esp_pm_config_esp32s2_t pm ;
123
124
#elif CONFIG_IDF_TARGET_ESP32S3
@@ -146,7 +147,7 @@ static void machine_sleep_helper(wake_type_t wake_type, size_t n_args, const mp_
146
147
esp_sleep_enable_timer_wakeup (((uint64_t )expiry ) * 1000 );
147
148
}
148
149
149
- #if !CONFIG_IDF_TARGET_ESP32C3
150
+ #if !( CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 )
150
151
151
152
if (machine_rtc_config .ext0_pin != -1 && (machine_rtc_config .ext0_wake_types & wake_type )) {
152
153
esp_sleep_enable_ext0_wakeup (machine_rtc_config .ext0_pin , machine_rtc_config .ext0_level ? 1 : 0 );
0 commit comments