Welcome! Log In Create A New Profile

Advanced

Ami Programmeur, c'est pour vous, Marlin

Posted by capn_yogg 
Ami Programmeur, c'est pour vous, Marlin
November 15, 2016 10:27AM
Bonjour,
Je suis en train de travailler sur le firmware et étant novice dans le code, je souhaiterais changer l'action à l'insertion de la carte.
Quand on insère la carte, il y a juste un message "carte insérée" sur l'écran, il faut aller dans le sous-menu pour pouvoir imprimé un fichier.
Je souhaiterais que quand on insère la carte sd et qu'elle est reconnue, on aille directement dans son répertoire pour imprimer.
J'ai essayé pas mal de modification dans le ultralcd.cpp et card reader.cpp mais rien à donnée.
Je ne sais pas si quelqu'un a déjà réussie cette modification, mais si vous avez des pistes, je suis preneuse.

j'ai un pressentiment que la modification serait dans cette partie de ulralcd.cpp mais je peux me tromper. Merci pour votre aide winking smiley

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;
    }
}

Edited 1 time(s). Last edit at 11/16/2016 04:57AM by capn_yogg.
Re: Ami Programmeur, c'est pour vous, Marlin
November 19, 2016 05:33PM
Salut,

Je ne peux pas t'aider pour la programmation, mais pour imprimer automatiquement depuis une carte SD sans écran, il faut nommer le premier fichier de la carte auto0.g, puis auto1.g, etc.
Je n'ai jamais testé avec l'écran par contre... Peut être que ça fonctionne aussi? winking smiley


Prusa i3 - e3d v5 - Gnu/Linux - Pronterface - Slic3r - Octoprint - Rpi - French
Re: Ami Programmeur, c'est pour vous, Marlin
November 21, 2016 04:26AM
Merci pour ta réponse, au final on a fini par trouver en créant un bool puis on a ajouté un peu à droite et a gauche les conditions winking smiley
Re: Ami Programmeur, c'est pour vous, Marlin
November 28, 2016 02:28AM
Salut,

çà serait pas mal de partager, non?
Sorry, only registered users may post in this forum.

Click here to login