fix compilation when using stdout protocol

This commit is contained in:
Samuel Sadok
2018-05-14 16:25:31 -07:00
parent 62a599bf6e
commit 0e32df329f
5 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -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);
+3
View File
@@ -2,6 +2,9 @@
#define __INTERFACE_UART_HPP
#ifdef __cplusplus
#include "protocol.hpp"
extern StreamSink* uart4_stream_output_ptr;
extern "C" {
#endif
+1
View File
@@ -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);
+3
View File
@@ -2,6 +2,9 @@
#define __INTERFACE_USB_HPP
#ifdef __cplusplus
#include "protocol.hpp"
extern StreamSink* usb_stream_output_ptr;
extern "C" {
#endif