Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Paciente8159 committed Sep 30, 2024
1 parent 5b38736 commit 41371a2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion uCNC/cnc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ extern "C"
* For pin diagnostics enables command $P
* */
// #define ENABLE_EXTRA_SYSTEM_CMDS
// #define ENABLE_EXTRA_SYSTEM_CMDS
// uncomment o translate pins names when printing pins states with $P command
// #define ENABLE_PIN_TRANSLATIONS
Expand Down
2 changes: 1 addition & 1 deletion uCNC/src/cnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ uint8_t cnc_parse_cmd(void)
#ifdef ENABLE_PARSING_TIME_DEBUG
uint32_t exec_time;
#endif
uint8_t error = 0;
uint8_t error = STATUS_OK;
// process gcode commands
if (grbl_stream_available())
{
Expand Down
4 changes: 3 additions & 1 deletion uCNC/src/interface/grbl_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ static void grbl_protocol_ftoa_array(float *array, uint8_t count)

void grbl_protocol_error(uint8_t error)
{
if (error)
if (error != STATUS_OK)
{
grbl_protocol_print(MSG_ERROR);
grbl_protocol_itoa(error);
Expand Down Expand Up @@ -652,6 +652,7 @@ void grbl_protocol_probe_result(uint8_t val)
parser_get_coordsys(255, axis);
grbl_protocol_print("[PRB:");
grbl_protocol_ftoa_array(axis, MAX(AXIS_COUNT, 3));
grbl_protocol_putc(':');
grbl_protocol_itoa(val);
grbl_protocol_print(MSG_END);
}
Expand Down Expand Up @@ -742,6 +743,7 @@ void grbl_protocol_gcode_modes(void)
grbl_protocol_putc(' ');
grbl_protocol_putc('S');
grbl_protocol_itoa(spindle);
grbl_protocol_print(MSG_END);
}

void grbl_protocol_gcode_setting_line_int(setting_offset_t setting, uint16_t value)
Expand Down
8 changes: 5 additions & 3 deletions uCNC/src/interface/grbl_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static FORCEINLINE void grbl_stream_flush(void);
#define DEBUG_TX_BUFFER_SIZE 250
#endif
DECL_BUFFER(uint8_t, debug_tx, DEBUG_TX_BUFFER_SIZE);
static uint8_t debug_tx_lines;
static volatile uint8_t debug_tx_lines;
#endif

#ifndef DISABLE_MULTISTREAM_SERIAL
Expand Down Expand Up @@ -108,9 +108,11 @@ static void debug_flush(void)

static void FORCEINLINE debug_putc(char c)
{
while (BUFFER_FULL(debug_tx))
if (BUFFER_FULL(debug_tx))
{
debug_flush();
BUFFER_CLEAR(debug_tx);
rom_strcpy(debug_tx_bufferdata, __romstr__("Debug buffer overflow!\0"));
debug_tx.count = strlen(debug_tx_bufferdata);
}

BUFFER_ENQUEUE(debug_tx, &c);
Expand Down

0 comments on commit 41371a2

Please sign in to comment.