Skip to content

Commit

Permalink
Merge pull request #756 from Paciente8159/fix-debug-stream-setting
Browse files Browse the repository at this point in the history
fix error with custom debug stream
  • Loading branch information
Paciente8159 authored Sep 17, 2024
2 parents 1ec78dd + c30e76e commit 783d874
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions uCNC/src/interface/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,8 @@ uint8_t serial_available(void)
while (p != NULL)
{
#ifdef ENABLE_DEBUG_STREAM
#if DEBUG_STREAM != default_stream
// skip the debug stream, if it differs from default_stream
if (p != DEBUG_STREAM)
#endif
if (p != DEBUG_STREAM || p == default_stream)
{
#endif
count = (!(p->stream_available)) ? 0 : p->stream_available();
Expand Down
4 changes: 4 additions & 0 deletions uCNC/src/interface/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ extern "C"
#define serial_print_fltarr(arr, count) print_fltarr(serial_putc, arr, count)

#ifdef ENABLE_DEBUG_STREAM
// to customize the debug stream you can reference it to an existing stream
// for example to set it to the USB stream you can define DEBUG_STREAM like this
// #define DEBUG_STREAM (&usb_serial_stream)

#ifndef DEBUG_STREAM
extern serial_stream_t *default_stream;
#define DEBUG_STREAM default_stream
Expand Down

0 comments on commit 783d874

Please sign in to comment.