Beispiel #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;
	}
}
Beispiel #2
0
// the interrupt handler thats registered to be called on timer interrupts
void Timer0IntHandler(void) {
// Clear the timer interrupt
	TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
	unsigned char flag = detectKeyPress();
	unsigned char flag2 = detectKeyPress2();
	if (flag) {
		if (ui8LED == 8) {
			ui8LED = 2;
		} else {
			ui8LED = ui8LED * 2;
		}
        // light the next color in bulb
		GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, ui8LED);
	}
	if(flag2) {
		val++;
	}
}
Beispiel #3
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++;
	}
}