diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index b926b1a68..abf6313d0 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -179,6 +179,8 @@ typedef struct { usbep_t bulk_out; /** * @brief Interrupt IN endpoint used for notifications. + * @note If set to zero then the INT endpoint is assumed to be not + * present, USB descriptors must be changed accordingly. */ usbep_t int_in; } SerialUSBConfig; diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c index f5392bdf6..dc0e803a8 100644 --- a/os/hal/src/serial_usb.c +++ b/os/hal/src/serial_usb.c @@ -218,7 +218,9 @@ void sduStart(SerialUSBDriver *sdup, const SerialUSBConfig *config) { "invalid state"); usbp->in_params[config->bulk_in - 1U] = sdup; usbp->out_params[config->bulk_out - 1U] = sdup; - usbp->in_params[config->int_in - 1U] = sdup; + if (config->int_in > 0U) { + usbp->in_params[config->int_in - 1U] = sdup; + } sdup->config = config; sdup->state = SDU_READY; osalSysUnlock(); @@ -245,7 +247,9 @@ void sduStop(SerialUSBDriver *sdup) { /* Driver in stopped state.*/ usbp->in_params[sdup->config->bulk_in - 1U] = NULL; usbp->out_params[sdup->config->bulk_out - 1U] = NULL; - usbp->in_params[sdup->config->int_in - 1U] = NULL; + if (sdup->config->int_in > 0U) { + usbp->in_params[sdup->config->int_in - 1U] = NULL; + } sdup->state = SDU_STOP; /* Queues reset in order to signal the driver stop to the application.*/ diff --git a/readme.txt b/readme.txt index 95881022e..d3fbe91a2 100644 --- a/readme.txt +++ b/readme.txt @@ -74,6 +74,8 @@ ***************************************************************************** *** 3.0.0p4 *** +- HAL: Change to the Serial_USB driver, now the INT endpoint is no more + mandatory. - HAL: New DAC driver implementation for STM32F4xx. - HAL: Fixed STM32 RTC SSR Register Counts Down (bug #591). - HAL: Fixed STM32 RTC PRER Register not being set in init (bug #590).