aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol/bluefruit/main.c
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2020-02-06 11:30:45 +1100
committerskullydazed <skullydazed@users.noreply.github.com>2020-02-08 11:07:43 -0800
commit174a15d07d7321e762e51584e985bb73fe01e99b (patch)
treee82a473ffb704cf806c64fd45453a6d5d6eba4f6 /tmk_core/protocol/bluefruit/main.c
parent5ab0eeb513f50a14e51467bf76a19997b75d65fb (diff)
downloadqmk_firmware-174a15d07d7321e762e51584e985bb73fe01e99b.tar.gz
qmk_firmware-174a15d07d7321e762e51584e985bb73fe01e99b.zip
Remove PJRC USB stack
Diffstat (limited to 'tmk_core/protocol/bluefruit/main.c')
-rw-r--r--tmk_core/protocol/bluefruit/main.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/tmk_core/protocol/bluefruit/main.c b/tmk_core/protocol/bluefruit/main.c
index 3adcab4f4..aca46206d 100644
--- a/tmk_core/protocol/bluefruit/main.c
+++ b/tmk_core/protocol/bluefruit/main.c
@@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24#include <util/delay.h> 24#include <util/delay.h>
25#include "../serial.h" 25#include "../serial.h"
26#include "keyboard.h" 26#include "keyboard.h"
27#include "usb.h"
28#include "host.h" 27#include "host.h"
29#include "timer.h" 28#include "timer.h"
30#include "print.h" 29#include "print.h"
@@ -32,14 +31,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
32#include "sendchar.h" 31#include "sendchar.h"
33#include "suspend.h" 32#include "suspend.h"
34#include "bluefruit.h" 33#include "bluefruit.h"
35#include "pjrc.h"
36 34
37#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) 35#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
38 36
39#define HOST_DRIVER_NOT_SET 0
40#define BLUEFRUIT_HOST_DRIVER 1
41#define PJRC_HOST_DRIVER 2
42
43int main(void) { 37int main(void) {
44 CPU_PRESCALE(0); 38 CPU_PRESCALE(0);
45 39
@@ -51,27 +45,11 @@ int main(void) {
51 45
52 print_set_sendchar(sendchar); 46 print_set_sendchar(sendchar);
53 47
54 // usb_init();
55 // _delay_ms(2000);
56 // while (!usb_configured()) /* wait */
57
58 keyboard_setup(); 48 keyboard_setup();
59 49
60 dprintf("Initializing keyboard...\n"); 50 dprintf("Initializing keyboard...\n");
61 keyboard_init(); 51 keyboard_init();
62 52
63 // This implementation is pretty simplistic... if the USB connection
64 // is not configured, choose the Bluefruit, otherwise use USB
65 // Definitely would prefer to have this driven by an input pin and make
66 // it switch dynamically - BCG
67 // if (!usb_configured()) {
68
69 // // Send power to Bluefruit... Adafruit says it takes 27 mA, I think
70 // // the pins should provide 40 mA, but just in case I switch the
71 // // Bluefruit using a transistor - BCG
72 // DDRB = _BV(PB6);
73 // PORTB |= _BV(PB6);
74
75 dprintf("Setting host driver to bluefruit...\n"); 53 dprintf("Setting host driver to bluefruit...\n");
76 host_set_driver(bluefruit_driver()); 54 host_set_driver(bluefruit_driver());
77 55
@@ -106,29 +84,4 @@ int main(void) {
106 while (1) { 84 while (1) {
107 keyboard_task(); 85 keyboard_task();
108 } 86 }
109
110 // } else {
111
112 // // I'm not smart enough to get this done with LUFA - BCG
113 // dprintf("Setting host driver to PJRC...\n");
114 // host_set_driver(pjrc_driver());
115 // #ifdef SLEEP_LED_ENABLE
116 // sleep_led_init();
117 // #endif
118 // // wait an extra second for the PC's operating system
119 // // to load drivers and do whatever it does to actually
120 // // be ready for input
121 // _delay_ms(1000);
122 // PORTB = ~_BV(PB0);
123 // dprintf("Starting main loop");
124 // while (1) {
125 // while (suspend) {
126 // suspend_power_down();
127 // if (remote_wakeup && suspend_wakeup_condition()) {
128 // usb_remote_wakeup();
129 // }
130 // }
131 // keyboard_task();
132 // }
133 // }
134} 87}