diff options
Diffstat (limited to 'keyboards/mitosis')
| -rw-r--r-- | keyboards/mitosis/config.h | 18 | ||||
| -rw-r--r-- | keyboards/mitosis/matrix.c | 4 | ||||
| -rw-r--r-- | keyboards/mitosis/mitosis.c | 5 | ||||
| -rw-r--r-- | keyboards/mitosis/rules.mk | 11 |
4 files changed, 8 insertions, 30 deletions
diff --git a/keyboards/mitosis/config.h b/keyboards/mitosis/config.h index b4499d0d6..0e089269e 100644 --- a/keyboards/mitosis/config.h +++ b/keyboards/mitosis/config.h | |||
| @@ -60,19 +60,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 60 | 60 | ||
| 61 | //UART settings for communication with the RF microcontroller | 61 | //UART settings for communication with the RF microcontroller |
| 62 | #define SERIAL_UART_BAUD 1000000 | 62 | #define SERIAL_UART_BAUD 1000000 |
| 63 | #define SERIAL_UART_DATA UDR1 | ||
| 64 | #define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) | ||
| 65 | #define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) | ||
| 66 | #define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) | 63 | #define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) |
| 67 | #define SERIAL_UART_INIT() do { \ | 64 | #define SERIAL_UART_INIT_CUSTOM \ |
| 68 | /* baud rate */ \ | 65 | /* enable TX and RX */ \ |
| 69 | UBRR1L = SERIAL_UART_UBRR; \ | 66 | UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ |
| 70 | /* baud rate */ \ | 67 | /* 8-bit data */ \ |
| 71 | UBRR1H = SERIAL_UART_UBRR >> 8; \ | 68 | UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); |
| 72 | /* enable TX and RX */ \ | ||
| 73 | UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ | ||
| 74 | /* 8-bit data */ \ | ||
| 75 | UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ | ||
| 76 | } while(0) | ||
| 77 | 69 | ||
| 78 | #endif | 70 | #endif |
diff --git a/keyboards/mitosis/matrix.c b/keyboards/mitosis/matrix.c index e149b68bd..717a81067 100644 --- a/keyboards/mitosis/matrix.c +++ b/keyboards/mitosis/matrix.c | |||
| @@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 26 | #include "util.h" | 26 | #include "util.h" |
| 27 | #include "matrix.h" | 27 | #include "matrix.h" |
| 28 | #include "timer.h" | 28 | #include "timer.h" |
| 29 | #include "protocol/serial.h" | ||
| 29 | 30 | ||
| 30 | #if (MATRIX_COLS <= 8) | 31 | #if (MATRIX_COLS <= 8) |
| 31 | # define print_matrix_header() print("\nr/c 01234567\n") | 32 | # define print_matrix_header() print("\nr/c 01234567\n") |
| @@ -79,12 +80,11 @@ uint8_t matrix_cols(void) { | |||
| 79 | void matrix_init(void) { | 80 | void matrix_init(void) { |
| 80 | 81 | ||
| 81 | matrix_init_quantum(); | 82 | matrix_init_quantum(); |
| 83 | serial_init(); | ||
| 82 | } | 84 | } |
| 83 | 85 | ||
| 84 | uint8_t matrix_scan(void) | 86 | uint8_t matrix_scan(void) |
| 85 | { | 87 | { |
| 86 | SERIAL_UART_INIT(); | ||
| 87 | |||
| 88 | uint32_t timeout = 0; | 88 | uint32_t timeout = 0; |
| 89 | 89 | ||
| 90 | //the s character requests the RF slave to send the matrix | 90 | //the s character requests the RF slave to send the matrix |
diff --git a/keyboards/mitosis/mitosis.c b/keyboards/mitosis/mitosis.c index 1ca7276e4..50b6d8452 100644 --- a/keyboards/mitosis/mitosis.c +++ b/keyboards/mitosis/mitosis.c | |||
| @@ -1,9 +1,5 @@ | |||
| 1 | #include "mitosis.h" | 1 | #include "mitosis.h" |
| 2 | 2 | ||
| 3 | void uart_init(void) { | ||
| 4 | SERIAL_UART_INIT(); | ||
| 5 | } | ||
| 6 | |||
| 7 | void led_init(void) { | 3 | void led_init(void) { |
| 8 | DDRD |= (1<<1); // Pin to green, set as output | 4 | DDRD |= (1<<1); // Pin to green, set as output |
| 9 | PORTD |= (1<<1); // Turn it off | 5 | PORTD |= (1<<1); // Turn it off |
| @@ -15,7 +11,6 @@ void matrix_init_kb(void) { | |||
| 15 | // put your keyboard start-up code here | 11 | // put your keyboard start-up code here |
| 16 | // runs once when the firmware starts up | 12 | // runs once when the firmware starts up |
| 17 | matrix_init_user(); | 13 | matrix_init_user(); |
| 18 | uart_init(); | ||
| 19 | led_init(); | 14 | led_init(); |
| 20 | } | 15 | } |
| 21 | 16 | ||
diff --git a/keyboards/mitosis/rules.mk b/keyboards/mitosis/rules.mk index 466987e8c..4cb6d8c9b 100644 --- a/keyboards/mitosis/rules.mk +++ b/keyboards/mitosis/rules.mk | |||
| @@ -28,14 +28,5 @@ NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA | |||
| 28 | UNICODE_ENABLE = yes # Unicode | 28 | UNICODE_ENABLE = yes # Unicode |
| 29 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID | 29 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID |
| 30 | 30 | ||
| 31 | USB = /dev/ttyACM0 | ||
| 32 | |||
| 33 | # upload: build | ||
| 34 | # $(MITOSIS_UPLOAD_COMMAND) | ||
| 35 | |||
| 36 | OPT_DEFS += -DMITOSIS_PROMICRO | ||
| 37 | MITOSIS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ | ||
| 38 | avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) | ||
| 39 | |||
| 40 | # # project specific files | 31 | # # project specific files |
| 41 | SRC = matrix.c | 32 | SRC += matrix.c serial_uart.c |
