diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-01 10:53:18 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-01 10:53:18 +0000 |
commit | 5da56bd07fca28900f9a53c51312be46d759e1d2 (patch) | |
tree | f4a0047927ae61466526c24c0bb71bad745cbf07 /os/hal/platforms | |
parent | a9753ea48ac394028762b6a3fa9812e0092bb08e (diff) | |
download | ChibiOS-5da56bd07fca28900f9a53c51312be46d759e1d2.tar.gz ChibiOS-5da56bd07fca28900f9a53c51312be46d759e1d2.tar.bz2 ChibiOS-5da56bd07fca28900f9a53c51312be46d759e1d2.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2318 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r-- | os/hal/platforms/STM8/serial_lld.c | 48 | ||||
-rw-r--r-- | os/hal/platforms/STM8/serial_lld.h | 20 | ||||
-rw-r--r-- | os/hal/platforms/STM8/spi_lld.c | 2 | ||||
-rw-r--r-- | os/hal/platforms/STM8/spi_lld.h | 2 |
4 files changed, 36 insertions, 36 deletions
diff --git a/os/hal/platforms/STM8/serial_lld.c b/os/hal/platforms/STM8/serial_lld.c index eeda867f9..13c9c2f24 100644 --- a/os/hal/platforms/STM8/serial_lld.c +++ b/os/hal/platforms/STM8/serial_lld.c @@ -37,21 +37,21 @@ /**
* @brief UART1 serial driver identifier.
*/
-#if USE_STM8_UART1 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART1 || defined(__DOXYGEN__)
SerialDriver SD1;
#endif
/**
* @brief UART2 serial driver identifier.
*/
-#if USE_STM8_UART2 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART2 || defined(__DOXYGEN__)
SerialDriver SD2;
#endif
/**
* @brief UART3 serial driver identifier.
*/
-#if USE_STM8_UART3 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART3 || defined(__DOXYGEN__)
SerialDriver SD3;
#endif
@@ -89,7 +89,7 @@ static void set_error(SerialDriver *sdp, uint8_t sr) { chSysUnlockFromIsr();
}
-#if USE_STM8_UART1 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART1 || defined(__DOXYGEN__)
static void notify1(void) {
UART1->CR2 |= UART1_CR2_TIEN;
@@ -128,9 +128,9 @@ static void uart1_deinit(void) { UART1->CR5 = 0;
UART1->PSCR = 0;
}
-#endif /* USE_STM8_UART1 */
+#endif /* STM8_SERIAL_USE_UART1 */
-#if USE_STM8_UART2 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART2 || defined(__DOXYGEN__)
static void notify2(void) {
UART2->CR2 |= UART2_CR2_TIEN;
@@ -171,9 +171,9 @@ static void uart2_deinit(void) { UART2->CR6 = 0;
UART2->PSCR = 0;
}
-#endif /* USE_STM8_UART1 */
+#endif /* STM8_SERIAL_USE_UART1 */
-#if USE_STM8_UART3 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART3 || defined(__DOXYGEN__)
static void notify3(void) {
UART3->CR2 |= UART3_CR2_TIEN;
@@ -210,13 +210,13 @@ static void uart3_deinit(void) { UART3->CR4 = 0;
UART3->CR6 = 0;
}
-#endif /* USE_STM8_UART3 */
+#endif /* STM8_SERIAL_USE_UART3 */
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
-#if USE_STM8_UART1 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART1 || defined(__DOXYGEN__)
/**
* @brief IRQ 17 service routine.
*
@@ -257,9 +257,9 @@ CH_IRQ_HANDLER(18) { CH_IRQ_EPILOGUE();
}
-#endif /* USE_STM8_UART1 */
+#endif /* STM8_SERIAL_USE_UART1 */
-#if USE_STM8_UART2 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART2 || defined(__DOXYGEN__)
/**
* @brief IRQ 20 service routine.
*
@@ -300,9 +300,9 @@ CH_IRQ_HANDLER(21) { CH_IRQ_EPILOGUE();
}
-#endif /* USE_STM8_UART2 */
+#endif /* STM8_SERIAL_USE_UART2 */
-#if USE_STM8_UART3 || defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART3 || defined(__DOXYGEN__)
/**
* @brief IRQ 20 service routine.
*
@@ -343,7 +343,7 @@ CH_IRQ_HANDLER(21) { CH_IRQ_EPILOGUE();
}
-#endif /* USE_STM8_UART3 */
+#endif /* STM8_SERIAL_USE_UART3 */
/*===========================================================================*/
/* Driver exported functions. */
@@ -356,19 +356,19 @@ CH_IRQ_HANDLER(21) { */
void sd_lld_init(void) {
-#if USE_STM8_UART1
+#if STM8_SERIAL_USE_UART1
sdObjectInit(&SD1, NULL, notify1);
CLK->PCKENR1 |= CLK_PCKENR1_UART1; /* PCKEN12, clock source. */
UART1->CR1 = UART1_CR1_UARTD; /* UARTD (low power). */
#endif
-#if USE_STM8_UART2
+#if STM8_SERIAL_USE_UART2
sdObjectInit(&SD2, NULL, notify2);
CLK->PCKENR1 |= CLK_PCKENR1_UART2; /* PCKEN13, clock source. */
UART2->CR1 = UART2_CR1_UARTD; /* UARTD (low power). */
#endif
-#if USE_STM8_UART3
+#if STM8_SERIAL_USE_UART3
sdObjectInit(&SD3, NULL, notify3);
CLK->PCKENR1 |= CLK_PCKENR1_UART3; /* PCKEN13, clock source. */
UART3->CR1 = UART3_CR1_UARTD; /* UARTD (low power). */
@@ -390,19 +390,19 @@ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) { if (config == NULL)
config = &default_config;
-#if USE_STM8_UART1
+#if STM8_SERIAL_USE_UART1
if (&SD1 == sdp) {
uart1_init(config);
return;
}
#endif
-#if USE_STM8_UART2
+#if STM8_SERIAL_USE_UART2
if (&SD2 == sdp) {
uart2_init(config);
return;
}
#endif
-#if USE_STM8_UART3
+#if STM8_SERIAL_USE_UART3
if (&SD3 == sdp) {
uart3_init(config);
return;
@@ -421,19 +421,19 @@ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) { */
void sd_lld_stop(SerialDriver *sdp) {
-#if USE_STM8_UART1
+#if STM8_SERIAL_USE_UART1
if (&SD1 == sdp) {
uart1_deinit();
return;
}
#endif
-#if USE_STM8_UART2
+#if STM8_SERIAL_USE_UART2
if (&SD2 == sdp) {
uart2_deinit();
return;
}
#endif
-#if USE_STM8_UART3
+#if STM8_SERIAL_USE_UART3
if (&SD3 == sdp) {
uart3_deinit();
return;
diff --git a/os/hal/platforms/STM8/serial_lld.h b/os/hal/platforms/STM8/serial_lld.h index ee7848870..fc1e03c54 100644 --- a/os/hal/platforms/STM8/serial_lld.h +++ b/os/hal/platforms/STM8/serial_lld.h @@ -53,8 +53,8 @@ * @details If set to @p TRUE the support for UART1 is included.
* @note The default is @p TRUE.
*/
-#if !defined(USE_STM8_UART1) || defined(__DOXYGEN__)
-#define USE_STM8_UART1 TRUE
+#if !defined(STM8_SERIAL_USE_UART1) || defined(__DOXYGEN__)
+#define STM8_SERIAL_USE_UART1 TRUE
#endif
/**
@@ -62,8 +62,8 @@ * @details If set to @p TRUE the support for UART3 is included.
* @note The default is @p TRUE.
*/
-#if !defined(USE_STM8_UART2) || defined(__DOXYGEN__)
-#define USE_STM8_UART2 TRUE
+#if !defined(STM8_SERIAL_USE_UART2) || defined(__DOXYGEN__)
+#define STM8_SERIAL_USE_UART2 TRUE
#endif
/**
@@ -71,15 +71,15 @@ * @details If set to @p TRUE the support for UART3 is included.
* @note The default is @p TRUE.
*/
-#if !defined(USE_STM8_UART3) || defined(__DOXYGEN__)
-#define USE_STM8_UART3 TRUE
+#if !defined(STM8_SERIAL_USE_UART3) || defined(__DOXYGEN__)
+#define STM8_SERIAL_USE_UART3 TRUE
#endif
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
-#if USE_STM8_UART2 && USE_STM8_UART3
+#if STM8_SERIAL_USE_UART2 && STM8_SERIAL_USE_UART3
#error "STM8 UART2 and UART3 cannot be used together"
#endif
@@ -146,13 +146,13 @@ typedef struct { /* External declarations. */
/*===========================================================================*/
-#if USE_STM8_UART1 && !defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART1 && !defined(__DOXYGEN__)
extern SerialDriver SD1;
#endif
-#if USE_STM8_UART2 && !defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART2 && !defined(__DOXYGEN__)
extern SerialDriver SD2;
#endif
-#if USE_STM8_UART3 && !defined(__DOXYGEN__)
+#if STM8_SERIAL_USE_UART3 && !defined(__DOXYGEN__)
extern SerialDriver SD3;
#endif
diff --git a/os/hal/platforms/STM8/spi_lld.c b/os/hal/platforms/STM8/spi_lld.c index 37b66fc28..9f7c057a3 100644 --- a/os/hal/platforms/STM8/spi_lld.c +++ b/os/hal/platforms/STM8/spi_lld.c @@ -64,7 +64,7 @@ CH_IRQ_HANDLER(10) { if ((SPI->SR & SPI_SR_OVR) != 0) {
/* The overflow condition should never happen because priority is given
to receive but a hook macro is provided anyway...*/
- STM8_SPI_SPI_ERROR_HOOK(&SPID1);
+ STM8_SPI_ERROR_HOOK(&SPID1);
}
/* Handling the DR register like it is a FIFO with depth>1 in order to
handle the case where a frame arrives immediately after reading the
diff --git a/os/hal/platforms/STM8/spi_lld.h b/os/hal/platforms/STM8/spi_lld.h index a66f83ad7..f84f4a9a0 100644 --- a/os/hal/platforms/STM8/spi_lld.h +++ b/os/hal/platforms/STM8/spi_lld.h @@ -52,7 +52,7 @@ * @details The default action is to stop the system.
*/
#if !defined(STM8_SPI_SPI_ERROR_HOOK) || defined(__DOXYGEN__)
-#define STM8_SPI_SPI_ERROR_HOOK(spip) chSysHalt()
+#define STM8_SPI_ERROR_HOOK(spip) chSysHalt()
#endif
/*===========================================================================*/
|