Skip to content

Commit 174a15d

Browse files
fauxparkskullydazed
authored andcommitted
Remove PJRC USB stack
1 parent 5ab0eeb commit 174a15d

20 files changed

+5
-1935
lines changed

doxygen-todo

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ tmk_core/protocol/lufa
66
tmk_core/protocol/midi
77
tmk_core/protocol/midi/bytequeue
88
tmk_core/protocol/midi/Config
9-
tmk_core/protocol/pjrc
109
tmk_core/protocol/usb_hid
1110
tmk_core/protocol/vusb
1211
tmk_core/tool

tmk_core/common/command.c

-24
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4343
# include "mousekey.h"
4444
#endif
4545

46-
#ifdef PROTOCOL_PJRC
47-
# include "usb_keyboard.h"
48-
# ifdef EXTRAKEY_ENABLE
49-
# include "usb_extra.h"
50-
# endif
51-
#endif
52-
5346
#ifdef PROTOCOL_VUSB
5447
# include "usbdrv.h"
5548
#endif
@@ -165,9 +158,6 @@ static void print_version(void) {
165158
/* build options */
166159
print("OPTIONS:"
167160

168-
#ifdef PROTOCOL_PJRC
169-
" PJRC"
170-
#endif
171161
#ifdef PROTOCOL_LUFA
172162
" LUFA"
173163
#endif
@@ -217,20 +207,6 @@ static void print_status(void) {
217207
print_val_hex8(keymap_config.nkro);
218208
#endif
219209
print_val_hex32(timer_read32());
220-
221-
#ifdef PROTOCOL_PJRC
222-
print_val_hex8(UDCON);
223-
print_val_hex8(UDIEN);
224-
print_val_hex8(UDINT);
225-
print_val_hex8(usb_keyboard_leds);
226-
print_val_hex8(usb_keyboard_idle_count);
227-
#endif
228-
229-
#ifdef PROTOCOL_PJRC
230-
# if USB_COUNT_SOF
231-
print_val_hex8(usbSofCount);
232-
# endif
233-
#endif
234210
return;
235211
}
236212

tmk_core/protocol/bluefruit.mk

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
11
BLUEFRUIT_DIR = protocol/bluefruit
2-
PJRC_DIR = protocol/pjrc
32

43
SRC += $(BLUEFRUIT_DIR)/main.c \
54
$(BLUEFRUIT_DIR)/bluefruit.c \
6-
serial_uart.c \
7-
$(PJRC_DIR)/pjrc.c \
8-
$(PJRC_DIR)/usb_keyboard.c \
9-
$(PJRC_DIR)/usb_debug.c \
10-
$(PJRC_DIR)/usb.c
11-
12-
# Option modules
13-
ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
14-
SRC += $(PJRC_DIR)/usb_mouse.c
15-
endif
16-
17-
ifdef EXTRAKEY_ENABLE
18-
SRC += $(PJRC_DIR)/usb_extra.c
19-
endif
5+
serial_uart.c
206

217
# Search Path
228
VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)
239
#VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)/usb_debug_only
24-
VPATH += $(TMK_DIR)/$(PJRC_DIR)
2510

2611
OPT_DEFS += -DPROTOCOL_BLUEFRUIT
27-
OPT_DEFS += -DPROTOCOL_PJRC

tmk_core/protocol/bluefruit/main.c

-47
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2424
#include <util/delay.h>
2525
#include "../serial.h"
2626
#include "keyboard.h"
27-
#include "usb.h"
2827
#include "host.h"
2928
#include "timer.h"
3029
#include "print.h"
3130
#include "debug.h"
3231
#include "sendchar.h"
3332
#include "suspend.h"
3433
#include "bluefruit.h"
35-
#include "pjrc.h"
3634

3735
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
3836

39-
#define HOST_DRIVER_NOT_SET 0
40-
#define BLUEFRUIT_HOST_DRIVER 1
41-
#define PJRC_HOST_DRIVER 2
42-
4337
int main(void) {
4438
CPU_PRESCALE(0);
4539

@@ -51,27 +45,11 @@ int main(void) {
5145

5246
print_set_sendchar(sendchar);
5347

54-
// usb_init();
55-
// _delay_ms(2000);
56-
// while (!usb_configured()) /* wait */
57-
5848
keyboard_setup();
5949

6050
dprintf("Initializing keyboard...\n");
6151
keyboard_init();
6252

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-
7553
dprintf("Setting host driver to bluefruit...\n");
7654
host_set_driver(bluefruit_driver());
7755

@@ -106,29 +84,4 @@ int main(void) {
10684
while (1) {
10785
keyboard_task();
10886
}
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-
// }
13487
}

tmk_core/protocol/pjrc.mk

-35
This file was deleted.

tmk_core/protocol/pjrc/MEMO.txt

-25
This file was deleted.

tmk_core/protocol/pjrc/main.c

-72
This file was deleted.

tmk_core/protocol/pjrc/pjrc.c

-58
This file was deleted.

tmk_core/protocol/pjrc/pjrc.h

-25
This file was deleted.

0 commit comments

Comments
 (0)