Move dwell to gcode

This commit is contained in:
Scott Lahteine
2017-09-15 20:44:40 -05:00
parent 4f1eadf41f
commit 51f195e698
7 changed files with 25 additions and 20 deletions

View File

@ -31,12 +31,13 @@ GcodeSuite gcode;
#include "parser.h"
#include "queue.h"
#include "../module/motion.h"
#include "../module/printcounter.h"
#if ENABLED(PRINTCOUNTER)
#include "../module/printcounter.h"
#endif
#include "../Marlin.h" // for idle()
uint8_t GcodeSuite::target_extruder;
millis_t GcodeSuite::previous_cmd_ms;
@ -99,6 +100,15 @@ void GcodeSuite::get_destination_from_command() {
#endif
}
/**
* Dwell waits immediately. It does not synchronize. Use M400 instead of G4
*/
void GcodeSuite::dwell(millis_t time) {
refresh_cmd_timeout();
time += previous_cmd_ms;
while (PENDING(millis(), time)) idle();
}
//
// Placeholders for non-migrated codes
//