mirror of
https://github.com/grblHAL/core.git
synced 2026-03-23 11:32:44 +08:00
Small changes to ensure that output during startup do not cause
hangs due to no client connection when native USB is default.
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
## grblHAL changelog
|
## grblHAL changelog
|
||||||
|
|
||||||
|
<a name="20260321">Build 20260321
|
||||||
|
|
||||||
|
Core:
|
||||||
|
|
||||||
|
* Small changes to ensure that output during startup do not cause hangs due to no client connection when native USB is default.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
<a name="20260320">Build 20260320
|
<a name="20260320">Build 20260320
|
||||||
|
|
||||||
Core:
|
Core:
|
||||||
|
|||||||
2
grbl.h
2
grbl.h
@@ -42,7 +42,7 @@
|
|||||||
#else
|
#else
|
||||||
#define GRBL_VERSION "1.1f"
|
#define GRBL_VERSION "1.1f"
|
||||||
#endif
|
#endif
|
||||||
#define GRBL_BUILD 20260320
|
#define GRBL_BUILD 20260321
|
||||||
|
|
||||||
#define GRBL_URL "https://github.com/grblHAL"
|
#define GRBL_URL "https://github.com/grblHAL"
|
||||||
|
|
||||||
|
|||||||
36
report.c
36
report.c
@@ -210,30 +210,28 @@ FLASHMEM void report_init (void)
|
|||||||
// operation. Errors events can originate from the g-code parser, settings module, or asynchronously
|
// operation. Errors events can originate from the g-code parser, settings module, or asynchronously
|
||||||
// from a critical error, such as a triggered hard limit. Interface should always monitor for these
|
// from a critical error, such as a triggered hard limit. Interface should always monitor for these
|
||||||
// responses.
|
// responses.
|
||||||
FLASHMEM static status_code_t report_status_message (status_code_t status_code)
|
FLASHMEM static status_code_t report_status_message (status_code_t status)
|
||||||
{
|
{
|
||||||
switch(status_code) {
|
if(status == Status_Handled)
|
||||||
|
status = Status_OK;
|
||||||
|
|
||||||
case Status_Handled:
|
if(hal.stream.is_connected()) {
|
||||||
status_code = Status_OK;
|
if(status == Status_OK)
|
||||||
// no break
|
|
||||||
case Status_OK: // STATUS_OK
|
|
||||||
hal.stream.write("ok" ASCII_EOL);
|
hal.stream.write("ok" ASCII_EOL);
|
||||||
break;
|
else
|
||||||
|
hal.stream.write(appendbuf(3, "error:", uitoa((uint32_t)status), ASCII_EOL));
|
||||||
default:
|
|
||||||
hal.stream.write(appendbuf(3, "error:", uitoa((uint32_t)status_code), ASCII_EOL));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return status_code;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prints alarm messages.
|
// Prints alarm messages.
|
||||||
FLASHMEM static alarm_code_t report_alarm_message (alarm_code_t alarm_code)
|
FLASHMEM static alarm_code_t report_alarm_message (alarm_code_t alarm_code)
|
||||||
{
|
{
|
||||||
hal.stream.write_all(appendbuf(3, "ALARM:", uitoa((uint32_t)alarm_code), ASCII_EOL));
|
if(hal.stream.is_connected()) {
|
||||||
hal.delay_ms(100, NULL); // Force delay to ensure message clears output stream buffer.
|
hal.stream.write_all(appendbuf(3, "ALARM:", uitoa((uint32_t)alarm_code), ASCII_EOL));
|
||||||
|
hal.delay_ms(100, NULL); // Force delay to ensure message clears output stream buffer.
|
||||||
|
}
|
||||||
|
|
||||||
return alarm_code;
|
return alarm_code;
|
||||||
}
|
}
|
||||||
@@ -856,10 +854,12 @@ FLASHMEM void report_startup_line (uint8_t n, char *line)
|
|||||||
|
|
||||||
FLASHMEM void report_execute_startup_message (char *line, status_code_t status_code)
|
FLASHMEM void report_execute_startup_message (char *line, status_code_t status_code)
|
||||||
{
|
{
|
||||||
hal.stream.write(">");
|
if(hal.stream.is_connected()) {
|
||||||
hal.stream.write(line);
|
hal.stream.write(">");
|
||||||
hal.stream.write(":");
|
hal.stream.write(line);
|
||||||
grbl.report.status_message(status_code);
|
hal.stream.write(":");
|
||||||
|
grbl.report.status_message(status_code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prints build info line
|
// Prints build info line
|
||||||
|
|||||||
Reference in New Issue
Block a user