diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-05-24 16:57:41 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-05-24 16:57:41 +0800 |
| commit | aa0fbb84ebb9e706367622d770968bb6ad640667 (patch) | |
| tree | 5843704b9c35bfdedc6f4e7c984be0c6dfa50a65 /lock/uart.c | |
| parent | e62586ef42984a2ff644235cab033c6a09fe8662 (diff) | |
| download | smart-home-aa0fbb84ebb9e706367622d770968bb6ad640667.tar.gz | |
Delete all UART code.
Diffstat (limited to 'lock/uart.c')
| -rw-r--r-- | lock/uart.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/lock/uart.c b/lock/uart.c deleted file mode 100644 index a6d6674..0000000 --- a/lock/uart.c +++ /dev/null @@ -1,37 +0,0 @@ -#include <avr/io.h> -#include <util/setbaud.h> - -#include "uart.h" - -void uart_init(void) -{ - UBRR0H = UBRRH_VALUE; - UBRR0L = UBRRL_VALUE; -#if USE_2X - UCSR0A |= (1 << U2X0); -#else - UCSR0A &= ~(1 << U2X0); -#endif - UCSR0B = (1 << TXEN0) | (1 << RXEN0); - UCSR0C = (1 << UCSZ01) | (1 << UCSZ00); -} - -static inline void uart_write_char(char c) -{ - while (!(UCSR0A & (1 << UDRE0))) - ; - UDR0 = c; -} - -void uart_write(const char *s) -{ - for (; *s; s++) - uart_write_char(*s); -} - -void uart_write_line(const char *s) -{ - uart_write(s); - uart_write_char('\r'); - uart_write_char('\n'); -} |
