Ejemplo n.º 1
0
void Timer0IntHandler(void) {

	// Clear the timer interrupt
	TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
	// Read the current state of the GPIO pin and
	// write back the opposite state
	bool longPressx = false;
	unsigned int keyPress = detectKeyPress1();
	if(keyPress == 0x01)
	{
		incAngle++;
	}
	else if(detectKeyPress2())
	{
		incAngle--;
	}
	else if (keyPress == 0x10)
	{
		longPressx = true;
	}

	if(incAngle < 1)
	{
		incAngle =1 ;
	}
	else if(incAngle > 10)
	{
		incAngle = 10;
	}
}
Ejemplo n.º 2
0
void Timer0IntHandler(void)
{

	// Clear the timer interrupt
	TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

	if (detectKeyPress1()) {
		if (led_col == 2) {
			led_col = 8;
		} else if (led_col == 8) {
			led_col = 4;
		} else {
			led_col = 2;
		}
		GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, led_col);

	}

	if (detectKeyPress2()) {
		sw2_status++;
	}
}