volatile char runHandler(char key, char first)
{
	static char pressed;

	if(first)
	{
		pressed = key;
		key = 0;
	}

	if(pressed == FR_KEY)
	{
		menu.message(TEXT("Timer Started"));
		timer.begin();
		menu.spawn((void*)timerStatus);
		return FN_JUMP;
	}

	menu.push();
	menu.select(0);
	menu.init((menu_item*)menu_options);
	lcd.update();

	return FN_CANCEL;
}
volatile char timerStatus(char key, char first)
{
	static uint8_t counter;
	if(first)
	{
		counter = 0;
	}

	if(counter++ > 3)
	{
		counter = 0;
		lcd.cls();

		displayTimerStatus(0);

		menu.setTitle(TEXT("Running"));
		menu.setBar(TEXT(""), TEXT("STOP"));
		lcd.update();
	}

	if(!timer.running) return FN_CANCEL;

	if(key == FR_KEY)
	{
		menu.push();
		menu.spawn((void*)timerStop);
		return FN_JUMP;
	}

	return FN_CONTINUE;
}
Exemplo n.º 3
0
void chargingScreen(void)
{
  char first = 1;
  menu.push();
  while(button.get() != FL_KEY && battery_status() > 0)
  {
    wdt_reset();
    batteryStatus(0, first);
    first = 0;
  }
  menu.back();
}