diff options
Diffstat (limited to 'tmk_core/protocol/bluefruit/main.c')
-rw-r--r-- | tmk_core/protocol/bluefruit/main.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/tmk_core/protocol/bluefruit/main.c b/tmk_core/protocol/bluefruit/main.c deleted file mode 100644 index aca46206d..000000000 --- a/tmk_core/protocol/bluefruit/main.c +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* | ||
2 | Bluefruit Protocol for TMK firmware | ||
3 | Author: Benjamin Gould, 2013 | ||
4 | Based on code Copyright 2011 Jun Wako <wakojun@gmail.com> | ||
5 | |||
6 | This program is free software: you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License as published by | ||
8 | the Free Software Foundation, either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #include <stdint.h> | ||
21 | #include <avr/interrupt.h> | ||
22 | #include <avr/wdt.h> | ||
23 | #include <avr/sleep.h> | ||
24 | #include <util/delay.h> | ||
25 | #include "../serial.h" | ||
26 | #include "keyboard.h" | ||
27 | #include "host.h" | ||
28 | #include "timer.h" | ||
29 | #include "print.h" | ||
30 | #include "debug.h" | ||
31 | #include "sendchar.h" | ||
32 | #include "suspend.h" | ||
33 | #include "bluefruit.h" | ||
34 | |||
35 | #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) | ||
36 | |||
37 | int main(void) { | ||
38 | CPU_PRESCALE(0); | ||
39 | |||
40 | // DDRD = _BV(PD5); | ||
41 | // DDRB = _BV(PB0); | ||
42 | |||
43 | // PORTD = _BV(PD5); | ||
44 | // PORTB = _BV(PB0); | ||
45 | |||
46 | print_set_sendchar(sendchar); | ||
47 | |||
48 | keyboard_setup(); | ||
49 | |||
50 | dprintf("Initializing keyboard...\n"); | ||
51 | keyboard_init(); | ||
52 | |||
53 | dprintf("Setting host driver to bluefruit...\n"); | ||
54 | host_set_driver(bluefruit_driver()); | ||
55 | |||
56 | dprintf("Initializing serial...\n"); | ||
57 | serial_init(); | ||
58 | |||
59 | // char swpa[] = "+++\r\n"; | ||
60 | // for (int i = 0; i < 5; i++) { | ||
61 | // serial_send(swpa[i]); | ||
62 | // } | ||
63 | |||
64 | // char ble_enable[] = "AT+BLEKEYBOARDEN=1\r\n"; | ||
65 | // for (int i = 0; i < 20; i++) { | ||
66 | // serial_send(ble_enable[i]); | ||
67 | // } | ||
68 | |||
69 | // char reset[] = "ATZ\r\n"; | ||
70 | // for (int i = 0; i < 5; i++) { | ||
71 | // serial_send(reset[i]); | ||
72 | // } | ||
73 | |||
74 | // for (int i = 0; i < 5; i++) { | ||
75 | // serial_send(swpa[i]); | ||
76 | // } | ||
77 | |||
78 | // wait an extra second for the PC's operating system | ||
79 | // to load drivers and do whatever it does to actually | ||
80 | // be ready for input | ||
81 | _delay_ms(1000); | ||
82 | // PORTD = ~_BV(PD5); | ||
83 | dprintf("Starting main loop"); | ||
84 | while (1) { | ||
85 | keyboard_task(); | ||
86 | } | ||
87 | } | ||