mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-12 00:47:49 -04:00
Sansa Connect: use udelay() in AVR spi_txrx().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31377 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4aec001244
commit
44d1a26271
2 changed files with 7 additions and 9 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue