summaryrefslogtreecommitdiffstats
path: root/door_lock/serial.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-04-29 17:04:38 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-04-29 17:04:38 +0800
commita9ce750c420813b1e7dab5eb4e0340d107a34b20 (patch)
treeb0bab3f5247b3c3cf9cfb2e72dcc4da993c0772a /door_lock/serial.c
parent775d4a84f36d4d5d0700e9c44dfa4114a0cc022c (diff)
downloadsmart-home-a9ce750c420813b1e7dab5eb4e0340d107a34b20.tar.gz
Delete the old door_lock directory.
Diffstat (limited to 'door_lock/serial.c')
-rw-r--r--door_lock/serial.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/door_lock/serial.c b/door_lock/serial.c
deleted file mode 100644
index 0b9aecf..0000000
--- a/door_lock/serial.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <avr/io.h>
-#include <util/setbaud.h>
-
-#include "serial.h"
-
-void serial_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 void serial_write(unsigned char data)
-{
- while (!(UCSR0A & (1 << UDRE0)))
- ;
- UDR0 = data;
-}
-
-void serial_write_line(const char *s)
-{
- for (; *s; s++)
- serial_write(*s);
-
- serial_write('\r');
- serial_write('\n');
-}