X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Ftimer.h;h=3bf12e17050b94bc914074047f5618bc3a9b7f1a;hb=8e431405692569d59b74509919eaec2f23df407f;hp=a2c05757d7bd75bf2d6a635a81d26f4ad6ce9db0;hpb=76c53bfa0136be55cf17e57b1ee098e5dfeefa70;p=bertos.git diff --git a/drv/timer.h b/drv/timer.h index a2c05757..3bf12e17 100755 --- a/drv/timer.h +++ b/drv/timer.h @@ -15,6 +15,9 @@ /*#* *#* $Log$ + *#* Revision 1.27 2005/11/27 03:04:19 bernie + *#* Move test code to timer_test.c; Add OS_HOSTED support. + *#* *#* Revision 1.26 2005/11/04 16:20:02 bernie *#* Fix reference to README.devlib in header. *#* @@ -92,11 +95,21 @@ #ifndef DRV_TIMER_H #define DRV_TIMER_H -#include +#include +#include + +/* + * Include platform-specific binding header if we're hosted. + * Try the CPU specific one for bare-metal environments. + */ +#if OS_HOSTED + #include OS_HEADER(timer) +#else + #include CPU_HEADER(timer) +#endif -#include CPU_HEADER(timer) #include -#include +#include #include #include @@ -193,7 +206,7 @@ INLINE hptime_t us_to_hptime(utime_t us) #if TIMER_HW_HPTICKS_PER_SEC > 10000000UL return(us * ((TIMER_HW_HPTICKS_PER_SEC + 500000UL) / 1000000UL)); #else - return((us * TIMER_HW_HPTICKS_PER_SEC + 500000UL) / 1000000UL)); + return((us * TIMER_HW_HPTICKS_PER_SEC + 500000UL) / 1000000UL); #endif /* TIMER_HW_HPTICKS_PER_SEC > 10000000UL */ }