@@ -71,7 +71,7 @@ static uart_t _uart_bus_array[] = {
71
71
72
72
// solves issue https://github.com/espressif/arduino-esp32/issues/6032
73
73
// baudrate must be multiplied when CPU Frequency is lower than APB 80MHz
74
- uint32_t _get_effective_baudrate (uint32_t baudrate )
74
+ uint32_t _get_effective_baudrate (uint32_t baudrate )
75
75
{
76
76
uint32_t Freq = getApbFrequency ()/1000000 ;
77
77
if (Freq < 80 ) {
@@ -167,7 +167,7 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx
167
167
ESP_ERROR_CHECK (uart_param_config (uart_nr , & uart_config ));
168
168
ESP_ERROR_CHECK (uart_set_pin (uart_nr , txPin , rxPin , UART_PIN_NO_CHANGE , UART_PIN_NO_CHANGE ));
169
169
170
- // Is it right or the idea is to swap rx and tx pins?
170
+ // Is it right or the idea is to swap rx and tx pins?
171
171
if (inverted ) {
172
172
// invert signal for both Rx and Tx
173
173
ESP_ERROR_CHECK (uart_set_line_inverse (uart_nr , UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV ));
@@ -184,7 +184,7 @@ void uartEnd(uart_t* uart)
184
184
if (uart == NULL ) {
185
185
return ;
186
186
}
187
-
187
+
188
188
UART_MUTEX_LOCK ();
189
189
uart_driver_delete (uart -> num );
190
190
UART_MUTEX_UNLOCK ();
@@ -421,11 +421,12 @@ int log_printf(const char *format, ...)
421
421
va_list copy ;
422
422
va_start (arg , format );
423
423
va_copy (copy , arg );
424
- len = vsnprintf (NULL , 0 , format , arg );
424
+ len = vsnprintf (NULL , 0 , format , copy );
425
425
va_end (copy );
426
426
if (len >= sizeof (loc_buf )){
427
427
temp = (char * )malloc (len + 1 );
428
428
if (temp == NULL ) {
429
+ va_end (arg );
429
430
return 0 ;
430
431
}
431
432
}
@@ -553,7 +554,6 @@ void uartStartDetectBaudrate(uart_t *uart) {
553
554
//hw->conf0.autobaud_en = 0;
554
555
//hw->conf0.autobaud_en = 1;
555
556
#elif CONFIG_IDF_TARGET_ESP32S3
556
-
557
557
#else
558
558
hw -> auto_baud .glitch_filt = 0x08 ;
559
559
hw -> auto_baud .en = 0 ;
0 commit comments