Skip to content

Commit 1774c50

Browse files
bdringatlasteStefan de BruijnMitchBradleybuildlog
authored
Devt (#650)
* Fixed various small bugs (#605) * Fixed various small bugs * Fixed potential cast bug * Fixed double reporting of errors Co-authored-by: Stefan de Bruijn <stefan@nubilosoft.com> * Stallguard tuning (#607) * Devt (#571) * Handles Tranimic drivers errors better - If an unsupported driver is specified, it will give a message and not crash. * Cleaned up unused files Got rid of old unipolar files Got rid of servo axis feature - it is a motor class now Got rid of solenoid pen feature - never really used and it should be a motor class if it is. * Fix ENABLE_AUTHENTICATION (#569) * Fixed authentication code. * Removed another const cast Co-authored-by: Stefan de Bruijn <stefan@nubilosoft.com> * Fix step leakage with inverted steps (#570) * Fix step leakage with inverted steps * Update build date for merge Co-authored-by: Bart Dring <bdring@buildlog.net> Co-authored-by: Stefan de Bruijn <atlaste@users.noreply.github.com> Co-authored-by: Stefan de Bruijn <stefan@nubilosoft.com> Co-authored-by: Mitch Bradley <wmb@firmworks.com> Co-authored-by: Bart Dring <bdring@buildlog.net> * Update platformio.ini Per PR 583 * Created an enum for mode * Removing some unused machine defs * Added test machine definition * Clean up for PR * Remove test machine def. Co-authored-by: Stefan de Bruijn <atlaste@users.noreply.github.com> Co-authored-by: Stefan de Bruijn <stefan@nubilosoft.com> Co-authored-by: Mitch Bradley <wmb@firmworks.com> Co-authored-by: Bart Dring <bdring@buildlog.net> * Basic testing Complete * Made state variable volatile. * Homing cycle settings (#613) * Initial Tests Complete * Update Grbl.h * Update variables Co-authored-by: Mitch Bradley <wmb@firmworks.com> * fixed dual switches when inverted (#614) * fixed dual switches when inverted * Removed debug message * Cleaning up the machine defs Removed unused #defines. * Store coordinate offsets in NVS (#611) * Store coordinate offsets in NVS * Handle both old Eeprom formats * Implementing fixes (#616) - Stop creating additional tasks when limit_init() gets called again from homing and resets - Explicitly delete an object that was causing a memory loss. * Update Grbl.h * Tweak memory fix and add $H check for $Homing/Cycles * Fix G28.1 and G30.1 * Update Grbl.h * Homing cycle defaults (#624) * Changed to add homing cycle defaults There needs to be a way to set the homing cycle defaults in a machine definition. There will likely be a better way to do this in the future. * Update 10vSpindle.cpp Had wrong error message * Fixed typos and removed obsolete #defines * Probe cleanup (#625) * Cleanup probing code * Update Grbl.h * Update after review * Update error_codes_en_US.csv * More sd_close() to free memory (#622) * Changed buffer sizes to 256 throughout various parts of the program. (#626) This is a patch necessary for F360 personal users, because they decided to add a very lengthy comment... Co-authored-by: Stefan de Bruijn <stefan@nubilosoft.com> * $sd/show and handle settings in SD files (#629) * $sd/show and handle settings in SD files * Added $LocalFs/Show and fixed $LocalFs/Run output * Infer / at beginning of SD path name The LocalFS path processing code already inserts a / at the beginning of the path is one isn't present. This patch does the same for SD files. * Show $ command responses in WebUI console * Added $Settings/ListChanged AKA $SC This is useful for saving settings in a compact form that leaves defaults unchanged. * $sd/show works in idle or alarm state * Apply idle/alarm checks to SPIFFS files too * Changed sd_close to SD.end() sd_close was a temporary function to check for memory usage * Big BUILD_INFO fix (#632) -- Changes that affect behavior Fixed the bugs with report_build_info() Build info is no longer stored in the fixed "EEPROM" section; instead it is a proper Setting named $Firmware/Build . You can change it in the usual way with $Firmware/Build=<whatever> $I without the = still works. -- Changes that affect configurability for developers Converted a couple more #defines into enums - SETTINGS_RESTORE_* and BITFLAG_RT_STATUS_* . A side effect of this is that it is no longer possible to configure the behavior of $RST=* by defining SETTINGS_RESTORE_ALL to include only a subset. I think it is a bad idea from a customer support perspective to have the meaning of this command be different for different builds. Changed some of the #define ENABLE_ names to eliminate "EEPROM" -- Changes that are purely cosmetic Clarified descriptions in Config.h, to eliminate spurious/incorrect mentions of "EEPROM" Eliminated all mentions of the name "EEPROM" except the ones that truly mean the EEPROM section, as opposed to generalized non-volatile storage. The contents of SettingsStorage.h and SettingsStorage.cpp, which were really related to coordinate storage in Eeprom, not proper settings, were moved to Eeprom.h and Eeprom.cpp. The SettingsStorage files are gone. Got rid of get_step_pin_mask() and get_direction_pin_mask() because they were just aliases for bit(). That eliminated some junk from the SettingsStorage/Eeprom files. Those files now tightly contain only the residual stuff related to the storage of coordinate data in EEPROM. * Most #defines are gone (#595) * Many more #defines bite the dust * Fixed botch in rt accessory logic * Update Probe.cpp * Update System.cpp * Typo * Fixed WebUI crash (#633) While eliminating a redundant definition of is_realtime_command(), I inadvertently introduced a recursion due to the similarity of the names "is_realtime_command()" and "is_realtime_cmd()". The solution is to eliminate the latter entirely. * Fix i2s probing hang (#608) * Fix I2S stepper hung just after the completion of motor moving * Fix recompile issue Fixed a problem with the recompile not being recompiled even if the files under the Custom folder are changed. * More comment for macOS in debug.ini * Fix the timing of calling I2S out's exclusion function and reset sequence The reset sequence did not seem to be correct, so I changed it. According to the ESP-IDF PR, the correct sequence is as follows: 1)TX module 2)DMA 3)FIFO espressif/esp-idf@c7f3352#diff-27688c6b3c29373d2a2b142b8471981c * Changed the message level for I2S swtiching from warning to debug * Add some comments * Implement stepping through Motors class (#636) * Implement stepping through Motors class WIP for discussion and review - not ready to merge yet * Document Motor methods and variables .. and remove some unused ones and move some that are subclass-specific * Move position_min/max to Limits.cpp ... and coalesced other uses thereof into a unified scheme. * Call motor ->init() explicitly instead of implicitly This makes it possible to inherit constructors without spurious config messages. * Fixed problems with I2S * Changes in class method override syntax per atlaste * Fixed oops * More Motors simplification a) Eliminated can_home() in favor of a return value from set_homing_mode() b) Eliminated axis_name() in favor of reportAxisNameMsg() * Fixes to RcServo and Trinamic - RC Servo was not handling disable ... probably old issue - Display test after config * More tweaks * Define that variable! * Move functions from Motors.cpp to subclasses Created a Servo base class from which RcServo and Dynamixel2 are derived. This gets the servo update task out of Motors. It also eliminates the need for type_id. Now all of the functions that are specific to particular kinds of motors are within their subclasses * Adding Dynamixel to ABC axes. * Removed second #ifndef SPINDLE_TYPE * Fixed potential leak in Report.cpp as reported by @atlaste * Some servo cleanup. Has errors! * min should be max * Removed test rcservo machine definition. * Removed obsolete #defines in machine defs for RcServo cal Co-authored-by: bdring <barton.dring@gmail.com> * Cleaned up AMASS code (#635) * Cleaned up AMASS code More #defines gone 74 lines shorter Tested by comparing the result of original AMASS computation code to the new code with values surrounding all of the cutoff frequencies. * I2SOut tick calculation * Sorted out units for stepper pulse periods I tried to make it clear what the units are at different places in the code, and to use argument datatypes that clearly show the value range at different points, instead of relying on implicit type promotion. Hopefully this will make it easier to understand when, where, and why unit conversions occur. * Update Stepper.h * Deleted AMASS Config.h option ... as it is no longer optional * Use less memory (#644) a) closeFile() now does SD.end() to release memory after running a file from SD. b) Several task stacks are smaller c) All tasks now check their free space if DEBUG_REPORT_STACK_FREE is defined. platformio.ini has a commented-out line that can be uncommented to turn that on. d) Similarly, platformio.ini can turn on DEBUG_REPORT_HEAP_SIZE e) Fixed a small leak that occurred when listing local files. With these changes, the heap size tends to hover around 53K, dropping to about 37K when running a file from SD. * Add coolant pin messages to startup (#647) * Add coolant pin messages to startup Help with user support. * Removing incorrect STEPPER_RESET definition * Fix laser mode startup message * cleanup - coolant_init() will behave as before - update build date - return default machine to test_drive Co-authored-by: Stefan de Bruijn <atlaste@users.noreply.github.com> Co-authored-by: Stefan de Bruijn <stefan@nubilosoft.com> Co-authored-by: Mitch Bradley <wmb@firmworks.com> Co-authored-by: Bart Dring <bdring@buildlog.net> Co-authored-by: odaki <odaki@mars.dti.ne.jp>
1 parent 78e988a commit 1774c50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2125
-2403
lines changed

Grbl_Esp32/Custom/atari_1020.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void atari_home_task(void* pvParameters) {
179179
void calc_solenoid(float penZ) {
180180
bool isPenUp;
181181
static bool previousPenState = false;
182-
uint32_t solenoid_pen_pulse_len; // duty cycle of solenoid
182+
uint32_t solenoid_pen_pulse_len; // duty cycle of solenoid
183183
isPenUp = ((penZ > 0) || (sys.state == State::Alarm)); // is pen above Z0 or is there an alarm
184184
// if the state has not change, we only count down to the pull time
185185
if (previousPenState == isPenUp) {
@@ -247,33 +247,25 @@ void atari_next_pen() {
247247
void user_defined_macro(uint8_t index) {
248248
char gcode_line[20];
249249
switch (index) {
250-
#ifdef MACRO_BUTTON_0_PIN
251-
case CONTROL_PIN_INDEX_MACRO_0:
250+
case 0:
252251
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Pen switch");
253252
WebUI::inputBuffer.push("$H\r");
254253
break;
255-
#endif
256-
#ifdef MACRO_BUTTON_1_PIN
257-
case CONTROL_PIN_INDEX_MACRO_1:
254+
case 1:
258255
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Color switch");
259256
atari_next_pen();
260257
sprintf(gcode_line, "G90G0X%3.2f\r", ATARI_PAPER_WIDTH); // alway return to right side to reduce home travel stalls
261258
WebUI::inputBuffer.push(gcode_line);
262259
break;
263-
#endif
264-
#ifdef MACRO_BUTTON_2_PIN
265-
case CONTROL_PIN_INDEX_MACRO_2:
266-
// feed out some paper and reset the Y 0
260+
case 2:
267261
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Paper switch");
268262
WebUI::inputBuffer.push("G0Y-25\r");
269263
WebUI::inputBuffer.push("G4P0.1\r"); // sync...forces wait for planner to clear
270264
sys_position[Y_AXIS] = 0.0; // reset the Y position
271265
gc_sync_position();
272266
plan_sync_position();
273267
break;
274-
#endif
275268
default:
276-
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Unknown Switch %d", index);
277269
break;
278270
}
279271
}

Grbl_Esp32/Custom/polar_coaster.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -223,25 +223,15 @@ float abs_angle(float ang) {
223223
// Polar coaster has macro buttons, this handles those button pushes.
224224
void user_defined_macro(uint8_t index) {
225225
switch (index) {
226-
#ifdef MACRO_BUTTON_0_PIN
227-
case CONTROL_PIN_INDEX_MACRO_0:
226+
case 0:
228227
WebUI::inputBuffer.push("$H\r"); // home machine
229228
break;
230-
#endif
231-
#ifdef MACRO_BUTTON_1_PIN
232-
case CONTROL_PIN_INDEX_MACRO_1:
229+
case 1:
233230
WebUI::inputBuffer.push("[ESP220]/1.nc\r"); // run SD card file 1.nc
234231
break;
235-
#endif
236-
#ifdef MACRO_BUTTON_2_PIN
237-
case CONTROL_PIN_INDEX_MACRO_2:
232+
case 2:
238233
WebUI::inputBuffer.push("[ESP220]/2.nc\r"); // run SD card file 2.nc
239234
break;
240-
#endif
241-
#ifdef MACRO_BUTTON_3_PIN
242-
case CONTROL_PIN_INDEX_MACRO_3:
243-
break;
244-
#endif
245235
default:
246236
break;
247237
}

Grbl_Esp32/src/Config.h

Lines changed: 75 additions & 103 deletions
Large diffs are not rendered by default.

Grbl_Esp32/src/CoolantControl.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,25 @@
2424
#include "Grbl.h"
2525

2626
void coolant_init() {
27+
static bool init_message = true; // used to show messages only once.
28+
2729
#ifdef COOLANT_FLOOD_PIN
2830
pinMode(COOLANT_FLOOD_PIN, OUTPUT);
2931
#endif
3032
#ifdef COOLANT_MIST_PIN
3133
pinMode(COOLANT_MIST_PIN, OUTPUT);
3234
#endif
35+
36+
if (init_message) {
37+
#ifdef COOLANT_FLOOD_PIN
38+
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Flood coolant on pin %s", pinName(COOLANT_FLOOD_PIN).c_str());
39+
#endif
40+
#ifdef COOLANT_MIST_PIN
41+
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Mist coolant on pin %s", pinName(COOLANT_MIST_PIN).c_str());
42+
#endif
43+
init_message = false;
44+
}
45+
3346
coolant_stop();
3447
}
3548

Grbl_Esp32/src/Eeprom.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Eeprom.cpp - Header for system level commands and real-time processes
2+
Eeprom.cpp - Coordinate data stored in EEPROM
33
Part of Grbl
44
Copyright (c) 2014-2016 Sungeun K. Jeon for Gnea Research LLC
55
@@ -57,3 +57,25 @@ int memcpy_from_eeprom_with_checksum(char* destination, unsigned int source, uns
5757
}
5858
return (checksum == EEPROM.read(source));
5959
}
60+
61+
// Read selected coordinate data from EEPROM. Updates pointed coord_data value.
62+
// This is now a compatibility routine that is used to propagate coordinate data
63+
// in the old EEPROM format to the new tagged NVS format.
64+
bool old_settings_read_coord_data(uint8_t coord_select, float* coord_data) {
65+
uint32_t addr = coord_select * (sizeof(float) * N_AXIS + 1) + EEPROM_ADDR_PARAMETERS;
66+
if (!(memcpy_from_eeprom_with_old_checksum((char*)coord_data, addr, sizeof(float) * N_AXIS)) &&
67+
!(memcpy_from_eeprom_with_checksum((char*)coord_data, addr, sizeof(float) * MAX_N_AXIS))) {
68+
// Reset with default zero vector
69+
clear_vector_float(coord_data);
70+
// The old code used to rewrite the zeroed data but now that is done
71+
// elsewhere, in a different format.
72+
return false;
73+
}
74+
return true;
75+
}
76+
77+
// Allow iteration over CoordIndex values
78+
CoordIndex& operator ++ (CoordIndex& i) {
79+
i = static_cast<CoordIndex>(static_cast<uint8_t>(i) + 1);
80+
return i;
81+
}

Grbl_Esp32/src/Eeprom.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,40 @@
2222

2323
#include "Grbl.h"
2424

25+
// Define EEPROM memory address location values for saved coordinate data.
26+
const int EEPROM_SIZE = 1024U;
27+
const int EEPROM_ADDR_PARAMETERS = 512U;
28+
2529
//unsigned char eeprom_get_char(unsigned int addr);
2630
//void eeprom_put_char(unsigned int addr, unsigned char new_value);
2731
void memcpy_to_eeprom_with_checksum(unsigned int destination, const char* source, unsigned int size);
2832
int memcpy_from_eeprom_with_checksum(char* destination, unsigned int source, unsigned int size);
2933
int memcpy_from_eeprom_with_old_checksum(char* destination, unsigned int source, unsigned int size);
34+
35+
// Reads selected coordinate data from EEPROM
36+
bool old_settings_read_coord_data(uint8_t coord_select, float* coord_data);
37+
38+
// Various places in the code access saved coordinate system data
39+
// by a small integer index according to the values below.
40+
enum CoordIndex : uint8_t{
41+
Begin = 0,
42+
G54 = Begin,
43+
G55,
44+
G56,
45+
G57,
46+
G58,
47+
G59,
48+
// To support 9 work coordinate systems it would be necessary to define
49+
// the following 3 and modify GCode.cpp to support G59.1, G59.2, G59.3
50+
// G59_1,
51+
// G59_2,
52+
// G59_3,
53+
NWCSystems,
54+
G28 = NWCSystems,
55+
G30,
56+
// G92_2,
57+
// G92_3,
58+
End,
59+
};
60+
// Allow iteration over CoordIndex values
61+
CoordIndex& operator ++ (CoordIndex& i);

Grbl_Esp32/src/GCode.cpp

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -873,10 +873,10 @@ Error gc_execute_line(char* line, uint8_t client) {
873873
}
874874
}
875875
// [15. Coordinate system selection ]: *N/A. Error, if cutter radius comp is active.
876-
// TODO: An EEPROM read of the coordinate data may require a buffer sync when the cycle
876+
// TODO: Reading the coordinate data may require a buffer sync when the cycle
877877
// is active. The read pauses the processor temporarily and may cause a rare crash. For
878878
// future versions on processors with enough memory, all coordinate data should be stored
879-
// in memory and written to EEPROM only when there is not a cycle active.
879+
// in memory and written to non-volatile storage only when there is not a cycle active.
880880
float block_coord_system[MAX_N_AXIS];
881881
memcpy(block_coord_system, gc_state.coord_system, sizeof(gc_state.coord_system));
882882
if (bit_istrue(command_words, bit(ModalGroup::MG12))) { // Check if called in block
@@ -1002,7 +1002,7 @@ Error gc_execute_line(char* line, uint8_t client) {
10021002
case NonModal::GoHome0: // G28
10031003
case NonModal::GoHome1: // G30
10041004
// [G28/30 Errors]: Cutter compensation is enabled.
1005-
// Retreive G28/30 go-home position data (in machine coordinates) from EEPROM
1005+
// Retreive G28/30 go-home position data (in machine coordinates) from non-volatile storage
10061006
if (gc_block.non_modal_command == NonModal::GoHome0) {
10071007
coords[CoordIndex::G28]->get(coord_data);
10081008
} else { // == NonModal::GoHome1
@@ -1502,9 +1502,6 @@ Error gc_execute_line(char* line, uint8_t client) {
15021502
if (gc_state.modal.motion != Motion::None) {
15031503
if (axis_command == AxisCommand::MotionMode) {
15041504
GCUpdatePos gc_update_pos = GCUpdatePos::Target;
1505-
#ifdef USE_I2S_STEPS
1506-
stepper_id_t save_stepper = current_stepper;
1507-
#endif
15081505
if (gc_state.modal.motion == Motion::Linear) {
15091506
//mc_line(gc_block.values.xyz, pl_data);
15101507
mc_line_kins(gc_block.values.xyz, pl_data, gc_state.position);
@@ -1527,12 +1524,6 @@ Error gc_execute_line(char* line, uint8_t client) {
15271524
// upon a successful probing cycle, the machine position and the returned value should be the same.
15281525
#ifndef ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES
15291526
pl_data->motion.noFeedOverride = 1;
1530-
#endif
1531-
#ifdef USE_I2S_STEPS
1532-
save_stepper = current_stepper; // remember the stepper
1533-
if (save_stepper == ST_I2S_STREAM) {
1534-
stepper_switch(ST_I2S_STATIC); // Change the stepper to reduce the delay for accurate probing.
1535-
}
15361527
#endif
15371528
gc_update_pos = mc_probe_cycle(gc_block.values.xyz, pl_data, gc_parser_flags);
15381529
}
@@ -1544,11 +1535,6 @@ Error gc_execute_line(char* line, uint8_t client) {
15441535
} else if (gc_update_pos == GCUpdatePos::System) {
15451536
gc_sync_position(); // gc_state.position[] = sys_position
15461537
} // == GCUpdatePos::None
1547-
#ifdef USE_I2S_STEPS
1548-
if (save_stepper == ST_I2S_STREAM && current_stepper != ST_I2S_STREAM) {
1549-
stepper_switch(ST_I2S_STREAM); // Put the stepper back on.
1550-
}
1551-
#endif
15521538
}
15531539
}
15541540
// [21. Program flow ]:
@@ -1565,8 +1551,8 @@ Error gc_execute_line(char* line, uint8_t client) {
15651551
case ProgramFlow::Paused:
15661552
protocol_buffer_synchronize(); // Sync and finish all remaining buffered motions before moving on.
15671553
if (sys.state != State::CheckMode) {
1568-
system_set_exec_state_flag(EXEC_FEED_HOLD); // Use feed hold for program pause.
1569-
protocol_execute_realtime(); // Execute suspend.
1554+
sys_rt_exec_state.bit.feedHold = true; // Use feed hold for program pause.
1555+
protocol_execute_realtime(); // Execute suspend.
15701556
}
15711557
break;
15721558
case ProgramFlow::CompletedM2:
@@ -1594,9 +1580,9 @@ Error gc_execute_line(char* line, uint8_t client) {
15941580
#endif
15951581
// gc_state.modal.override = OVERRIDE_DISABLE; // Not supported.
15961582
#ifdef RESTORE_OVERRIDES_AFTER_PROGRAM_END
1597-
sys.f_override = DEFAULT_FEED_OVERRIDE;
1598-
sys.r_override = DEFAULT_RAPID_OVERRIDE;
1599-
sys.spindle_speed_ovr = DEFAULT_SPINDLE_SPEED_OVERRIDE;
1583+
sys.f_override = FeedOverride::Default;
1584+
sys.r_override = RapidOverride::Default;
1585+
sys.spindle_speed_ovr = SpindleSpeedOverride::Default;
16001586
#endif
16011587
// Execute coordinate change and spindle/coolant stop.
16021588
if (sys.state != State::CheckMode) {

Grbl_Esp32/src/GCode.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,6 @@ struct CoolantState {
163163

164164
// Modal Group M8: Coolant control
165165
// Modal Group M9: Override control
166-
enum class Override : uint8_t {
167-
#ifdef DEACTIVATE_PARKING_UPON_INIT
168-
Disabled = 0, // (Default: Must be zero)
169-
ParkingMotion = 1, // M56
170-
#else
171-
ParkingMotion = 0, // M56 (Default: Must be zero)
172-
Disabled = 1, // Parking disabled.
173-
#endif
174-
};
175166

176167
// Modal Group M10: User I/O control
177168
enum class IoControl : uint8_t {
@@ -286,7 +277,7 @@ typedef struct {
286277
float position[MAX_N_AXIS]; // Where the interpreter considers the tool to be at this point in the code
287278

288279
float coord_system[MAX_N_AXIS]; // Current work coordinate system (G54+). Stores offset from absolute machine
289-
// position in mm. Loaded from EEPROM when called.
280+
// position in mm. Loaded from non-volatile storage when called.
290281
float coord_offset[MAX_N_AXIS]; // Retains the G92 coordinate offset (work coordinates) relative to
291282
// machine zero in mm. Non-persistent. Cleared upon reset and boot.
292283
float tool_length_offset; // Tracks tool length offset value when enabled.

Grbl_Esp32/src/Grbl.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void grbl_init() {
3737
#ifdef MACHINE_NAME
3838
report_machine_type(CLIENT_SERIAL);
3939
#endif
40-
settings_init(); // Load Grbl settings from EEPROM
40+
settings_init(); // Load Grbl settings from non-volatile storage
4141
stepper_init(); // Configure stepper pins and interrupt timers
4242
init_motors();
4343
system_ini(); // Configure pinout pins and pin-change interrupt (Renamed due to conflict with esp32 files)
@@ -80,16 +80,20 @@ static void reset_variables() {
8080
State prior_state = sys.state;
8181
memset(&sys, 0, sizeof(system_t)); // Clear system struct variable.
8282
sys.state = prior_state;
83-
sys.f_override = DEFAULT_FEED_OVERRIDE; // Set to 100%
84-
sys.r_override = DEFAULT_RAPID_OVERRIDE; // Set to 100%
85-
sys.spindle_speed_ovr = DEFAULT_SPINDLE_SPEED_OVERRIDE; // Set to 100%
83+
sys.f_override = FeedOverride::Default; // Set to 100%
84+
sys.r_override = RapidOverride::Default; // Set to 100%
85+
sys.spindle_speed_ovr = SpindleSpeedOverride::Default; // Set to 100%
8686
memset(sys_probe_position, 0, sizeof(sys_probe_position)); // Clear probe position.
87-
sys_probe_state = 0;
88-
sys_rt_exec_state = 0;
89-
cycle_stop = false;
90-
sys_rt_exec_motion_override = 0;
91-
sys_rt_exec_accessory_override = 0;
92-
system_clear_exec_alarm();
87+
88+
sys_probe_state = Probe::Off;
89+
sys_rt_exec_state.value = 0;
90+
sys_rt_exec_accessory_override.value = 0;
91+
sys_rt_exec_alarm = ExecAlarm::None;
92+
cycle_stop = false;
93+
sys_rt_f_override = FeedOverride::Default;
94+
sys_rt_r_override = RapidOverride::Default;
95+
sys_rt_s_override = SpindleSpeedOverride::Default;
96+
9397
// Reset Grbl primary systems.
9498
serial_reset_read_buffer(CLIENT_ALL); // Clear serial read buffer
9599
gc_init(); // Set g-code parser to default state

Grbl_Esp32/src/Grbl.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// Grbl versioning system
2424

2525
const char* const GRBL_VERSION = "1.3a";
26-
const char* const GRBL_VERSION_BUILD = "20201004";
26+
const char* const GRBL_VERSION_BUILD = "20201022";
2727

2828
//#include <sdkconfig.h>
2929
#include <Arduino.h>
@@ -41,18 +41,17 @@ const char* const GRBL_VERSION_BUILD = "20201004";
4141

4242
#include "Defaults.h"
4343
#include "Error.h"
44-
#include "SettingsStorage.h"
44+
#include "Eeprom.h"
4545
#include "WebUI/Authentication.h"
4646
#include "WebUI/Commands.h"
47+
#include "Probe.h"
4748
#include "System.h"
4849

4950
#include "GCode.h"
5051
#include "Planner.h"
51-
#include "Eeprom.h"
5252
#include "CoolantControl.h"
5353
#include "Limits.h"
5454
#include "MotionControl.h"
55-
#include "Probe.h"
5655
#include "Protocol.h"
5756
#include "Report.h"
5857
#include "Serial.h"
@@ -88,9 +87,7 @@ const char* const GRBL_VERSION_BUILD = "20201004";
8887
# endif
8988
#endif
9089

91-
#ifdef USE_I2S_OUT
92-
# include "I2SOut.h"
93-
#endif
90+
#include "I2SOut.h"
9491

9592
void grbl_init();
9693
void run_once();

0 commit comments

Comments
 (0)