Add transmitString function to USART library

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
This commit is contained in:
Collin J. Doering 2015-10-08 03:15:00 -04:00
parent 3d3b9ab5fb
commit 8ab9c5a4b0
2 changed files with 9 additions and 0 deletions

View File

@ -49,6 +49,13 @@ void transmitByte(uint8_t data) {
UDR0 = data; /* send data */
}
void transmitString(const char* data) {
while (*data != '\0') {
transmitByte(*data);
data++;
}
}
uint8_t receiveByte(void) {
loop_until_bit_is_set(UCSR0A, RXC0); /* Wait for incoming data */
return UDR0; /* return register value */

View File

@ -25,4 +25,6 @@ void initUSART(void);
void transmitByte(uint8_t data);
void transmitBytes(uint8_t* data);
uint8_t receiveByte(void);