Skip to content

Commit 7443fe2

Browse files
committed
trigger callbacks even when APB did not change
1 parent 0532c88 commit 7443fe2

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

cores/esp32/esp32-hal-cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ bool setCpuFrequency(uint32_t cpu_freq_mhz){
145145
apb = calculateApb(&conf);
146146
log_i("%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == RTC_CPU_FREQ_SRC_PLL)?"PLL":((conf.source == RTC_CPU_FREQ_SRC_APLL)?"APLL":((conf.source == RTC_CPU_FREQ_SRC_XTAL)?"XTAL":"8M")), conf.source_freq_mhz, conf.div, conf.freq_mhz, apb);
147147
//Call peripheral functions before the APB change
148-
if(capb != apb && apb_change_callbacks){
148+
if(apb_change_callbacks){
149149
triggerApbChangeCallback(APB_BEFORE_CHANGE, capb, apb);
150150
}
151151
//Make the frequency change
@@ -164,7 +164,7 @@ bool setCpuFrequency(uint32_t cpu_freq_mhz){
164164
uint32_t fcpu = (conf.freq_mhz >= 80)?(conf.freq_mhz * MHZ):(apb);
165165
_xt_tick_divisor = fcpu / XT_TICK_PER_SEC;
166166
//Call peripheral functions after the APB change
167-
if(capb != apb && apb_change_callbacks){
167+
if(apb_change_callbacks){
168168
triggerApbChangeCallback(APB_AFTER_CHANGE, capb, apb);
169169
}
170170
return true;

cores/esp32/esp32-hal-uart.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ void uartEnd(uart_t* uart)
231231

232232
UART_MUTEX_LOCK();
233233
if(uart->queue != NULL) {
234-
uint8_t c;
235-
while(xQueueReceive(uart->queue, &c, 0));
236234
vQueueDelete(uart->queue);
237235
uart->queue = NULL;
238236
}
@@ -252,8 +250,6 @@ size_t uartResizeRxBuffer(uart_t * uart, size_t new_size) {
252250

253251
UART_MUTEX_LOCK();
254252
if(uart->queue != NULL) {
255-
uint8_t c;
256-
while(xQueueReceive(uart->queue, &c, 0));
257253
vQueueDelete(uart->queue);
258254
uart->queue = xQueueCreate(new_size, sizeof(uint8_t));
259255
if(uart->queue == NULL) {

0 commit comments

Comments
 (0)