bool relative_mode = false; //Determines Absolute or Relative Coordinates
bool relative_mode_e = false; //Determines Absolute or Relative E Codes while in Absolute Coordinates mode. E is always relative in Relative Coordinates mode.
static bool relative_mode = false; //Determines Absolute or Relative Coordinates
static bool relative_mode_e = false; //Determines Absolute or Relative E Codes while in Absolute Coordinates mode. E is always relative in Relative Coordinates mode.
static uint8_t fanpwm=0;
// comm variables
// comm variables
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE];
char cmdbuffer[BUFSIZE][MAX_CMD_SIZE];
static bool fromsd[BUFSIZE];
bool fromsd[BUFSIZE];
static int bufindr = 0;
int bufindr = 0;
static int bufindw = 0;
int bufindw = 0;
static int buflen = 0;
int buflen = 0;
static int i = 0;
int i = 0;
static char serial_char;
char serial_char;
static int serial_count = 0;
int serial_count = 0;
static boolean comment_mode = false;
boolean comment_mode = false;
static char *strchr_pointer; // just a pointer to find chars in the cmd string like X, Y, Z, E, etc
char *strchr_pointer; // just a pointer to find chars in the cmd string like X, Y, Z, E, etc
extern float HeaterPower;
const int sensitive_pins[] = SENSITIVE_PINS; // Sensitive pin list for M42
const int sensitive_pins[] = SENSITIVE_PINS; // Sensitive pin list for M42
float tt = 0, bt = 0;
static float tt = 0, bt = 0;
//Inactivity shutdown variables
//Inactivity shutdown variables
unsigned long previous_millis_cmd = 0;
static unsigned long previous_millis_cmd = 0;
unsigned long max_inactive_time = 0;
static unsigned long max_inactive_time = 0;
unsigned long stepper_inactive_time = 0;
static unsigned long stepper_inactive_time = 0;
unsigned long starttime=0;
unsigned long stoptime=0;
#ifdef SDSUPPORT
Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;
uint32_t filesize = 0;
uint32_t sdpos = 0;
bool sdmode = false;
bool sdactive = false;
bool savetosd = false;
int16_t n;
unsigned long autostart_atmillis=0;
bool autostart_stilltocheck=true; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
static unsigned long starttime=0;
static unsigned long stoptime=0;
#ifdef SDSUPPORT
static Sd2Card card;
static SdVolume volume;
static SdFile root;
static SdFile file;
static uint32_t filesize = 0;
static uint32_t sdpos = 0;
static bool sdmode = false;
static bool sdactive = false;
static bool savetosd = false;
static int16_t n;
static unsigned long autostart_atmillis=0;
static bool autostart_stilltocheck=true; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
//this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset
}
#ifdef SDSUPPORT
//power to SD reader
#if SDPOWER > -1
SET_OUTPUT(SDPOWER);
WRITE(SDPOWER,HIGH);
#endif //SDPOWER
quickinitsd();
#endif //SDSUPPORT
plan_init(); // Initialize planner;
st_init(); // Initialize stepper;
tp_init(); // Initialize temperature loop
}
#ifdef SDSUPPORT
void checkautostart(bool force)
{
//this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset