Printer always ON on startup

I use Ramps1.4

Changing ENABLE_POWER_ON_STARTUP option doesn't matter

So, I made some changes in printer.cpp to always set to LOW PSON_PIN if ENABLE_POWER_ON_STARTUP == 0

=========================

#if defined(ENABLE_POWER_ON_STARTUP) && ENABLE_POWER_ON_STARTUP && (PS_ON_PIN>-1)

    SET_OUTPUT(PS_ON_PIN); //GND

    WRITE(PS_ON_PIN, (POWER_INVERTING ? HIGH : LOW));

    Printer::setPowerOn(true);

#else

#if defined(ENABLE_POWER_ON_STARTUP) && !ENABLE_POWER_ON_STARTUP && (PS_ON_PIN>-1)

    SET_OUTPUT(PS_ON_PIN); //GND

    WRITE(PS_ON_PIN, (POWER_INVERTING ? LOW : HIGH));

    Printer::setPowerOn(false);

#else

#if PS_ON_PIN > -1

    SET_OUTPUT(PS_ON_PIN); //GND

    Printer::setPowerOn(false);

#else

    Printer::setPowerOn(true);

#endif

#endif

#endif

=========================




Now it works fine!

Comments

  • Shouldn't inverting POWER_INVERTING do the same trick? At least with 1.0 which has this code:

    #if defined(ENABLE_POWER_ON_STARTUP) && ENABLE_POWER_ON_STARTUP && (PS_ON_PIN>-1)

        SET_OUTPUT(PS_ON_PIN); //GND

        WRITE(PS_ON_PIN, (POWER_INVERTING ? HIGH : LOW));

        Printer::setPowerOn(true);

    #else

    #if PS_ON_PIN > -1

        SET_OUTPUT(PS_ON_PIN); //GND

    WRITE(PS_ON_PIN,(POWER_INVERTING ? LOW : HIGH));

        Printer::setPowerOn(false);

    #else

        Printer::setPowerOn(true);

    #endif

    #endif

  • I think it will work fine

    -----

    #if PS_ON_PIN > -1

        SET_OUTPUT(PS_ON_PIN); //GND

    >>> WRITE(PS_ON_PIN,(POWER_INVERTING ? LOW : HIGH));

        Printer::setPowerOn(false);

    #else

    -----

    thanks, please add it to
    https://github.com/repetier/Repetier-Firmware/blob/master/src/ArduinoAVR/Repetier/Printer.cpp


    Maybe some combination of POWER_INVERTING and ENABLE_POWER_ON_STARTUP will do the same trick, but it is bad idea.
  • It's already in 1.0. We do not fix older versions.
Sign In or Register to comment.