blob: 7bc6e92b37d77bdee44d3057380a8454de539235 [file] [log] [blame]
Luigi Santivetti69972f92019-11-12 22:55:40 +00001/*
2 protocol.h - controls Grbl execution protocol and procedures
3 Part of Grbl
4
5 Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
6 Copyright (c) 2009-2011 Simen Svale Skogsrud
7
8 Grbl is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 Grbl is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Grbl. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifndef protocol_h
23#define protocol_h
24
25// Line buffer size from the serial input stream to be executed.
26// NOTE: Not a problem except for extreme cases, but the line buffer size can be too small
27// and g-code blocks can get truncated. Officially, the g-code standards support up to 256
28// characters. In future versions, this will be increased, when we know how much extra
29// memory space we can invest into here or we re-write the g-code parser not to have this
30// buffer.
31#ifndef LINE_BUFFER_SIZE
32 #define LINE_BUFFER_SIZE 80
33#endif
34
35// Starts Grbl main loop. It handles all incoming characters from the serial port and executes
36// them as they complete. It is also responsible for finishing the initialization procedures.
37void protocol_main_loop();
38
39// Checks and executes a realtime command at various stop points in main program
40void protocol_execute_realtime();
41void protocol_exec_rt_system();
42
43// Executes the auto cycle feature, if enabled.
44void protocol_auto_cycle_start();
45
46// Block until all buffered steps are executed
47void protocol_buffer_synchronize();
48
49#endif