Skip to content

Commit

Permalink
Remove PJRC USB stack
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and skullydazed committed Feb 8, 2020
1 parent 5ab0eeb commit 174a15d
Show file tree
Hide file tree
Showing 20 changed files with 5 additions and 1,935 deletions.
1 change: 0 additions & 1 deletion doxygen-todo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ tmk_core/protocol/lufa
tmk_core/protocol/midi
tmk_core/protocol/midi/bytequeue
tmk_core/protocol/midi/Config
tmk_core/protocol/pjrc
tmk_core/protocol/usb_hid
tmk_core/protocol/vusb
tmk_core/tool
Expand Down
24 changes: 0 additions & 24 deletions tmk_core/common/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# include "mousekey.h"
#endif

#ifdef PROTOCOL_PJRC
# include "usb_keyboard.h"
# ifdef EXTRAKEY_ENABLE
# include "usb_extra.h"
# endif
#endif

#ifdef PROTOCOL_VUSB
# include "usbdrv.h"
#endif
Expand Down Expand Up @@ -165,9 +158,6 @@ static void print_version(void) {
/* build options */
print("OPTIONS:"

#ifdef PROTOCOL_PJRC
" PJRC"
#endif
#ifdef PROTOCOL_LUFA
" LUFA"
#endif
Expand Down Expand Up @@ -217,20 +207,6 @@ static void print_status(void) {
print_val_hex8(keymap_config.nkro);
#endif
print_val_hex32(timer_read32());

#ifdef PROTOCOL_PJRC
print_val_hex8(UDCON);
print_val_hex8(UDIEN);
print_val_hex8(UDINT);
print_val_hex8(usb_keyboard_leds);
print_val_hex8(usb_keyboard_idle_count);
#endif

#ifdef PROTOCOL_PJRC
# if USB_COUNT_SOF
print_val_hex8(usbSofCount);
# endif
#endif
return;
}

Expand Down
18 changes: 1 addition & 17 deletions tmk_core/protocol/bluefruit.mk
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
BLUEFRUIT_DIR = protocol/bluefruit
PJRC_DIR = protocol/pjrc

SRC += $(BLUEFRUIT_DIR)/main.c \
$(BLUEFRUIT_DIR)/bluefruit.c \
serial_uart.c \
$(PJRC_DIR)/pjrc.c \
$(PJRC_DIR)/usb_keyboard.c \
$(PJRC_DIR)/usb_debug.c \
$(PJRC_DIR)/usb.c

# Option modules
ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
SRC += $(PJRC_DIR)/usb_mouse.c
endif

ifdef EXTRAKEY_ENABLE
SRC += $(PJRC_DIR)/usb_extra.c
endif
serial_uart.c

# Search Path
VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)
#VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)/usb_debug_only
VPATH += $(TMK_DIR)/$(PJRC_DIR)

OPT_DEFS += -DPROTOCOL_BLUEFRUIT
OPT_DEFS += -DPROTOCOL_PJRC
47 changes: 0 additions & 47 deletions tmk_core/protocol/bluefruit/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <util/delay.h>
#include "../serial.h"
#include "keyboard.h"
#include "usb.h"
#include "host.h"
#include "timer.h"
#include "print.h"
#include "debug.h"
#include "sendchar.h"
#include "suspend.h"
#include "bluefruit.h"
#include "pjrc.h"

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

#define HOST_DRIVER_NOT_SET 0
#define BLUEFRUIT_HOST_DRIVER 1
#define PJRC_HOST_DRIVER 2

int main(void) {
CPU_PRESCALE(0);

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

print_set_sendchar(sendchar);

// usb_init();
// _delay_ms(2000);
// while (!usb_configured()) /* wait */

keyboard_setup();

dprintf("Initializing keyboard...\n");
keyboard_init();

// This implementation is pretty simplistic... if the USB connection
// is not configured, choose the Bluefruit, otherwise use USB
// Definitely would prefer to have this driven by an input pin and make
// it switch dynamically - BCG
// if (!usb_configured()) {

// // Send power to Bluefruit... Adafruit says it takes 27 mA, I think
// // the pins should provide 40 mA, but just in case I switch the
// // Bluefruit using a transistor - BCG
// DDRB = _BV(PB6);
// PORTB |= _BV(PB6);

dprintf("Setting host driver to bluefruit...\n");
host_set_driver(bluefruit_driver());

Expand Down Expand Up @@ -106,29 +84,4 @@ int main(void) {
while (1) {
keyboard_task();
}

// } else {

// // I'm not smart enough to get this done with LUFA - BCG
// dprintf("Setting host driver to PJRC...\n");
// host_set_driver(pjrc_driver());
// #ifdef SLEEP_LED_ENABLE
// sleep_led_init();
// #endif
// // wait an extra second for the PC's operating system
// // to load drivers and do whatever it does to actually
// // be ready for input
// _delay_ms(1000);
// PORTB = ~_BV(PB0);
// dprintf("Starting main loop");
// while (1) {
// while (suspend) {
// suspend_power_down();
// if (remote_wakeup && suspend_wakeup_condition()) {
// usb_remote_wakeup();
// }
// }
// keyboard_task();
// }
// }
}
35 changes: 0 additions & 35 deletions tmk_core/protocol/pjrc.mk

This file was deleted.

25 changes: 0 additions & 25 deletions tmk_core/protocol/pjrc/MEMO.txt

This file was deleted.

72 changes: 0 additions & 72 deletions tmk_core/protocol/pjrc/main.c

This file was deleted.

58 changes: 0 additions & 58 deletions tmk_core/protocol/pjrc/pjrc.c

This file was deleted.

25 changes: 0 additions & 25 deletions tmk_core/protocol/pjrc/pjrc.h

This file was deleted.

Loading

0 comments on commit 174a15d

Please sign in to comment.