summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c8
-rw-r--r--firmware/target/arm/tms320dm320/system-dm320.c8
2 files changed, 7 insertions, 9 deletions
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
index c22bd2c21d..c8b2c9623c 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c
@@ -229,8 +229,8 @@ static void spi_txrx(unsigned char *buf_tx, unsigned char *buf_rx, int n)
{
IO_SERIAL1_TX_DATA = buf_tx[i];
- /* a short wait for AVR to process data */
- sleep(0);
+ /* 100 us wait for AVR */
+ udelay(100);
do
{
@@ -240,8 +240,8 @@ static void spi_txrx(unsigned char *buf_tx, unsigned char *buf_rx, int n)
if (buf_rx != NULL)
buf_rx[i] = rxdata & 0xFF;
- /* seems to be unneccessary */
- //udelay(100);
+ /* 100 us wait to give AVR time to process data */
+ udelay(100);
}
IO_SERIAL1_TX_ENABLE = 0;
diff --git a/firmware/target/arm/tms320dm320/system-dm320.c b/firmware/target/arm/tms320dm320/system-dm320.c
index a2a9ec3661..e455ade590 100644
--- a/firmware/target/arm/tms320dm320/system-dm320.c
+++ b/firmware/target/arm/tms320dm320/system-dm320.c
@@ -426,7 +426,7 @@ void udelay(int usec) {
stop = count + usec*((tmp+1)/10000);
stop += (unsigned short)(((unsigned long)(usec)*((tmp%10000)+1))/10000);
- /* stop values over tmdiv won't ever be reached */
+ /* stop values over TMDIV won't ever be reached */
if (stop > tmp)
{
stop -= tmp;
@@ -435,15 +435,13 @@ void udelay(int usec) {
if (stop < count)
{
/* udelay will end after counter reset (tick) */
- while ((((tmp = IO_TIMER1_TMCNT) < stop) &&
- (current_tick != prev_tick)) ||
+ while (((IO_TIMER1_TMCNT < stop) && (current_tick != prev_tick)) ||
(current_tick == prev_tick)); /* ensure new tick */
}
else
{
/* udelay will end before counter reset (tick) */
- while (((tmp = IO_TIMER1_TMCNT) < stop) &&
- (current_tick == prev_tick));
+ while ((IO_TIMER1_TMCNT < stop) && (current_tick == prev_tick));
}
}