Sergey Pastor / grbl1
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers protocol.h Source File

protocol.h

00001 /*
00002   protocol.h - controls Grbl execution protocol and procedures
00003   Part of Grbl
00004 
00005   Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
00006   Copyright (c) 2009-2011 Simen Svale Skogsrud
00007 
00008   Grbl is free software: you can redistribute it and/or modify
00009   it under the terms of the GNU General Public License as published by
00010   the Free Software Foundation, either version 3 of the License, or
00011   (at your option) any later version.
00012 
00013   Grbl is distributed in the hope that it will be useful,
00014   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016   GNU General Public License for more details.
00017 
00018   You should have received a copy of the GNU General Public License
00019   along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
00020 */
00021 
00022 #ifndef protocol_h
00023 #define protocol_h
00024 
00025 // Line buffer size from the serial input stream to be executed.
00026 // NOTE: Not a problem except for extreme cases, but the line buffer size can be too small
00027 // and g-code blocks can get truncated. Officially, the g-code standards support up to 256
00028 // characters. In future versions, this will be increased, when we know how much extra
00029 // memory space we can invest into here or we re-write the g-code parser not to have this
00030 // buffer.
00031 #ifndef LINE_BUFFER_SIZE
00032   #define LINE_BUFFER_SIZE 80
00033 #endif
00034 
00035 // Starts Grbl main loop. It handles all incoming characters from the serial port and executes
00036 // them as they complete. It is also responsible for finishing the initialization procedures.
00037 void protocol_main_loop();
00038 
00039 // Checks and executes a realtime command at various stop points in main program
00040 void protocol_execute_realtime();
00041 void protocol_exec_rt_system();
00042 
00043 // Executes the auto cycle feature, if enabled.
00044 void protocol_auto_cycle_start();
00045 
00046 // Block until all buffered steps are executed
00047 void protocol_buffer_synchronize();
00048 
00049 #endif