added some generic timer macros for stm32, untested and should still be done properly

This commit is contained in:
Felix Ruess
2011-12-06 20:20:01 +01:00
parent 73d15af8ba
commit 939dd78a6f
+6
View File
@@ -50,6 +50,12 @@ extern uint32_t cpu_time_ticks;
#define SYS_TICS_OF_SEC(s) (uint32_t)((s) * AHB_CLK + 0.5)
#define SIGNED_SYS_TICS_OF_SEC(s) (int32_t)((s) * AHB_CLK + 0.5)
/* Generic timer macros */
//FIXME: untested!
#define SysTimeTimerStart(_t) { _t = cpu_time_ticks; }
#define SysTimeTimer(_t) ((uint32_t)(cpu_time_ticks - _t))
#define SysTimeTimerStop(_t) { _t = (cpu_time_ticks - _t); }
static inline bool_t sys_time_periodic( void ) {
if (sys_time_period_elapsed) {
sys_time_period_elapsed = FALSE;