Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error with custom debug stream #756

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading