diff options
| -rw-r--r-- | converter/terminal_bluefruit/Makefile | 16 | ||||
| -rw-r--r-- | converter/terminal_usb/Makefile | 15 | ||||
| -rw-r--r-- | protocol/bluefruit/bluefruit.c | 4 | ||||
| -rw-r--r-- | protocol/bluefruit/main.c | 2 | ||||
| -rw-r--r-- | protocol/pjrc/main.c | 3 | ||||
| -rw-r--r-- | protocol/pjrc/usb_keyboard.c | 2 |
6 files changed, 7 insertions, 35 deletions
diff --git a/converter/terminal_bluefruit/Makefile b/converter/terminal_bluefruit/Makefile index 83d68fc25..28b7397ba 100644 --- a/converter/terminal_bluefruit/Makefile +++ b/converter/terminal_bluefruit/Makefile | |||
| @@ -83,21 +83,6 @@ COMMAND_ENABLE = yes # Commands for debug and configuration | |||
| 83 | PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin | 83 | PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin |
| 84 | #PS2_USE_BUSYWAIT = yes # uses primitive reference code | 84 | #PS2_USE_BUSYWAIT = yes # uses primitive reference code |
| 85 | 85 | ||
| 86 | ifdef PS2_USE_USART | ||
| 87 | SRC += protocol/ps2_usart.c | ||
| 88 | OPT_DEFS += -DPS2_USE_USART | ||
| 89 | endif | ||
| 90 | |||
| 91 | ifdef PS2_USE_INT | ||
| 92 | SRC += protocol/ps2.c | ||
| 93 | OPT_DEFS += -DPS2_USE_INT | ||
| 94 | endif | ||
| 95 | |||
| 96 | ifdef PS2_USE_BUSYWAIT | ||
| 97 | SRC += protocol/ps2.c | ||
| 98 | OPT_DEFS += -DPS2_USE_BUSYWAIT | ||
| 99 | endif | ||
| 100 | |||
| 101 | #---------------- Programming Options -------------------------- | 86 | #---------------- Programming Options -------------------------- |
| 102 | PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex | 87 | PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex |
| 103 | 88 | ||
| @@ -107,6 +92,7 @@ VPATH += $(TARGET_DIR) | |||
| 107 | VPATH += $(TOP_DIR) | 92 | VPATH += $(TOP_DIR) |
| 108 | 93 | ||
| 109 | 94 | ||
| 95 | include $(TOP_DIR)/protocol.mk | ||
| 110 | include $(TOP_DIR)/protocol/bluefruit.mk | 96 | include $(TOP_DIR)/protocol/bluefruit.mk |
| 111 | include $(TOP_DIR)/protocol.mk | 97 | include $(TOP_DIR)/protocol.mk |
| 112 | include $(TOP_DIR)/common.mk | 98 | include $(TOP_DIR)/common.mk |
diff --git a/converter/terminal_usb/Makefile b/converter/terminal_usb/Makefile index 6154d8682..16df638b9 100644 --- a/converter/terminal_usb/Makefile +++ b/converter/terminal_usb/Makefile | |||
| @@ -82,21 +82,6 @@ PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomen | |||
| 82 | #PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin | 82 | #PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin |
| 83 | #PS2_USE_BUSYWAIT = yes # uses primitive reference code | 83 | #PS2_USE_BUSYWAIT = yes # uses primitive reference code |
| 84 | 84 | ||
| 85 | ifdef PS2_USE_USART | ||
| 86 | SRC += protocol/ps2_usart.c | ||
| 87 | OPT_DEFS += -DPS2_USE_USART | ||
| 88 | endif | ||
| 89 | |||
| 90 | ifdef PS2_USE_INT | ||
| 91 | SRC += protocol/ps2.c | ||
| 92 | OPT_DEFS += -DPS2_USE_INT | ||
| 93 | endif | ||
| 94 | |||
| 95 | ifdef PS2_USE_BUSYWAIT | ||
| 96 | SRC += protocol/ps2.c | ||
| 97 | OPT_DEFS += -DPS2_USE_BUSYWAIT | ||
| 98 | endif | ||
| 99 | |||
| 100 | 85 | ||
| 101 | #---------------- Programming Options -------------------------- | 86 | #---------------- Programming Options -------------------------- |
| 102 | PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex | 87 | PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex |
diff --git a/protocol/bluefruit/bluefruit.c b/protocol/bluefruit/bluefruit.c index f991e4d04..cf26b83df 100644 --- a/protocol/bluefruit/bluefruit.c +++ b/protocol/bluefruit/bluefruit.c | |||
| @@ -36,7 +36,7 @@ static void bluefruit_serial_send(uint8_t); | |||
| 36 | void bluefruit_keyboard_print_report(report_keyboard_t *report) | 36 | void bluefruit_keyboard_print_report(report_keyboard_t *report) |
| 37 | { | 37 | { |
| 38 | if (!debug_keyboard) return; | 38 | if (!debug_keyboard) return; |
| 39 | dprintf("keys: "); for (int i = 0; i < REPORT_KEYS; i++) { debug_hex8(report->keys[i]); dprintf(" "); } | 39 | dprintf("keys: "); for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) { debug_hex8(report->keys[i]); dprintf(" "); } |
| 40 | dprintf(" mods: "); debug_hex8(report->mods); | 40 | dprintf(" mods: "); debug_hex8(report->mods); |
| 41 | dprintf(" reserved: "); debug_hex8(report->reserved); | 41 | dprintf(" reserved: "); debug_hex8(report->reserved); |
| 42 | dprintf("\n"); | 42 | dprintf("\n"); |
| @@ -99,7 +99,7 @@ static void send_keyboard(report_keyboard_t *report) | |||
| 99 | bluefruit_trace_header(); | 99 | bluefruit_trace_header(); |
| 100 | #endif | 100 | #endif |
| 101 | bluefruit_serial_send(0xFD); | 101 | bluefruit_serial_send(0xFD); |
| 102 | for (uint8_t i = 0; i < REPORT_SIZE; i++) { | 102 | for (uint8_t i = 0; i < KEYBOARD_REPORT_SIZE; i++) { |
| 103 | bluefruit_serial_send(report->raw[i]); | 103 | bluefruit_serial_send(report->raw[i]); |
| 104 | } | 104 | } |
| 105 | #ifdef BLUEFRUIT_TRACE_SERIAL | 105 | #ifdef BLUEFRUIT_TRACE_SERIAL |
diff --git a/protocol/bluefruit/main.c b/protocol/bluefruit/main.c index 871062ab1..094fdb366 100644 --- a/protocol/bluefruit/main.c +++ b/protocol/bluefruit/main.c | |||
| @@ -104,7 +104,7 @@ int main(void) | |||
| 104 | dprintf("Starting main loop"); | 104 | dprintf("Starting main loop"); |
| 105 | while (1) { | 105 | while (1) { |
| 106 | while (suspend) { | 106 | while (suspend) { |
| 107 | suspend_power_down(); | 107 | suspend_power_down(WDTO_120MS); |
| 108 | if (remote_wakeup && suspend_wakeup_condition()) { | 108 | if (remote_wakeup && suspend_wakeup_condition()) { |
| 109 | usb_remote_wakeup(); | 109 | usb_remote_wakeup(); |
| 110 | } | 110 | } |
diff --git a/protocol/pjrc/main.c b/protocol/pjrc/main.c index 1ef87f865..4f87a1736 100644 --- a/protocol/pjrc/main.c +++ b/protocol/pjrc/main.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
| 25 | #include <avr/io.h> | 25 | #include <avr/io.h> |
| 26 | #include <avr/interrupt.h> | 26 | #include <avr/interrupt.h> |
| 27 | #include <avr/wdt.h> | ||
| 27 | #include <util/delay.h> | 28 | #include <util/delay.h> |
| 28 | #include "keyboard.h" | 29 | #include "keyboard.h" |
| 29 | #include "usb.h" | 30 | #include "usb.h" |
| @@ -60,7 +61,7 @@ int main(void) | |||
| 60 | #endif | 61 | #endif |
| 61 | while (1) { | 62 | while (1) { |
| 62 | while (suspend) { | 63 | while (suspend) { |
| 63 | suspend_power_down(); | 64 | suspend_power_down(WDTO_120MS); |
| 64 | if (remote_wakeup && suspend_wakeup_condition()) { | 65 | if (remote_wakeup && suspend_wakeup_condition()) { |
| 65 | usb_remote_wakeup(); | 66 | usb_remote_wakeup(); |
| 66 | } | 67 | } |
diff --git a/protocol/pjrc/usb_keyboard.c b/protocol/pjrc/usb_keyboard.c index 758a4edc6..4b87b5d7b 100644 --- a/protocol/pjrc/usb_keyboard.c +++ b/protocol/pjrc/usb_keyboard.c | |||
| @@ -74,7 +74,7 @@ void usb_keyboard_print_report(report_keyboard_t *report) | |||
| 74 | { | 74 | { |
| 75 | if (!debug_keyboard) return; | 75 | if (!debug_keyboard) return; |
| 76 | print("keys: "); | 76 | print("keys: "); |
| 77 | for (int i = 0; i < REPORT_KEYS; i++) { phex(report->keys[i]); print(" "); } | 77 | for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) { phex(report->keys[i]); print(" "); } |
| 78 | print(" mods: "); phex(report->mods); print("\n"); | 78 | print(" mods: "); phex(report->mods); print("\n"); |
| 79 | } | 79 | } |
| 80 | 80 | ||
