void MenuState::btnDownAction(boolean isDimmed){ if(getDisplayDimStatus() == true){ _screen->dim(false); setDisplayDimStatus(false); } else { if(hilight_menu_id>=2) top_menu_id++; else hilight_menu_id++; _screen->clearDisplay(); render(); } }
void MenuState::btnUpAction(boolean isDimmed){ if(getDisplayDimStatus() == true){ _screen->dim(false); setDisplayDimStatus(false); } else { if(hilight_menu_id<=0) top_menu_id--; else hilight_menu_id--; if(top_menu_id<=0) top_menu_id = 0; if(hilight_menu_id<=0) hilight_menu_id = 0; _screen->clearDisplay(); render(); } }
void MenuState::btnInterruptAction(boolean isDimmed){ Serial.println("Btn intterupt requested"); if(getDisplayDimStatus() == true){ _screen->dim(false); setDisplayDimStatus(false); } else { Serial.println("Not dimmed, so change states"); int currentMenuID = getSelectedMenuID(); if(getSelectedMenuAction(currentMenuID) == 1) { char *stateID = "TIMESTATE"; makeChangeRequest(stateID); } } }
void TimeState::btnInterruptAction(boolean isDimmed){ if(getDisplayDimStatus() == true){ _screen->dim(false); setDisplayDimStatus(false); } else { isWaitingForResponse = true; uint8_t length = (byte) 6; uint8_t data_packet[6] = {length,100,99,98,97,254}; cashedDataPacket[0] = length; cashedDataPacket[1] = 100; cashedDataPacket[2] = 99; cashedDataPacket[3] = 98; cashedDataPacket[4] = 97; cashedDataPacket[5] = 254; cachedAction = TIME_STATE_APP_ACTION_1; getBluetoothManager().transmitMessage(TIME_STATE_APP_ID, TIME_STATE_APP_ACTION_1, data_packet); } }