mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-10-20 16:53:28 +08:00
fix compilation when using stdout protocol
This commit is contained in:
@@ -182,10 +182,10 @@ int _write(int file, const char* data, int len);
|
||||
// @brief This is what printf calls internally
|
||||
int _write(int file, const char* data, int len) {
|
||||
#ifdef USB_PROTOCOL_STDOUT
|
||||
usb_stream_output.process_bytes((const uint8_t *)data, len);
|
||||
usb_stream_output_ptr->process_bytes((const uint8_t *)data, len);
|
||||
#endif
|
||||
#ifdef UART_PROTOCOL_STDOUT
|
||||
uart4_stream_output.process_bytes((const uint8_t *)data, len);
|
||||
uart4_stream_output_ptr->process_bytes((const uint8_t *)data, len);
|
||||
#endif
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
private:
|
||||
uint8_t tx_buf_[UART_TX_BUFFER_SIZE];
|
||||
} uart4_stream_output;
|
||||
StreamSink* uart4_stream_output_ptr = &uart4_stream_output;
|
||||
|
||||
PacketToStreamConverter uart4_packet_output(uart4_stream_output);
|
||||
BidirectionalPacketBasedChannel uart4_channel(uart4_packet_output);
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define __INTERFACE_UART_HPP
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "protocol.hpp"
|
||||
extern StreamSink* uart4_stream_output_ptr;
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ public:
|
||||
private:
|
||||
PacketSink& output_;
|
||||
} usb_stream_output(usb_packet_output);
|
||||
StreamSink* usb_stream_output_ptr = &usb_stream_output;
|
||||
|
||||
#if defined(USB_PROTOCOL_NATIVE)
|
||||
BidirectionalPacketBasedChannel usb_channel(usb_packet_output);
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define __INTERFACE_USB_HPP
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "protocol.hpp"
|
||||
extern StreamSink* usb_stream_output_ptr;
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user