2012-11-01 16:37:27 +01:00
|
|
|
/*
|
|
|
|
report.h - reporting and messaging methods
|
|
|
|
Part of Grbl
|
|
|
|
|
|
|
|
Copyright (c) 2012 Sungeun K. Jeon
|
|
|
|
|
|
|
|
Grbl is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Grbl is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef report_h
|
|
|
|
#define report_h
|
|
|
|
|
|
|
|
|
|
|
|
// Define Grbl status codes.
|
|
|
|
#define STATUS_OK 0
|
|
|
|
#define STATUS_BAD_NUMBER_FORMAT 1
|
|
|
|
#define STATUS_EXPECTED_COMMAND_LETTER 2
|
|
|
|
#define STATUS_UNSUPPORTED_STATEMENT 3
|
2012-11-10 20:49:33 +01:00
|
|
|
#define STATUS_ARC_RADIUS_ERROR 4
|
2012-11-01 16:37:27 +01:00
|
|
|
#define STATUS_MODAL_GROUP_VIOLATION 5
|
|
|
|
#define STATUS_INVALID_STATEMENT 6
|
2012-11-15 01:36:29 +01:00
|
|
|
#define STATUS_SETTING_DISABLED 7
|
|
|
|
#define STATUS_SETTING_VALUE_NEG 8
|
|
|
|
#define STATUS_SETTING_STEP_PULSE_MIN 9
|
|
|
|
#define STATUS_SETTING_READ_FAIL 10
|
|
|
|
#define STATUS_IDLE_ERROR 11
|
|
|
|
#define STATUS_ALARM_LOCK 12
|
|
|
|
|
|
|
|
// Define Grbl alarm codes. Less than zero to distinguish alarm error from status error.
|
|
|
|
#define ALARM_HARD_LIMIT -1
|
|
|
|
#define ALARM_ABORT_CYCLE -2
|
2013-02-26 03:55:12 +01:00
|
|
|
#define ALARM_SOFT_LIMIT -3
|
2012-11-15 01:36:29 +01:00
|
|
|
|
|
|
|
// Define Grbl feedback message codes.
|
|
|
|
#define MESSAGE_CRITICAL_EVENT 1
|
|
|
|
#define MESSAGE_ALARM_LOCK 2
|
|
|
|
#define MESSAGE_ALARM_UNLOCK 3
|
|
|
|
#define MESSAGE_ENABLED 4
|
|
|
|
#define MESSAGE_DISABLED 5
|
2012-11-01 16:37:27 +01:00
|
|
|
|
|
|
|
// Prints system status messages.
|
|
|
|
void report_status_message(uint8_t status_code);
|
|
|
|
|
2012-11-15 01:36:29 +01:00
|
|
|
// Prints system alarm messages.
|
|
|
|
void report_alarm_message(int8_t alarm_code);
|
|
|
|
|
2012-11-01 16:37:27 +01:00
|
|
|
// Prints miscellaneous feedback messages.
|
2012-11-15 01:36:29 +01:00
|
|
|
void report_feedback_message(uint8_t message_code);
|
2012-11-01 16:37:27 +01:00
|
|
|
|
|
|
|
// Prints welcome message
|
|
|
|
void report_init_message();
|
|
|
|
|
|
|
|
// Prints Grbl help and current global settings
|
|
|
|
void report_grbl_help();
|
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(All v0.8 features installed. Still likely buggy, but now thourough
testing will need to start to squash them all. As soon as we're done,
this will be pushed to master and v0.9 development will be started.
Please report ANY issues to us so we can get this rolled out ASAP.)
- User startup script! A user can now save one (up to 5 as compile-time
option) block of g-code in EEPROM memory. This will be run everytime
Grbl resets. Mainly to be used as a way to set your preferences, like
G21, G54, etc.
- New dry run and check g-code switches. Dry run moves ALL motions at
rapids rate ignoring spindle, coolant, and dwell commands. For rapid
physical proofing of your code. The check g-code switch ignores all
motion and provides the user a way to check if there are any errors in
their program that Grbl may not like.
- Program restart! (sort of). Program restart is typically an advanced
feature that allows users to restart a program mid-stream. The check
g-code switch can perform this feature by enabling the switch at the
start of the program, and disabling it at the desired point with some
minimal changes.
- New system state variable. This state variable tracks all of the
different state processes that Grbl performs, i.e. cycle start, feed
hold, homing, etc. This is mainly for making managing of these task
easier and more clear.
- Position lost state variable. Only when homing is enabled, Grbl will
refuse to move until homing is completed and position is known. This is
mainly for safety. Otherwise, it will let users fend for themselves.
- Moved the default settings defines into config.h. The plan is to
eventually create a set of config.h's for particular as-built machines
to help users from doing it themselves.
- Moved around misc defines into .h files. And lots of other little
things.
2012-11-03 18:32:23 +01:00
|
|
|
// Prints Grbl global settings
|
2012-11-02 02:48:55 +01:00
|
|
|
void report_grbl_settings();
|
|
|
|
|
2012-11-01 16:37:27 +01:00
|
|
|
// Prints realtime status report
|
|
|
|
void report_realtime_status();
|
|
|
|
|
2012-11-02 02:48:55 +01:00
|
|
|
// Prints Grbl persistent coordinate parameters
|
|
|
|
void report_gcode_parameters();
|
|
|
|
|
2012-11-16 05:53:11 +01:00
|
|
|
// Prints current g-code parser mode state
|
2012-11-02 02:48:55 +01:00
|
|
|
void report_gcode_modes();
|
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(All v0.8 features installed. Still likely buggy, but now thourough
testing will need to start to squash them all. As soon as we're done,
this will be pushed to master and v0.9 development will be started.
Please report ANY issues to us so we can get this rolled out ASAP.)
- User startup script! A user can now save one (up to 5 as compile-time
option) block of g-code in EEPROM memory. This will be run everytime
Grbl resets. Mainly to be used as a way to set your preferences, like
G21, G54, etc.
- New dry run and check g-code switches. Dry run moves ALL motions at
rapids rate ignoring spindle, coolant, and dwell commands. For rapid
physical proofing of your code. The check g-code switch ignores all
motion and provides the user a way to check if there are any errors in
their program that Grbl may not like.
- Program restart! (sort of). Program restart is typically an advanced
feature that allows users to restart a program mid-stream. The check
g-code switch can perform this feature by enabling the switch at the
start of the program, and disabling it at the desired point with some
minimal changes.
- New system state variable. This state variable tracks all of the
different state processes that Grbl performs, i.e. cycle start, feed
hold, homing, etc. This is mainly for making managing of these task
easier and more clear.
- Position lost state variable. Only when homing is enabled, Grbl will
refuse to move until homing is completed and position is known. This is
mainly for safety. Otherwise, it will let users fend for themselves.
- Moved the default settings defines into config.h. The plan is to
eventually create a set of config.h's for particular as-built machines
to help users from doing it themselves.
- Moved around misc defines into .h files. And lots of other little
things.
2012-11-03 18:32:23 +01:00
|
|
|
// Prints startup line
|
|
|
|
void report_startup_line(uint8_t n, char *line);
|
|
|
|
|
2012-11-01 16:37:27 +01:00
|
|
|
#endif
|