Ami Programmeur, c'est pour vous, Marlin November 15, 2016 10:27AM |
Registered: 7 years ago Posts: 3 |
void lcd_update() { static unsigned long timeoutToStatus = 0; #ifdef LCD_HAS_SLOW_BUTTONS slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context #endif lcd_buttons_update(); #if (SDCARDDETECT > 0) if((IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected())) { lcdDrawUpdate = 2; lcd_oldcardstatus = IS_SD_INSERTED; lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) currentMenu == lcd_status_screen #endif ); if(lcd_oldcardstatus) { card.initsd(); LCD_MESSAGEPGM(MSG_SD_INSERTED); } else { card.release(); LCD_MESSAGEPGM(MSG_SD_REMOVED); } } #endif//CARDINSERTED if (lcd_next_update_millis < millis()) { #ifdef ULTIPANEL #ifdef REPRAPWORLD_KEYPAD if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) { reprapworld_keypad_move_z_up(); } if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) { reprapworld_keypad_move_z_down(); } if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) { reprapworld_keypad_move_x_left(); } if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) { reprapworld_keypad_move_x_right(); } if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) { reprapworld_keypad_move_y_down(); } if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) { reprapworld_keypad_move_y_up(); } if (REPRAPWORLD_KEYPAD_MOVE_HOME) { reprapworld_keypad_move_home(); } #endif if (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP) { lcdDrawUpdate = 1; encoderPosition += encoderDiff / ENCODER_PULSES_PER_STEP; encoderDiff = 0; timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; } if (LCD_CLICKED) timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; #endif//ULTIPANEL #ifdef DOGLCD // Changes due to different driver architecture of the DOGM display blink++; // Variable for fan animation and alive dot u8g.firstPage(); do { u8g.setFont(u8g_font_6x10_marlin); u8g.setPrintPos(125,0); if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot u8g.drawPixel(127,63); // draw alive dot u8g.setColorIndex(1); // black on white (*currentMenu)(); if (!lcdDrawUpdate) break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next() } while( u8g.nextPage() ); #else (*currentMenu)(); #endif #ifdef LCD_HAS_STATUS_INDICATORS lcd_implementation_update_indicators(); #endif #ifdef ULTIPANEL if(timeoutToStatus < millis() && currentMenu != lcd_status_screen) { lcd_return_to_status(); lcdDrawUpdate = 2; } #endif//ULTIPANEL if (lcdDrawUpdate == 2) lcd_implementation_clear(); if (lcdDrawUpdate) lcdDrawUpdate--; lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL; } }
Re: Ami Programmeur, c'est pour vous, Marlin November 19, 2016 05:33PM |
Registered: 9 years ago Posts: 257 |
Re: Ami Programmeur, c'est pour vous, Marlin November 21, 2016 04:26AM |
Registered: 7 years ago Posts: 3 |
Re: Ami Programmeur, c'est pour vous, Marlin November 28, 2016 02:28AM |
Registered: 7 years ago Posts: 24 |