@@ -160,18 +160,25 @@ void taskWaitNotify(){
160
160
#define TIMER_INTR_SEL TIMER_INTR_LEVEL /*!< Timer level interrupt */
161
161
#define TIMER_GROUP TIMER_GROUP_0 /*!< Test on timer group 0 */
162
162
#define TIMER_DIVIDER 80 /*!< Hardware timer clock divider */
163
+
163
164
#if (ESP_IDF_VERSION_MAJOR >=5 ) || CONFIG_IDF_TARGET_ESP32C3
164
- #define TIMER_FINE_ADJ (1.4*(esp_clk_apb_freq() / TIMER_DIVIDER)/1000000) /*!< used to compensate alarm value */
165
- #define TIMER_TX_UPDATE (TIMER_N ) TIMERG0.hw_timer[TIMER_N].update.tx_update = 1
166
- #define TIMER_ALARM_EN (TIMER_N ) TIMERG0.hw_timer[TIMER_N].config.tx_alarm_en = 1;
167
- #define TIMER_0_INT_CLR () TIMERG0.int_clr_timers.t0_int_clr = 1
168
- #define TIMER_1_INT_CLR () TIMERG0.int_clr_timers.t1_int_clr = 1
165
+ #define TIMER_FINE_ADJ (1.4*(esp_clk_apb_freq() / TIMER_DIVIDER)/1000000) /*!< used to compensate alarm value */
166
+ #define TIMER_TX_UPDATE (TIMER_N ) TIMERG0.hw_timer[TIMER_N].update.tx_update = 1
167
+ #define TIMER_ALARM_EN (TIMER_N ) TIMERG0.hw_timer[TIMER_N].config.tx_alarm_en = 1;
168
+ #define TIMER_0_INT_CLR () TIMERG0.int_clr_timers.t0_int_clr = 1
169
+ #define TIMER_1_INT_CLR () TIMERG0.int_clr_timers.t1_int_clr = 1
170
+ #elif CONFIG_IDF_TARGET_ESP32S3
171
+ #define TIMER_FINE_ADJ (1.4*(esp_clk_apb_freq() / TIMER_DIVIDER)/1000000) /*!< used to compensate alarm value */
172
+ #define TIMER_TX_UPDATE (TIMER_N ) TIMERG0.hw_timer[TIMER_N].update.tn_update = 1
173
+ #define TIMER_ALARM_EN (TIMER_N ) TIMERG0.hw_timer[TIMER_N].config.tn_alarm_en = 1;
174
+ #define TIMER_0_INT_CLR () TIMERG0.int_clr_timers.t0_int_clr = 1
175
+ #define TIMER_1_INT_CLR () TIMERG0.int_clr_timers.t1_int_clr = 1
169
176
#else
170
- #define TIMER_FINE_ADJ (1.4*(TIMER_BASE_CLK / TIMER_DIVIDER)/1000000) /*!< used to compensate alarm value */
171
- #define TIMER_TX_UPDATE (TIMER_N ) TIMERG0.hw_timer[TIMER_N].update = 1
172
- #define TIMER_ALARM_EN (TIMER_N ) TIMERG0.hw_timer[TIMER_N].config.alarm_en = 1
173
- #define TIMER_0_INT_CLR () TIMERG0.int_clr_timers.t0 = 1;
174
- #define TIMER_1_INT_CLR () TIMERG0.int_clr_timers.t1 = 1;
177
+ #define TIMER_FINE_ADJ (1.4*(TIMER_BASE_CLK / TIMER_DIVIDER)/1000000) /*!< used to compensate alarm value */
178
+ #define TIMER_TX_UPDATE (TIMER_N ) TIMERG0.hw_timer[TIMER_N].update = 1
179
+ #define TIMER_ALARM_EN (TIMER_N ) TIMERG0.hw_timer[TIMER_N].config.alarm_en = 1
180
+ #define TIMER_0_INT_CLR () TIMERG0.int_clr_timers.t0 = 1;
181
+ #define TIMER_1_INT_CLR () TIMERG0.int_clr_timers.t1 = 1;
175
182
#endif
176
183
177
184
BaseType_t xHigherPriorityTaskWoken = pdFALSE ;
0 commit comments