10 #define CMDBUFFER_CURRENT_TYPE_UNKNOWN 0
12 #define CMDBUFFER_CURRENT_TYPE_USB 1
14 #define CMDBUFFER_CURRENT_TYPE_SDCARD 2
16 #define CMDBUFFER_CURRENT_TYPE_UI 3
18 #define CMDBUFFER_CURRENT_TYPE_CHAINED 4
22 #define CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED 5
24 #define CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR 6
30 #define CMDBUFFER_RESERVE_FRONT (5*21)
32 extern char cmdbuffer[BUFSIZE * (MAX_CMD_SIZE + 1) + CMDBUFFER_RESERVE_FRONT];
33 extern size_t bufindr;
35 extern bool cmdbuffer_front_already_processed;
36 extern bool cmdqueue_serial_disabled;
39 #define CMDBUFFER_CURRENT_TYPE (cmdbuffer[bufindr])
41 #define CMDBUFFER_CURRENT_STRING (cmdbuffer+bufindr+CMDHDRSIZE)
47 extern uint32_t sdpos_atomic;
49 extern int serial_count;
50 extern bool comment_mode;
51 extern char *strchr_pointer;
53 extern long gcode_LastN;
55 extern bool cmdqueue_pop_front();
56 extern void cmdqueue_reset();
57 #ifdef CMDBUFFER_DEBUG
58 extern void cmdqueue_dump_to_serial_single_line(
int nr,
const char *p);
59 extern void cmdqueue_dump_to_serial();
61 extern bool cmd_buffer_empty();
65 void enquecommandf_P(
const char *fmt, ...);
66 extern void enquecommand(
const char *cmd,
bool from_progmem =
false);
67 extern void enquecommand_front(
const char *cmd,
bool from_progmem =
false);
68 extern void repeatcommand_front();
69 extern void get_command();
70 extern uint16_t cmdqueue_calc_sd_length();
73 #if defined(__cplusplus)
76 extern double strtod_noE(
const char* nptr,
char** endptr);
77 #if defined(__cplusplus)
82 static inline bool code_seen(
char code) {
return (strchr_pointer = strchr(CMDBUFFER_CURRENT_STRING, code)) != NULL; }
83 static inline bool code_seen_P(
const char *code_PROGMEM) {
return (strchr_pointer = strstr_P(CMDBUFFER_CURRENT_STRING, code_PROGMEM)) != NULL; }
84 static inline float code_value() {
return strtod_noE(strchr_pointer+1, NULL);}
85 static inline long code_value_long() {
return strtol(strchr_pointer+1, NULL, 10); }
86 static inline int16_t code_value_short() {
return int16_t(strtol(strchr_pointer+1, NULL, 10)); };
87 static inline uint8_t code_value_uint8() {
return uint8_t(strtol(strchr_pointer+1, NULL, 10)); };