Defines | |
| #define | TIM_PERIPHERAL_FRQ (MIOS32_SYS_CPU_FREQUENCY/4) |
| #define | STOPWATCH_TIMER_BASE LPC_TIM3 |
| #define | STOPWATCH_TIMER_BASE TIM6 |
| #define | STOPWATCH_TIMER_RCC RCC_APB1Periph_TIM6 |
| #define | TIM_PERIPHERAL_FRQ MIOS32_SYS_CPU_FREQUENCY |
Functions | |
| s32 | MIOS32_STOPWATCH_Init (u32 resolution) |
| s32 | MIOS32_STOPWATCH_Reset (void) |
| u32 | MIOS32_STOPWATCH_ValueGet (void) |
Allows to measure delays, which is especially useful for measuring the performance of a function, but also for user relevant features (e.g. Tap Tempo)
| #define STOPWATCH_TIMER_BASE TIM6 |
| #define STOPWATCH_TIMER_BASE LPC_TIM3 |
| #define STOPWATCH_TIMER_RCC RCC_APB1Periph_TIM6 |
| #define TIM_PERIPHERAL_FRQ MIOS32_SYS_CPU_FREQUENCY |
| #define TIM_PERIPHERAL_FRQ (MIOS32_SYS_CPU_FREQUENCY/4) |
Initializes the 16bit stopwatch timer with the desired resolution:
// initialize the stopwatch for 100 uS resolution // (only has to be done once, e.g. in APP_Init()) MIOS32_STOPWATCH_Init(100); // reset stopwatch MIOS32_STOPWATCH_Reset(); // execute function MyFunction(); // send execution time via DEFAULT COM interface u32 delay = MIOS32_STOPWATCH_ValueGet(); printf("Execution time of MyFunction: "); if( delay == 0xffffffff ) printf("Overrun!\n\r"); else printf("%d.%d mS\n\r", delay/10, delay%10);
| [in] | resolution | 1, 10, 100 or 1000 |
| s32 MIOS32_STOPWATCH_Reset | ( | void | ) |
Resets the stopwatch
| u32 MIOS32_STOPWATCH_ValueGet | ( | void | ) |
Returns current value of stopwatch
0xffffffff: counter overrun
1.4.7