File tree Expand file tree Collapse file tree 7 files changed +22
-4
lines changed
mag-deck/mag-deck-arduino
temp-deck/temp-deck-arduino Expand file tree Collapse file tree 7 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ node_modules
121121
122122releases
123123
124- CMakeFiles
124+ cmake-build-debug /
125125
126126cmake_install.cmake
127127
Original file line number Diff line number Diff line change @@ -114,13 +114,19 @@ void GcodeMagDeck::print_warning(String msg) {
114114 Serial.println (msg);
115115}
116116
117+ void GcodeMagDeck::print_generic_response (String msg) {
118+ String response = " generic response: " + msg;
119+ Serial.println (" generic response: %u" );
120+ }
121+
117122void GcodeMagDeck::setup (int baudrate) {
118123 COMMAND_CODES[GCODE_HOME] = " G28.2" ;
119124 COMMAND_CODES[GCODE_MOVE] = " G0" ;
120125 COMMAND_CODES[GCODE_PROBE] = " G38.2" ;
121126 COMMAND_CODES[GCODE_GET_PROBED_DISTANCE] = " M836" ;
122127 COMMAND_CODES[GCODE_GET_POSITION] = " M114.2" ;
123128 COMMAND_CODES[GCODE_DEVICE_INFO] = " M115" ;
129+ COMMAND_CODES[GCODE_RESET_REASON] = " M114" ;
124130 COMMAND_CODES[GCODE_DFU] = " dfu" ;
125131 Serial.begin (baudrate);
126132 Serial.setTimeout (3 );
Original file line number Diff line number Diff line change 1616#define GCODE_GET_PROBED_DISTANCE 3
1717#define GCODE_GET_POSITION 4
1818#define GCODE_DEVICE_INFO 5
19- #define GCODE_DFU 6
20- #define TOTAL_GCODE_COMMAND_CODES 7
19+ #define GCODE_RESET_REASON 6
20+ #define GCODE_DFU 7
21+ #define TOTAL_GCODE_COMMAND_CODES 8
2122
2223class GcodeMagDeck {
2324
@@ -35,6 +36,7 @@ class GcodeMagDeck{
3536 void print_probed_distance (float mm);
3637 bool read_number (char key);
3738 void print_warning (String msg);
39+ void print_generic_response (String msg);
3840
3941 private:
4042
Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ void loop() {
270270 activate_bootloader ();
271271 break ;
272272 default :
273+ gcode.print_generic_response (String (gcode.code ));
273274 break ;
274275 }
275276 }
Original file line number Diff line number Diff line change @@ -108,6 +108,11 @@ void Gcode::print_stablizing_temperature(float current_temp) {
108108 Serial.println (current_temp, SERIAL_DIGITS_IN_RESPONSE);
109109}
110110
111+ void Gcode::print_generic_response (String message) {
112+ String response = " generic response: " + message;
113+ Serial.println (response);
114+ }
115+
111116void Gcode::print_warning (String msg) {
112117 Serial.println (msg);
113118}
@@ -116,6 +121,7 @@ void Gcode::setup(int baudrate) {
116121 COMMAND_CODES[GCODE_GET_TEMP] = " M105" ;
117122 COMMAND_CODES[GCODE_SET_TEMP] = " M104" ;
118123 COMMAND_CODES[GCODE_DEVICE_INFO] = " M115" ;
124+ COMMAND_CODES[GCODE_RESET_REASON] = " M114" ;
119125 COMMAND_CODES[GCODE_DISENGAGE] = " M18" ;
120126 COMMAND_CODES[GCODE_DFU] = " dfu" ;
121127 Serial.begin (baudrate);
Original file line number Diff line number Diff line change 1515#define GCODE_DISENGAGE 2
1616#define GCODE_DEVICE_INFO 3
1717#define GCODE_DFU 4
18- #define TOTAL_GCODE_COMMAND_CODES 5
18+ #define GCODE_RESET_REASON 5
19+ #define TOTAL_GCODE_COMMAND_CODES 6
1920
2021class Gcode {
2122
@@ -33,6 +34,7 @@ class Gcode{
3334 void print_stablizing_temperature (float current_temp);
3435 bool read_number (char key);
3536 void print_warning (String msg);
37+ void print_generic_response (String msg);
3638
3739 private:
3840
Original file line number Diff line number Diff line change @@ -387,6 +387,7 @@ void read_gcode(){
387387 activate_bootloader ();
388388 break ;
389389 default :
390+ gcode.print_generic_response (String (gcode.code ));
390391 break ;
391392 }
392393 }
You can’t perform that action at this time.
0 commit comments