diff options
| author | Ryan <fauxpark@gmail.com> | 2021-02-06 09:20:48 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-06 09:20:48 +1100 |
| commit | 5ea92a9c1cbe3e20bf4830d550d797a8e9650da8 (patch) | |
| tree | 75ea1413ae4fa23bd0b1230629b6a3b3e215c5eb /keyboards/honeycomb | |
| parent | 464eb7137d27e3a31e85032c85c9fda627a8b33f (diff) | |
| download | qmk_firmware-5ea92a9c1cbe3e20bf4830d550d797a8e9650da8.tar.gz qmk_firmware-5ea92a9c1cbe3e20bf4830d550d797a8e9650da8.zip | |
Serial refactor (#11521)
Diffstat (limited to 'keyboards/honeycomb')
| -rwxr-xr-x | keyboards/honeycomb/config.h | 18 | ||||
| -rwxr-xr-x | keyboards/honeycomb/honeycomb.c | 16 | ||||
| -rwxr-xr-x | keyboards/honeycomb/matrix.c | 4 | ||||
| -rwxr-xr-x | keyboards/honeycomb/rules.mk | 7 |
4 files changed, 8 insertions, 37 deletions
diff --git a/keyboards/honeycomb/config.h b/keyboards/honeycomb/config.h index 4991c8a0e..725f9490c 100755 --- a/keyboards/honeycomb/config.h +++ b/keyboards/honeycomb/config.h | |||
| @@ -48,17 +48,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 48 | 48 | ||
| 49 | //UART settings for communication with the RF microcontroller | 49 | //UART settings for communication with the RF microcontroller |
| 50 | #define SERIAL_UART_BAUD 1000000 | 50 | #define SERIAL_UART_BAUD 1000000 |
| 51 | #define SERIAL_UART_DATA UDR1 | ||
| 52 | #define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) | ||
| 53 | #define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) | ||
| 54 | #define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) | 51 | #define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) |
| 55 | #define SERIAL_UART_INIT() do { \ | 52 | #define SERIAL_UART_INIT_CUSTOM \ |
| 56 | /* baud rate */ \ | 53 | /* enable TX and RX */ \ |
| 57 | UBRR1L = SERIAL_UART_UBRR; \ | 54 | UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ |
| 58 | /* baud rate */ \ | 55 | /* 8-bit data */ \ |
| 59 | UBRR1H = SERIAL_UART_UBRR >> 8; \ | 56 | UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); |
| 60 | /* enable TX and RX */ \ | ||
| 61 | UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ | ||
| 62 | /* 8-bit data */ \ | ||
| 63 | UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ | ||
| 64 | } while(0) | ||
diff --git a/keyboards/honeycomb/honeycomb.c b/keyboards/honeycomb/honeycomb.c index add4af153..1254196d3 100755 --- a/keyboards/honeycomb/honeycomb.c +++ b/keyboards/honeycomb/honeycomb.c | |||
| @@ -2,13 +2,8 @@ | |||
| 2 | #include "pointing_device.h" | 2 | #include "pointing_device.h" |
| 3 | #include "report.h" | 3 | #include "report.h" |
| 4 | 4 | ||
| 5 | void uart_init(void) { | ||
| 6 | SERIAL_UART_INIT(); | ||
| 7 | } | ||
| 8 | |||
| 9 | void pointing_device_task(void){ | 5 | void pointing_device_task(void){ |
| 10 | /*report_mouse_t currentReport = {}; | 6 | /*report_mouse_t currentReport = {}; |
| 11 | SERIAL_UART_INIT(); | ||
| 12 | uint32_t timeout = 0; | 7 | uint32_t timeout = 0; |
| 13 | 8 | ||
| 14 | //the m character requests the RF slave to send the mouse report | 9 | //the m character requests the RF slave to send the mouse report |
| @@ -77,16 +72,5 @@ void matrix_init_kb(void) { | |||
| 77 | // put your keyboard start-up code here | 72 | // put your keyboard start-up code here |
| 78 | // runs once when the firmware starts up | 73 | // runs once when the firmware starts up |
| 79 | matrix_init_user(); | 74 | matrix_init_user(); |
| 80 | uart_init(); | ||
| 81 | led_init(); | 75 | led_init(); |
| 82 | } | 76 | } |
| 83 | |||
| 84 | void matrix_scan_kb(void) { | ||
| 85 | // put your looping keyboard code here | ||
| 86 | // runs every cycle (a lot) | ||
| 87 | matrix_scan_user(); | ||
| 88 | } | ||
| 89 | |||
| 90 | void led_set_kb(uint8_t usb_led) { | ||
| 91 | |||
| 92 | } | ||
diff --git a/keyboards/honeycomb/matrix.c b/keyboards/honeycomb/matrix.c index a06afb6d9..2bed69068 100755 --- a/keyboards/honeycomb/matrix.c +++ b/keyboards/honeycomb/matrix.c | |||
| @@ -30,6 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 30 | #include "honeycomb.h" | 30 | #include "honeycomb.h" |
| 31 | #include "pointing_device.h" | 31 | #include "pointing_device.h" |
| 32 | #include "report.h" | 32 | #include "report.h" |
| 33 | #include "protocol/serial.h" | ||
| 33 | 34 | ||
| 34 | #if (MATRIX_COLS <= 8) | 35 | #if (MATRIX_COLS <= 8) |
| 35 | # define print_matrix_header() print("\nr/c 01234567\n") | 36 | # define print_matrix_header() print("\nr/c 01234567\n") |
| @@ -94,12 +95,11 @@ uint8_t matrix_cols(void) { | |||
| 94 | void matrix_init(void) { | 95 | void matrix_init(void) { |
| 95 | 96 | ||
| 96 | matrix_init_quantum(); | 97 | matrix_init_quantum(); |
| 98 | serial_init(); | ||
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | uint8_t matrix_scan(void) | 101 | uint8_t matrix_scan(void) |
| 100 | { | 102 | { |
| 101 | SERIAL_UART_INIT(); | ||
| 102 | |||
| 103 | uint32_t timeout = 0; | 103 | uint32_t timeout = 0; |
| 104 | 104 | ||
| 105 | // The 's' character requests the RF slave to send the matrix | 105 | // The 's' character requests the RF slave to send the matrix |
diff --git a/keyboards/honeycomb/rules.mk b/keyboards/honeycomb/rules.mk index 19852d7ec..d6f98125e 100755 --- a/keyboards/honeycomb/rules.mk +++ b/keyboards/honeycomb/rules.mk | |||
| @@ -30,9 +30,4 @@ UNICODE_ENABLE = YES # Unicode | |||
| 30 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID | 30 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID |
| 31 | 31 | ||
| 32 | # # project specific files | 32 | # # project specific files |
| 33 | SRC += matrix.c | 33 | SRC += matrix.c serial_uart.c |
| 34 | |||
| 35 | USB = /dev/ttyACM0 | ||
| 36 | |||
| 37 | #upload: build | ||
| 38 | # $(honeycomb_UPLOAD_COMMAND) | ||
