aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-05-08 09:24:11 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-05-08 09:24:11 +0000
commit0cd802faf1c7ab3f2ae237a91aabbd8a79cea831 (patch)
tree1e8f5f1605f144ead2459bfa45aea13404821813
parentbd1bedbbf7502541cc6cf6b11faedc9acd03228c (diff)
downloadChibiOS-0cd802faf1c7ab3f2ae237a91aabbd8a79cea831.tar.gz
ChibiOS-0cd802faf1c7ab3f2ae237a91aabbd8a79cea831.tar.bz2
ChibiOS-0cd802faf1c7ab3f2ae237a91aabbd8a79cea831.zip
Improvement to serial_usb driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7955 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/include/serial_usb.h2
-rw-r--r--os/hal/src/serial_usb.c8
-rw-r--r--readme.txt2
3 files changed, 10 insertions, 2 deletions
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).