Example #1
0
/*
 * 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;
}
Example #2
0
/* Start a stopwatch */
uint32_t StopWatch_Start(void)
{
	/* Return the current timer count. */
	return Chip_TIMER_ReadCount(LPC_TIMER32_1);
}
Example #3
0
uint32_t Board_TIMER_GetTimerCounter(uint8_t timerNum)
{
	return Chip_TIMER_ReadCount(getTimerFomIndex(timerNum));
}
Example #4
0
uint32 usecs() {
  return Chip_TIMER_ReadCount(SYS_CLOCK_TIMER32);
}
Example #5
0
uint32_t Timer_ReadCount(uint8_t timerNumber){
	return Chip_TIMER_ReadCount(timer_sd[timerNumber].name);

}