aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-07-31 06:46:17 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-07-31 06:46:17 +0000
commit8e4fd21b2b79a1f9f3c3601d6d344a9bfd4cc060 (patch)
treefd47b9c99b307d36446d9f03911bc1fcb00c9bd1 /os
parentda5080f92aa8b725e99d26269c714294c32e9d82 (diff)
downloadChibiOS-8e4fd21b2b79a1f9f3c3601d6d344a9bfd4cc060.tar.gz
ChibiOS-8e4fd21b2b79a1f9f3c3601d6d344a9bfd4cc060.tar.bz2
ChibiOS-8e4fd21b2b79a1f9f3c3601d6d344a9bfd4cc060.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2099 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/STM32/serial_lld.c6
-rw-r--r--os/hal/platforms/STM32/uart_lld.c10
-rw-r--r--os/hal/src/uart.c16
3 files changed, 18 insertions, 14 deletions
diff --git a/os/hal/platforms/STM32/serial_lld.c b/os/hal/platforms/STM32/serial_lld.c
index 8885af9af..30b89109a 100644
--- a/os/hal/platforms/STM32/serial_lld.c
+++ b/os/hal/platforms/STM32/serial_lld.c
@@ -70,7 +70,7 @@ static const SerialConfig default_config =
{
SERIAL_DEFAULT_BITRATE,
0,
- USART_CR2_STOP1_BITS | USART_CR2_LINEN,
+ USART_CR2_STOP1_BITS,
0
};
@@ -121,6 +121,9 @@ static void usart_deinit(USART_TypeDef *u) {
u->CR3 = 0;
}
+#if USE_STM32_USART1 || USE_STM32_USART2 || USE_STM32_USART3 || \
+ ((USE_STM32_USART4 || USE_STM32_USART5) && \
+ (defined(STM32F10X_HD) || defined(STM32F10X_CL)))
/**
* @brief Error handling routine.
*
@@ -179,6 +182,7 @@ static void serve_interrupt(SerialDriver *sdp) {
chSysUnlockFromIsr();
}
}
+#endif
#if USE_STM32_USART1 || defined(__DOXYGEN__)
static void notify1(void) {
diff --git a/os/hal/platforms/STM32/uart_lld.c b/os/hal/platforms/STM32/uart_lld.c
index 6708fe1e6..02fc46bb7 100644
--- a/os/hal/platforms/STM32/uart_lld.c
+++ b/os/hal/platforms/STM32/uart_lld.c
@@ -373,10 +373,10 @@ void uart_lld_init(void) {
RCC->APB1RSTR = RCC_APB1RSTR_USART2RST;
RCC->APB1RSTR = 0;
uartObjectInit(&UARTD2);
- UARTD1.ud_usart = USART2;
- UARTD1.ud_dmarx = STM32_DMA_CHANNEL_6;
- UARTD1.ud_dmatx = STM32_DMA_CHANNEL_7;
- UARTD1.ud_dmaccr = 0;
+ UARTD2.ud_usart = USART2;
+ UARTD2.ud_dmarx = STM32_DMA_CHANNEL_6;
+ UARTD2.ud_dmatx = STM32_DMA_CHANNEL_7;
+ UARTD2.ud_dmaccr = 0;
#endif
}
@@ -410,7 +410,7 @@ void uart_lld_start(UARTDriver *uartp) {
CORTEX_PRIORITY_MASK(STM32_UART_USART2_IRQ_PRIORITY));
NVICEnableVector(DMA1_Channel7_IRQn,
CORTEX_PRIORITY_MASK(STM32_UART_USART2_IRQ_PRIORITY));
- RCC->APB1ENR |= RCC_APB2ENR_USART1EN;
+ RCC->APB1ENR |= RCC_APB1ENR_USART2EN;
}
#endif
diff --git a/os/hal/src/uart.c b/os/hal/src/uart.c
index 9c200763f..4c1a2a55a 100644
--- a/os/hal/src/uart.c
+++ b/os/hal/src/uart.c
@@ -57,7 +57,7 @@ void uartInit(void) {
/**
* @brief Initializes the standard part of a @p UARTDriver structure.
*
- * @param[in] uartp pointer to the @p UARTDriver object
+ * @param[in] uartp pointer to the @p UARTDriver object
*/
void uartObjectInit(UARTDriver *uartp) {
@@ -70,7 +70,7 @@ void uartObjectInit(UARTDriver *uartp) {
/**
* @brief Configures and activates the UART peripheral.
*
- * @param[in] uartp pointer to the @p UARTDriver object
+ * @param[in] uartp pointer to the @p UARTDriver object
* @param[in] config pointer to the @p UARTConfig object
*/
void uartStart(UARTDriver *uartp, const UARTConfig *config) {
@@ -92,7 +92,7 @@ void uartStart(UARTDriver *uartp, const UARTConfig *config) {
/**
* @brief Deactivates the UART peripheral.
*
- * @param[in] uartp pointer to the @p UARTDriver object
+ * @param[in] uartp pointer to the @p UARTDriver object
*/
void uartStop(UARTDriver *uartp) {
@@ -163,13 +163,13 @@ void uartStartSendI(UARTDriver *uartp, size_t n, const void *txbuf) {
* @brief Stops any ongoing transmission.
* @note Stopping a transmission also suppresses the transmission callbacks.
*
- * @param[in] uartp pointer to the @p UARTDriver object
+ * @param[in] uartp pointer to the @p UARTDriver object
*/
void uartStopSend(UARTDriver *uartp) {
chDbgCheck(uartp != NULL, "uartStopSend");
- chSysLock()
+ chSysLock();
chDbgAssert(uartp->ud_state == UART_READY,
"uartStopSend(), #1",
"not active");
@@ -186,7 +186,7 @@ void uartStopSend(UARTDriver *uartp) {
* @note Stopping a transmission also suppresses the transmission callbacks.
* @note This function has to be invoked from a lock zone.
*
- * @param[in] uartp pointer to the @p UARTDriver object
+ * @param[in] uartp pointer to the @p UARTDriver object
*/
void uartStopSendI(UARTDriver *uartp) {
@@ -255,13 +255,13 @@ void uartStartReceiveI(UARTDriver *uartp, size_t n, void *rxbuf) {
* @brief Stops any ongoing receive operation.
* @note Stopping a receive operation also suppresses the receive callbacks.
*
- * @param[in] uartp pointer to the @p UARTDriver object
+ * @param[in] uartp pointer to the @p UARTDriver object
*/
void uartStopReceive(UARTDriver *uartp) {
chDbgCheck(uartp != NULL, "uartStopReceive");
- chSysLock()
+ chSysLock();
chDbgAssert(uartp->ud_state == UART_READY,
"uartStopReceive(), #1",
"not active");