Improvement to serial_usb driver.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7955 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2015-05-08 09:24:11 +00:00
parent bd1bedbbf7
commit 0cd802faf1
3 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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.*/

View File

@ -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).