Convert to using bool.

This commit is contained in:
Ralf Corsepius
2008-09-02 12:26:55 +00:00
parent 5c753ea66c
commit 326cc87faf
3 changed files with 22 additions and 22 deletions

View File

@@ -80,7 +80,7 @@ extern rtems_device_driver sh_sci_control(
); );
extern const rtems_termios_callbacks * sh_sci_get_termios_handlers( extern const rtems_termios_callbacks * sh_sci_get_termios_handlers(
rtems_boolean poll bool poll
); );

View File

@@ -150,10 +150,10 @@ static int _sci_set_cflags(
* local functions operate SCI ports 0 and 1 * local functions operate SCI ports 0 and 1
* called from polling routines or ISRs * called from polling routines or ISRs
*/ */
rtems_boolean wrtSCI0(unsigned char ch) bool wrtSCI0(unsigned char ch)
{ {
uint8_t temp; uint8_t temp;
rtems_boolean result=FALSE; bool result = false;
if ((read8(SCI_SSR0) & SCI_TDRE) != 0x00) { if ((read8(SCI_SSR0) & SCI_TDRE) != 0x00) {
/* Write the character to the TDR */ /* Write the character to the TDR */
@@ -161,15 +161,15 @@ rtems_boolean wrtSCI0(unsigned char ch)
/* Clear the TDRE bit */ /* Clear the TDRE bit */
temp = read8(SCI_SSR0) & ~SCI_TDRE; temp = read8(SCI_SSR0) & ~SCI_TDRE;
write8(temp, SCI_SSR0); write8(temp, SCI_SSR0);
result = TRUE; result = true;
} }
return result; return result;
} /* wrtSCI0 */ } /* wrtSCI0 */
rtems_boolean wrtSCI1(unsigned char ch) bool wrtSCI1(unsigned char ch)
{ {
uint8_t temp; uint8_t temp;
rtems_boolean result=FALSE; bool result = false;
if ((read8(SCI_SSR1) & SCI_TDRE) != 0x00) { if ((read8(SCI_SSR1) & SCI_TDRE) != 0x00) {
/* Write the character to the TDR */ /* Write the character to the TDR */
@@ -177,7 +177,7 @@ rtems_boolean wrtSCI1(unsigned char ch)
/* Clear the TDRE bit */ /* Clear the TDRE bit */
temp = read8(SCI_SSR1) & ~SCI_TDRE; temp = read8(SCI_SSR1) & ~SCI_TDRE;
write8(temp, SCI_SSR1); write8(temp, SCI_SSR1);
result = TRUE; result = true;
} }
return result; return result;
} /* wrtSCI1 */ } /* wrtSCI1 */
@@ -188,9 +188,9 @@ void sh_sci_outbyte_polled(
char ch ) char ch )
{ {
if (minor == 0) /* blocks until port ready */ if (minor == 0) /* blocks until port ready */
while (wrtSCI0(ch) != TRUE); /* SCI0*/ while (wrtSCI0(ch) != true); /* SCI0*/
else else
while (wrtSCI1(ch) != TRUE); /* SCI1*/ while (wrtSCI1(ch) != true); /* SCI1*/
} /* sh_sci_outbyte_polled */ } /* sh_sci_outbyte_polled */
/* /*
@@ -203,10 +203,10 @@ void outbyte(
sh_sci_outbyte_polled(minor, (unsigned char)ch); sh_sci_outbyte_polled(minor, (unsigned char)ch);
} /* outbyte */ } /* outbyte */
rtems_boolean rdSCI0(unsigned char *ch) bool rdSCI0(unsigned char *ch)
{ {
uint8_t temp; uint8_t temp;
rtems_boolean result=FALSE; bool result = false;
if ((read8(SCI_SSR0) & SCI_RDRF) != 0x00) { if ((read8(SCI_SSR0) & SCI_RDRF) != 0x00) {
/* read input */ /* read input */
@@ -222,15 +222,15 @@ rtems_boolean rdSCI0(unsigned char *ch)
temp &= ~(SCI_ORER | SCI_FER | SCI_PER); temp &= ~(SCI_ORER | SCI_FER | SCI_PER);
write8(temp, SCI_SSR0); write8(temp, SCI_SSR0);
} }
result = TRUE; result = true;
} }
return result; return result;
} /* rdSCI0 */ } /* rdSCI0 */
rtems_boolean rdSCI1(unsigned char *ch) bool rdSCI1(unsigned char *ch)
{ {
uint8_t temp; uint8_t temp;
rtems_boolean result=FALSE; bool result = false;
if ((read8(SCI_SSR1) & SCI_RDRF) != 0x00) { if ((read8(SCI_SSR1) & SCI_RDRF) != 0x00) {
/* read input */ /* read input */
@@ -246,7 +246,7 @@ rtems_boolean rdSCI1(unsigned char *ch)
temp &= ~(SCI_ORER | SCI_FER | SCI_PER); temp &= ~(SCI_ORER | SCI_FER | SCI_PER);
write8(temp, SCI_SSR1); write8(temp, SCI_SSR1);
} }
result = TRUE; result = true;
} }
return result; return result;
} /* rdSCI1 */ } /* rdSCI1 */
@@ -258,9 +258,9 @@ char sh_sci_inbyte_polled( rtems_device_minor_number minor )
uint8_t ch = 0; uint8_t ch = 0;
if (minor == 0) /* blocks until char.ready */ if (minor == 0) /* blocks until char.ready */
while (rdSCI0(&ch) != TRUE); /* SCI0 */ while (rdSCI0(&ch) != true); /* SCI0 */
else else
while (rdSCI1(&ch) != TRUE); /* SCI1 */ while (rdSCI1(&ch) != true); /* SCI1 */
return ch; return ch;
} /* sh_sci_inbyte_polled */ } /* sh_sci_inbyte_polled */
@@ -573,7 +573,7 @@ const rtems_termios_callbacks sci_poll_callbacks = {
/* FIXME: not yet supported */ /* FIXME: not yet supported */
const rtems_termios_callbacks sci_interrupt_callbacks; const rtems_termios_callbacks sci_interrupt_callbacks;
const rtems_termios_callbacks* sh_sci_get_termios_handlers( rtems_boolean poll ) const rtems_termios_callbacks* sh_sci_get_termios_handlers( bool poll )
{ {
return poll ? return poll ?
&sci_poll_callbacks : &sci_poll_callbacks :

View File

@@ -76,15 +76,15 @@ typedef struct sh4uart {
0 if polled I/O */ 0 if polled I/O */
void *tty; /* termios channel descriptor */ void *tty; /* termios channel descriptor */
volatile const char *tx_buf; /* Transmit buffer from termios */ volatile const char *tx_buf; /* Transmit buffer from termios */
volatile uint32_t tx_buf_len; /* Transmit buffer length */ volatile uint32_t tx_buf_len; /* Transmit buffer length */
volatile uint32_t tx_ptr; /* Index of next char to transmit*/ volatile uint32_t tx_ptr; /* Index of next char to transmit*/
rtems_isr_entry old_handler_transmit; /* Saved interrupt handlers */ rtems_isr_entry old_handler_transmit; /* Saved interrupt handlers */
rtems_isr_entry old_handler_receive; rtems_isr_entry old_handler_receive;
tcflag_t c_iflag; /* termios input mode flags */ tcflag_t c_iflag; /* termios input mode flags */
rtems_boolean parerr_mark_flag; /* Parity error processing state */ bool parerr_mark_flag; /* Parity error processing state */
} sh4uart; } sh4uart;
/* /*