diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2018-01-23 08:23:46 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2018-01-23 08:23:46 -0500 |
commit | bf230d6a745e61d72cd364bc6f0bea282671b634 (patch) | |
tree | 5aa04d7efa663a25c0ba7fe97d464de8feb05569 /src/serial.c | |
parent | a93e506b78b7379e14c23ae80a5281485897faee (diff) |
interpreter integration
Diffstat (limited to 'src/serial.c')
-rw-r--r-- | src/serial.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/serial.c b/src/serial.c index 692faf0..32fcb95 100644 --- a/src/serial.c +++ b/src/serial.c @@ -25,3 +25,15 @@ char serial_get(void) while (!(USART2->ISR & USART_ISR_RXNE)); return USART2->RDR & 0xFF; } + +void serial_gets(char *buf) +{ + uint16_t index = 0; + + do { + buf[index] = serial_get(); + } while (buf[index++] != '\r'); + + buf[index - 1] = '\0'; + //return buf; +} |