git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1643 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2010-02-20 10:52:39 +00:00
parent 5d983fd514
commit ee9a1b480b
2 changed files with 11 additions and 11 deletions

View File

@ -57,7 +57,7 @@ SerialDriver SD2;
*/
static const SerialConfig default_config = {
SERIAL_DEFAULT_BITRATE,
SC_MODE_NORMAL | SC_MODE_PARITY_NONE
SD_MODE_NORMAL | SD_MODE_PARITY_NONE
};
/*===========================================================================*/
@ -78,12 +78,12 @@ static void esci_init(SerialDriver *sdp) {
escip->CR1.R = 0;
escip->LCR.R = 0;
escip->CR1.B.SBR = SPC563_SYSCLK / (16 * sdp->config->sc_speed);
if (mode & SC_MODE_LOOPBACK)
if (mode & SD_MODE_LOOPBACK)
escip->CR1.B.LOOPS = 1;
switch (mode & SC_MODE_PARITY) {
case SC_MODE_PARITY_ODD:
switch (mode & SD_MODE_PARITY) {
case SD_MODE_PARITY_ODD:
escip->CR1.B.PT = 1;
case SC_MODE_PARITY_EVEN:
case SD_MODE_PARITY_EVEN:
escip->CR1.B.PE = 1;
escip->CR1.B.M = 1; /* Makes it 8 bits data + 1 bit parity. */
default:

View File

@ -34,13 +34,13 @@
/* Driver constants. */
/*===========================================================================*/
#define SC_MODE_PARITY 0x03 /**< @brief Parity field mask. */
#define SC_MODE_PARITY_NONE 0x00 /**< @brief No parity. */
#define SC_MODE_PARITY_EVEN 0x01 /**< @brief Even parity. */
#define SC_MODE_PARITY_ODD 0x02 /**< @brief Odd parity. */
#define SD_MODE_PARITY 0x03 /**< @brief Parity field mask. */
#define SD_MODE_PARITY_NONE 0x00 /**< @brief No parity. */
#define SD_MODE_PARITY_EVEN 0x01 /**< @brief Even parity. */
#define SD_MODE_PARITY_ODD 0x02 /**< @brief Odd parity. */
#define SC_MODE_NORMAL 0x00 /**< @brief Normal operations. */
#define SC_MODE_LOOPBACK 0x80 /**< @brief Internal loopback. */
#define SD_MODE_NORMAL 0x00 /**< @brief Normal operations. */
#define SD_MODE_LOOPBACK 0x80 /**< @brief Internal loopback. */
/*===========================================================================*/
/* Driver pre-compile time settings. */