mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-02-06 07:01:52 +08:00
Merge branch 'devel' into sam_winusb
This commit is contained in:
@@ -43,6 +43,8 @@ env:
|
||||
- CONFIG_BOARD_VERSION=v3.3 DEPLOY=v3.3
|
||||
- CONFIG_BOARD_VERSION=v3.4-24V DEPLOY=v3.4-24V
|
||||
- CONFIG_BOARD_VERSION=v3.4-48V DEPLOY=v3.4-48V
|
||||
- CONFIG_BOARD_VERSION=v3.5-24V DEPLOY=v3.5-24V
|
||||
- CONFIG_BOARD_VERSION=v3.5-48V DEPLOY=v3.5-48V
|
||||
|
||||
# Various protocol combinations
|
||||
- CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=native-stream CONFIG_UART_PROTOCOL=native
|
||||
|
||||
@@ -183,10 +183,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
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "interface_usb.h"
|
||||
#include "protocol.hpp"
|
||||
|
||||
#include "ascii_protocol.h"
|
||||
|
||||
#include <MotorControl/utils.h>
|
||||
|
||||
#include <usbd_cdc.h>
|
||||
@@ -69,6 +71,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