aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-10-23 12:21:44 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-10-23 12:21:44 +0000
commit2f572f109a463e7faa46ed544c91198e72e63343 (patch)
tree357162e59b91596a8441d9cd6a48f07458a95771
parent53df7ed814f665ebeef75b379941f9c0cebcba55 (diff)
downloadChibiOS-2f572f109a463e7faa46ed544c91198e72e63343.tar.gz
ChibiOS-2f572f109a463e7faa46ed544c91198e72e63343.tar.bz2
ChibiOS-2f572f109a463e7faa46ed544c91198e72e63343.zip
USB enhancements, phase two.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3451 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--boards/OLIMEX_STM32_P103/board.h10
-rw-r--r--os/hal/include/usb.h10
-rw-r--r--os/various/shell.c2
-rw-r--r--readme.txt12
-rw-r--r--testhal/STM32F1xx/USB_CDC/main.c1
5 files changed, 31 insertions, 4 deletions
diff --git a/boards/OLIMEX_STM32_P103/board.h b/boards/OLIMEX_STM32_P103/board.h
index 337fc8ca0..699e9ad46 100644
--- a/boards/OLIMEX_STM32_P103/board.h
+++ b/boards/OLIMEX_STM32_P103/board.h
@@ -135,6 +135,16 @@
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF
+/*
+ * USB bus activation macro, required by the USB driver.
+ */
+#define usb_lld_connect_bus(usbp) palClearPad(GPIOC, GPIOC_USB_DISC)
+
+/*
+ * USB bus de-activation macro, required by the USB driver.
+ */
+#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOC, GPIOC_USB_DISC)
+
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h
index 18842abd3..bc4418f6b 100644
--- a/os/hal/include/usb.h
+++ b/os/hal/include/usb.h
@@ -322,6 +322,16 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp,
* @{
*/
/**
+ * @brief Connects the USB device.
+ */
+#define usbConnectBus(usbp) usb_lld_connect_bus(usbp)
+
+/**
+ * @brief Disconnect the USB device.
+ */
+#define usbDisconnectBus(usbp) usb_lld_disconnect_bus(usbp)
+
+/**
* @brief Returns the current frame number.
*
* @param[in] usbp pointer to the @p USBDriver object
diff --git a/os/various/shell.c b/os/various/shell.c
index a99f2657c..4c84a7b51 100644
--- a/os/various/shell.c
+++ b/os/various/shell.c
@@ -204,7 +204,7 @@ static msg_t shell_thread(void *p) {
there is not a chSysUnlock() because the thread terminates upon return.*/
chSysLock();
chEvtBroadcastI(&shell_terminated);
- return msg;
+ chThdExitS(msg);
}
/**
diff --git a/readme.txt b/readme.txt
index 2b4eb54ed..4b15c2dca 100644
--- a/readme.txt
+++ b/readme.txt
@@ -76,9 +76,15 @@
*** 2.3.4 ***
- FIX: Fixed broken TIM8 support in STM32 PWM driver (bug 3418620).
- FIX: Fixed halconf.h file corrupted in some STM32 demos (bug 3418626).
-- NEW: Updated USB driver model and STM32 implementation. Updated the
- SERIAL_USB driver to match the new API. Fixed several problems in
- both drivers.
+- NEW: Updated USB driver model and STM32 implementation and fixed several
+ problems.
+ - Changed the API to move buffer copy operations out of critical zones.
+ - Added usbConnectBus() and usbDisconnectBus() functions.
+ - Fixed problems with incorrect assertions.
+- NEW Updated the SERIAL_USB driver to match the new USB API, also fixed
+ some problems.
+ - Fixed incorrect use of input queues, the change required a change in
+ input queues too.
- NEW: Added a macro THD_STATE_NAMES to chthreads.h. This macro is an
initializer for string arrays containing thread state names.
- NEW: Added memory copy functionality to the STM32 DMA driver.
diff --git a/testhal/STM32F1xx/USB_CDC/main.c b/testhal/STM32F1xx/USB_CDC/main.c
index 2c46eb11b..9e05edbdb 100644
--- a/testhal/STM32F1xx/USB_CDC/main.c
+++ b/testhal/STM32F1xx/USB_CDC/main.c
@@ -421,6 +421,7 @@ int main(void) {
*/
sduObjectInit(&SDU1);
sduStart(&SDU1, &serusbcfg);
+ usbConnectBus(serusbcfg.usbp);
palClearPad(GPIOC, GPIOC_USB_DISC);
/*