Marlin-RC_Deltaprintr/Marlin/stepper.cpp
// Timer interrupt for E. e_steps is set in the main routine;
// Timer 0 is shared with millies
Timer interrupt for E. e_steps is set in the main routine;
Timer 0 is shared with millies
Timer interrupt for E . e_steps is set in the main routine ; Timer 0 is shared with millies
ISR(TIMER0_COMPA_vect) {
    old_OCR0A += 52; 
    OCR0A = old_OCR0A;
    #define STEP_E_ONCE(INDEX) \
      if (e_steps[INDEX] != 0) { \
        E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \
        if (e_steps[INDEX] < 0) { \
          E## INDEX ##_DIR_WRITE(INVERT_E## INDEX ##_DIR); \
          e_steps[INDEX]++; \
        } \
        else if (e_steps[INDEX] > 0) { \
          E## INDEX ##_DIR_WRITE(!INVERT_E## INDEX ##_DIR); \
          e_steps[INDEX]--; \
        } \
        E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \
      }
    for (unsigned char i = 0; i < 4; i++) {
      STEP_E_ONCE(0);
      #if EXTRUDERS > 1
        STEP_E_ONCE(1);
        #if EXTRUDERS > 2
          STEP_E_ONCE(2);
          #if EXTRUDERS > 3
            STEP_E_ONCE(3);
          #endif
        #endif
      #endif
    }
  }
ISR ( TIMER0_COMPA_vect ) { old_OCR0A += 52 ; OCR0A = old_OCR0A ; #define STEP_E_ONCE ( INDEX )  \
      if (e_steps[INDEX] != 0) { \
        E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \
        if (e_steps[INDEX] < 0) { \
          E## INDEX ##_DIR_WRITE(INVERT_E## INDEX ##_DIR); \
          e_steps[INDEX]++; \
        } \
        else if (e_steps[INDEX] > 0) { \
          E## INDEX ##_DIR_WRITE(!INVERT_E## INDEX ##_DIR); \
          e_steps[INDEX]--; \
        } \
        E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \
      } for ( unsigned char i = 0 ; i < 4 ; i ++ ) { STEP_E_ONCE ( 0 ) ; #if EXTRUDERS > 1 STEP_E_ONCE ( 1 ) ; #if EXTRUDERS > 2 STEP_E_ONCE ( 2 ) ; #if EXTRUDERS > 3 STEP_E_ONCE ( 3 ) ; #endif #endif #endif } }
Timer interrupt for E. e_steps is set in the main routine;
Timer 0 is shared with millies
Timer interrupt for E . e_steps is set in the main routine ; Timer 0 is shared with millies
// ~10kHz interrupt (250000 / 26 = 9615kHz) // Step all E steppers that have steps, up to 4 steps per interrupt