Mercurial > ecos
comparison packages/hal/cortexm/arch/current/src/hal_misc.c @ 2589:9da21501bc5b
* include/hal_intr.h:
Fixed load value of SysTick counter.
* src/hal_misc.c:
Fixed wrap-around in hal_delay_us().
| author | nickg |
|---|---|
| date | Wed, 05 Nov 2008 09:59:41 +0000 |
| parents | 07fc475e1c28 |
| children | d16f29a90821 |
comparison
equal
deleted
inserted
replaced
| 2588:7e2527e87885 | 2589:9da21501bc5b |
|---|---|
| 498 HAL_CLOCK_READ( &t0 ); | 498 HAL_CLOCK_READ( &t0 ); |
| 499 while ( us > 0 ) | 499 while ( us > 0 ) |
| 500 { | 500 { |
| 501 HAL_CLOCK_READ( &t1 ); | 501 HAL_CLOCK_READ( &t1 ); |
| 502 if( t1 < t0 ) | 502 if( t1 < t0 ) |
| 503 t1 += CYGNUM_HAL_RTC_PERIOD; | 503 us -= (t1 + CYGNUM_HAL_RTC_PERIOD - t0); |
| 504 us -= t1-t0; | 504 else |
| 505 us -= t1 - t0; | |
| 505 t0 = t1; | 506 t0 = t1; |
| 506 } | 507 } |
| 507 } | 508 } |
| 508 | 509 |
| 509 //========================================================================== | 510 //========================================================================== |
