Conditional translation for SYSTEM_TIMER_2 because we want to have posibility to switch between old/new implementation.

Timing functions (millis, micros and delay) replaced in whole source, defined in Marlin.h.
This commit enables original implementation (SYSTEM_TIMER_2 undefined)
Verified with passed complete wizard process.
This commit is contained in:
Robert Pelnar 2019-01-27 22:48:51 +01:00
parent 9a1e914637
commit eea755496b
19 changed files with 320 additions and 264 deletions
Firmware

View file

@ -22,8 +22,8 @@ int serial_count = 0; //index of character read from serial line
boolean comment_mode = false;
char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc
unsigned long TimeSent = millis();
unsigned long TimeNow = millis();
unsigned long TimeSent = _millis();
unsigned long TimeNow = _millis();
long gcode_N = 0;
long gcode_LastN = 0;
@ -391,8 +391,8 @@ void get_command()
MYSERIAL.write(serial_char); // for debuging serial line 2 in farm_mode
selectedSerialPort = 1;
} */ //RP - removed
TimeSent = millis();
TimeNow = millis();
TimeSent = _millis();
TimeNow = _millis();
if (serial_char < 0)
// Ignore extended ASCII characters. These characters have no meaning in the G-code apart from the file names
@ -527,7 +527,7 @@ void get_command()
} // end of serial line processing loop
if(farm_mode){
TimeNow = millis();
TimeNow = _millis();
if ( ((TimeNow - TimeSent) > 800) && (serial_count > 0) ) {
cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0;
@ -576,7 +576,7 @@ void get_command()
{
if(card.eof()){
SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED c=0 r=0
stoptime=millis();
stoptime=_millis();
char time[30];
unsigned long t=(stoptime-starttime-pause_time)/1000;
pause_time = 0;