diff --git a/Firmware/Board/v3/Src/usbd_desc.c b/Firmware/Board/v3/Src/usbd_desc.c index c07403ac..d213f64a 100644 --- a/Firmware/Board/v3/Src/usbd_desc.c +++ b/Firmware/Board/v3/Src/usbd_desc.c @@ -97,7 +97,8 @@ #define USBD_PID_FS 0x0D32 #define USBD_PRODUCT_XSTR(s) USBD_PRODUCT_STR(s) #define USBD_PRODUCT_STR(s) #s -#define USBD_PRODUCT_STRING_FS ODrive version HW_VERSION_MAJOR.HW_VERSION_MINOR +#define USBD_PRODUCT_STRING_FS ODrive HW_VERSION_MAJOR.HW_VERSION_MINOR CDC Interface +#define NATIVE_STRING ODrive HW_VERSION_MAJOR.HW_VERSION_MINOR Native Interface #define USBD_SERIALNUMBER_STRING_FS "000000000001" #define USBD_CONFIGURATION_STRING_FS "CDC Config" #define USBD_INTERFACE_STRING_FS "CDC Interface" @@ -152,7 +153,7 @@ uint8_t * USBD_UsrStrDescriptor(struct _USBD_HandleTypeDef *pdev, uint8_t index, *length = sizeof (USBD_MS_OS_StringDescriptor); return USBD_MS_OS_StringDescriptor; } else if (USBD_IDX_ODRIVE_INTF_STR == index) { - USBD_GetString((uint8_t *)"ODrive Interface", USBD_StrDesc, length); + USBD_GetString((uint8_t *)USBD_PRODUCT_XSTR(NATIVE_STRING), USBD_StrDesc, length); return USBD_StrDesc; } return NULL; diff --git a/Firmware/MotorControl/odrive_main.h b/Firmware/MotorControl/odrive_main.h index b12a0cd1..aff37201 100644 --- a/Firmware/MotorControl/odrive_main.h +++ b/Firmware/MotorControl/odrive_main.h @@ -54,7 +54,7 @@ extern SystemStats_t system_stats_; // @brief general user configurable board configuration struct BoardConfig_t { bool enable_uart = true; - bool enable_ascii_protocol_on_usb = false; + bool enable_ascii_protocol_on_usb = true; float brake_resistance = 0.47f; // [ohm] float dc_bus_undervoltage_trip_level = 8.0f; //(*tree_ptr); set_application_endpoints(&endpoint_provider); - serve_on_uart(); - serve_on_usb(); + start_uart_server(); + start_usb_server(); for (;;) { osDelay(1000); // nothing to do diff --git a/Firmware/communication/interface_uart.cpp b/Firmware/communication/interface_uart.cpp index 58b4f57d..d5a47190 100644 --- a/Firmware/communication/interface_uart.cpp +++ b/Firmware/communication/interface_uart.cpp @@ -87,7 +87,7 @@ static void uart_server_thread(void * ctx) { }; } -void serve_on_uart() { +void start_uart_server() { // DMA is set up to recieve in a circular buffer forever. // We dont use interrupts to fetch the data, instead we periodically read // data out of the circular buffer into a parse buffer, controlled by a state machine diff --git a/Firmware/communication/interface_uart.h b/Firmware/communication/interface_uart.h index 8ad71c19..a7a291f0 100644 --- a/Firmware/communication/interface_uart.h +++ b/Firmware/communication/interface_uart.h @@ -12,7 +12,7 @@ extern "C" { extern osThreadId uart_thread; -void serve_on_uart(void); +void start_uart_server(void); #ifdef __cplusplus } diff --git a/Firmware/communication/interface_usb.cpp b/Firmware/communication/interface_usb.cpp index 142765c2..c0194ec5 100644 --- a/Firmware/communication/interface_usb.cpp +++ b/Firmware/communication/interface_usb.cpp @@ -117,7 +117,7 @@ void usb_process_packet(uint8_t *buf, uint32_t len, uint8_t endpoint_pair) { osSemaphoreRelease(sem_usb_rx); } -void serve_on_usb() { +void start_usb_server() { // Start USB communication thread osThreadDef(usb_server_thread_def, usb_server_thread, osPriorityNormal, 0, 512); usb_thread = osThreadCreate(osThread(usb_server_thread_def), NULL); diff --git a/Firmware/communication/interface_usb.h b/Firmware/communication/interface_usb.h index b246a752..f8b11ee0 100644 --- a/Firmware/communication/interface_usb.h +++ b/Firmware/communication/interface_usb.h @@ -22,7 +22,7 @@ typedef struct { extern USBStats_t usb_stats_; void usb_process_packet(uint8_t *buf, uint32_t len, uint8_t endpoint_pair); -void serve_on_usb(void); +void start_usb_server(void); #ifdef __cplusplus } diff --git a/tools/odrive/enums.py b/tools/odrive/enums.py index 52b1e610..c492f9a0 100644 --- a/tools/odrive/enums.py +++ b/tools/odrive/enums.py @@ -27,7 +27,7 @@ MOTOR_TYPE_HIGH_CURRENT = 0 #MOTOR_TYPE_LOW_CURRENT = 1 MOTOR_TYPE_GIMBAL = 2 -CTRL_MODE_VOLTAGE_CONTROL = 0, -CTRL_MODE_CURRENT_CONTROL = 1, -CTRL_MODE_VELOCITY_CONTROL = 2, +CTRL_MODE_VOLTAGE_CONTROL = 0 +CTRL_MODE_CURRENT_CONTROL = 1 +CTRL_MODE_VELOCITY_CONTROL = 2 CTRL_MODE_POSITION_CONTROL = 3