void selectNode(t_copy *copy, t_node **selectedNode, uint16_t *numBlock) { bool lessWorkLoad(t_node *lessBusy, t_node *busy) { if (lessBusy && busy) return workLoad(lessBusy->maps, lessBusy->reduces) < workLoad(busy->maps, busy->reduces); return 0; } t_node *actualNode = findNode(nodes, copy->nodeName); if ((*selectedNode == NULL || lessWorkLoad(actualNode, *selectedNode)) && isActive(actualNode)) { *selectedNode = actualNode; *numBlock = copy->numBlock; } }
void mDisplayBrightness (void) { while(desired_Brightness % BRIGHTNESS_STEP) { desired_Brightness++; } while(!(loggedKeyInput & KEY_OK)) { if( loggedKeyInput & KEY_UP ) { loggedKeyInput &= ~KEY_UP; if(desired_Brightness < (1023-BRIGHTNESS_STEP)) { desired_Brightness += BRIGHTNESS_STEP; } } if( loggedKeyInput & KEY_DOWN ) { loggedKeyInput &= ~KEY_DOWN; if(desired_Brightness > BRIGHTNESS_STEP) { desired_Brightness -= BRIGHTNESS_STEP; } } /**********************************************************************/ workLoad(); /**********************************************************************/ } loggedKeyInput &= ~KEY_OK; }
void mFirmware (void) { bool stay = true; /*Displayinhalt herstellen*/ charChainDOGS(0,0,0,"Firmware"); charChainDOGS(2,0,0,"Sie nutzen folgende Firm-"); charChainDOGS(3,0,0,"wareversion:"); charChainDOGS(5,15,0,FIRMWARE); /* Solange in diesem Menü verweilen, bis "Exit" gedrückt wurde */ while(stay) { /*Es wurde auf OK gedrückt*/ if(loggedKeyInput & KEY_OK) { /*Gemerkten Tastendruck löschen*/ loggedKeyInput = NO_KEY; clrContent(); stay = false; } /**********************************************************************/ workLoad(); /**********************************************************************/ } }
void mSettings (uint8_t menuSize, struct sMenuEntry menu[]) { uint8_t select = 0; bool stay = true; drawMenu(menuSize, menu, "Einstellungen"); mSlected(select+2); /*Homescreen Aktualisierung unterdrücken*/ iHomescreenActiv = false; while(stay) { if(loggedKeyInput & KEY_OK) { loggedKeyInput &= ~KEY_OK; if(menu[select].function != NULL) { loggedKeyInput = NO_KEY; clrContent(); menu[select].function(); drawMenu(menuSize, menu, "Einstellungen"); mSlected(select+2); } else { clrContent(); stay = false; } } if( (loggedKeyInput & (KEY_UP)) || (loggedKeyInput & (KEY_DOWN)) ) { moveCursor(&select, menuSize); } /**********************************************************************/ workLoad(); /**********************************************************************/ } }
void mDisplayContrast (void) { while(!(loggedKeyInput & KEY_OK)) { if( loggedKeyInput & KEY_UP ) { loggedKeyInput &= ~KEY_UP; setContrastDOGS(INCREASE); } if( loggedKeyInput & KEY_DOWN ) { loggedKeyInput &= ~KEY_DOWN; setContrastDOGS(DECREASE); } /**********************************************************************/ workLoad(); /**********************************************************************/ } loggedKeyInput &= ~KEY_OK; }
void mDisplay (void) { uint8_t select = 0; uint8_t size = 3; bool stay = true; /* Wenn die automatische Helligkeits-Regulierung deaktiviert ist, * gibt es einen Menüpunkt (Helligkeit) mehr zur Auswahl */ if(!autoLight) { size = 4; } /*Displayinhalt herstellen*/ mDisplayContent(M_DISP_DEFAULT); charChainDOGS(0, 0, 0,"Display"); mSlected(2); /* Solange in diesem Menü verweilen, bis "Exit" gedrückt wurde */ while(stay) { /*Es wurde auf OK gedrückt*/ if(loggedKeyInput & KEY_OK) { /*Gemerkten Tastendruck löschen*/ loggedKeyInput &= ~KEY_OK; /*Bei welchem Menüpunkt wurde gedrückt?*/ switch(select) { /*Kontrast steuern*/ case 0: mDisplayContent(M_DISP_CONTRAST); mDisplayContrast(); mDisplayContent(M_DISP_DEFAULT); mSlected(2); break; /*Automatische Helligkeits-Regulierung ein/aus*/ case 1: if(autoLight) { autoLight = false; } else { autoLight = true; } size = mDisplayContent(M_DISP_DEFAULT); mSlected(3); break; /*Exit oder Regulieren der Display-Helligkeit*/ case 2: if(size == 3) { clrContent(); stay = false; } else { mDisplayContent(M_DISP_BRIGHTNESS); mDisplayBrightness(); mDisplayContent(M_DISP_DEFAULT); mSlected(4); } break; /*Exit*/ case 3: clrContent(); stay = false; } } if( (loggedKeyInput & (KEY_UP)) || (loggedKeyInput & (KEY_DOWN)) ) { moveCursor(&select, size); } /**********************************************************************/ workLoad(); /**********************************************************************/ } }