This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
STM32 diag driver fix
- From: Simon Kallweit <simon dot kallweit at intefo dot ch>
- To: eCos Patches List <ecos-patches at ecos dot sourceware dot org>
- Date: Tue, 07 Apr 2009 15:13:58 +0200
- Subject: STM32 diag driver fix
This patch fixes hal_stm32_serial_getc_timeout() for high baudrates. The
original version lost bytes due to the long timeout.
diff --git a/packages/hal/cortexm/stm32/var/current/src/hal_diag.c b/packages/hal/cortexm/stm32/var/current/src/hal_diag.c
index 2ea1871..cc4930d 100644
--- a/packages/hal/cortexm/stm32/var/current/src/hal_diag.c
+++ b/packages/hal/cortexm/stm32/var/current/src/hal_diag.c
@@ -213,14 +213,14 @@ hal_stm32_serial_getc_timeout(void* __ch_data, cyg_uint8* ch)
cyg_bool res;
CYGARC_HAL_SAVE_GP();
- delay_count = chan->msec_timeout * 10; // delay in .1 ms steps
+ delay_count = chan->msec_timeout * 100; // delay in 10 us steps
for(;;) {
res = hal_stm32_serial_getc_nonblock(__ch_data, ch);
if (res || 0 == delay_count--)
break;
- CYGACC_CALL_IF_DELAY_US(100);
+ CYGACC_CALL_IF_DELAY_US(10);
}
CYGARC_HAL_RESTORE_GP();