@@ -653,7 +653,7 @@ unsigned long uartBaudrateDetect(uart_t *uart, bool flg)
653
653
654
654
UART_MUTEX_LOCK ();
655
655
log_i ("rxd_edge_cnt = %d lowpulse_min_cnt = %d hightpulse_min_cnt = %d" , hw -> rxd_cnt .rxd_edge_cnt , hw -> lowpulse .lowpulse_min_cnt , hw -> highpulse .highpulse_min_cnt );
656
- unsigned long ret = ( hw -> lowpulse .lowpulse_min_cnt + hw -> highpulse .highpulse_min_cnt ) >> 1 ;
656
+ unsigned long ret = hw -> lowpulse .lowpulse_min_cnt + hw -> highpulse .highpulse_min_cnt ;
657
657
UART_MUTEX_UNLOCK ();
658
658
659
659
return ret ;
@@ -778,7 +778,7 @@ uartDetectBaudrate(uart_t *uart)
778
778
// log_v("Divisor: %d", divisor);
779
779
// log_v("Divider: %d", div16);
780
780
781
- baudrate = sclk_freq / ( divisor * 2 ) ;
781
+ baudrate = sclk_freq / divisor ;
782
782
783
783
// switch(clk_src)
784
784
// {
@@ -827,8 +827,11 @@ uartDetectBaudrate(uart_t *uart)
827
827
}
828
828
}
829
829
830
- log_v ("Rounded %d to %d (b: %d) (n: %d)" , baudrate , default_rates [i ], default_rates [i - 1 ], default_rates [i + 1 ]); //THIS WILL OVERFLOW, only for testing now
831
-
830
+ log_v ("Rounded\t%d\tto\t%d" , baudrate , default_rates [i ]);
831
+ log_v ("From Previous\t( %d )\t:\t( %d )" , default_rates [i - 1 ], baudrate - default_rates [i - 1 ] ); //THIS WILL OVERFLOW, only for testing now
832
+ log_v ("From Current\t( %d )\t:\t( %d )" , default_rates [i ], default_rates [i ] - baudrate ); //THIS WILL OVERFLOW, only for testing now
833
+ log_v ("From Next\t( %d )\t:\t( %d )" , default_rates [i + 1 ], default_rates [i + 1 ] - baudrate ); //THIS WILL OVERFLOW, only for testing now
834
+
832
835
return default_rates [i ];
833
836
#else
834
837
#ifdef CONFIG_IDF_TARGET_ESP32C3
0 commit comments