Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2553790

Browse files
authored
fix(grbl): address a regression in PR #889 related to the grbl-Mega connection handling (#893)
* fix(grbl): address a regression in PR #889 related to the `grbl-Mega` connection handling * chore: update default settings
1 parent 048367b commit 2553790

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

examples/.cncrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
"controller": "",
1919
"state": {
2020
"allowAnonymousUsageDataCollection": false,
21-
"checkForUpdates": true
21+
"checkForUpdates": true,
22+
"controller": {
23+
"exception": {
24+
"ignoreErrors": false
25+
}
26+
}
2227
},
2328
"commands": [
2429
{

src/server/controllers/Grbl/GrblController.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,13 @@ class GrblController {
617617
if (this.isOpen()) {
618618
this.connection.write('?');
619619
}
620-
}, 2000, { trailing: true });
620+
}, 1000, {
621+
// For grbl-Mega, it is essential to allow a specific delay before querying the status report to avoid blocking the connection.
622+
// Therefore, the `leading` option must be set to false.
623+
// @see https://github.com/cncjs/cncjs/issues/889
624+
leading: false,
625+
trailing: true,
626+
});
621627

622628
const queryStatusReport = () => {
623629
// Check the ready flag

src/server/services/configstore/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import logger from '../../lib/logger';
77
const log = logger('service:configstore');
88

99
const defaultState = { // default state
10+
allowAnonymousUsageDataCollection: false,
1011
checkForUpdates: true,
1112
controller: {
1213
exception: {

0 commit comments

Comments
 (0)