Beispiel #1
0
void Printer::waitForZProbeStart() {
#if Z_PROBE_WAIT_BEFORE_TEST
    Endstops::update();
    Endstops::update(); // double test to get right signal. Needed for crosstalk protection.
    if(Endstops::zProbe()) return;
#if UI_DISPLAY_TYPE != NO_DISPLAY
    uid.setStatusP(Com::tHitZProbe);
    uid.refreshPage();
#endif
#ifdef DEBUG_PRINT
    debugWaitLoop = 3;
#endif
    while(!Endstops::zProbe()) {
        defaultLoopActions();
        Endstops::update();
        Endstops::update(); // double test to get right signal. Needed for crosstalk protection.
    }
#ifdef DEBUG_PRINT
    debugWaitLoop = 4;
#endif
    HAL::delayMilliseconds(30);
    while(Endstops::zProbe()) {
        defaultLoopActions();
        Endstops::update();
        Endstops::update(); // double test to get right signal. Needed for crosstalk protection.
    }
    HAL::delayMilliseconds(30);
    UI_CLEAR_STATUS;
#endif
}
Beispiel #2
0
/** \brief Execute commands in progmem stored string. Multiple commands are seperated by \n */
void gcode_execute_PString(PGM_P cmd) {
  char buf[80];
  byte buflen;
  char c;
  GCode code;
  do {
    // Wait for a free place in command buffer
    // Scan next command from string
    byte comment=0; 
    buflen = 0;   
    do {
      c = pgm_read_byte(cmd++);
      if(c == 0 || c == '\n') break;
      if(c == ';') comment = 1;
      if(comment) continue;
      buf[buflen++] = c;
    } while(buflen<79);
    if(buflen==0) { // empty line ignore
      continue;
    }
    buf[buflen]=0;
    // Send command into command buffer
    if(gcode_parse_ascii(&code,(char *)buf) && (code.params & 518)) { // Success
      process_command(&code,false);
      defaultLoopActions();
    }
  } while(c);
}