/* * you want to use this! */ int calcwindspeed(){ int curtick = 0; int speed = 0; disable_gpio_irq(2,13); curtick = cnttick; cnttick = 0; float div = Chip_TIMER_ReadCount(LPC_TIMER2)/ticksPerSecond; Chip_TIMER_Reset(LPC_TIMER2); enable_gpio_irq(2,13); DBG("div:%f count:%d\n",div,curtick); speed = curtick*(2.25/(div))*1.609344*100; //mph to km/h to 100m/h return speed; }
/* Start a stopwatch */ uint32_t StopWatch_Start(void) { /* Return the current timer count. */ return Chip_TIMER_ReadCount(LPC_TIMER32_1); }
uint32_t Board_TIMER_GetTimerCounter(uint8_t timerNum) { return Chip_TIMER_ReadCount(getTimerFomIndex(timerNum)); }
uint32 usecs() { return Chip_TIMER_ReadCount(SYS_CLOCK_TIMER32); }
uint32_t Timer_ReadCount(uint8_t timerNumber){ return Chip_TIMER_ReadCount(timer_sd[timerNumber].name); }