summaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2018-07-16 11:48:31 -0400
committerGitHub <noreply@github.com>2018-07-16 11:48:31 -0400
commitade22f8e2c272044ea2f80ff6fe5ca9576858939 (patch)
tree03c0131fa5982afc10a60e1fdd38a60be750291b /tmk_core
parent96cb9f4661faa80e795b1e6731b7a8e8a50bd0cb (diff)
Adds support for Planck Rev 6 (#2666)
* initial files for rev 6 with encoder * music map init, dip scan added * adds ws2812 driver for arm * flesh out dip and encoder support * adds default encoder res * adds default encoder res * start muse implementation * muse working with encoder as control * flip direction * try mouse wheel again * dont break other revs * dont break other revs * conditional autio * pwm ws driver (not working) * update build includes for chibios * update ws2812 driver/config * last commit for glasser code * working example * remove rgb for now * finish up rev6 * working encoder keycodes * add warnings to planck keymaps about the LAYOUT
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/chibios.mk4
-rw-r--r--tmk_core/protocol/chibios/usb_main.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index e53204905f..25c49204bc 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -125,7 +125,7 @@ CHIBISRC := $(patsubst $(TOP_DIR)/%,%,$(CHIBISRC))
EXTRAINCDIRS += $(CHIBIOS)/os/license \
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(STREAMSINC) $(CHIBIOS)/os/various
+ $(STREAMSINC) $(CHIBIOS)/os/various $(COMMON_VPATH)
#
# Project, sources and paths
@@ -145,6 +145,8 @@ HEX = $(OBJCOPY) -O $(FORMAT)
EEP =
BIN = $(OBJCOPY) -O binary
+COMMON_VPATH += $(DRIVER_PATH)/arm
+
THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB
COMPILEFLAGS += -fomit-frame-pointer
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index cbe2571944..e79ff15e89 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -717,12 +717,14 @@ void send_mouse(report_mouse_t *report) {
}
osalSysUnlock();
- /* TODO: LUFA manually waits for the endpoint to become ready
- * for about 10ms for mouse, kbd, system; 1ms for nkro
- * is this really needed?
- */
-
osalSysLock();
+ if(usbGetTransmitStatusI(&USB_DRIVER, MOUSE_IN_EPNUM)) {
+ /* Need to either suspend, or loop and call unlock/lock during
+ * every iteration - otherwise the system will remain locked,
+ * no interrupts served, so USB not going through as well.
+ * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */
+ osalThreadSuspendS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread);
+ }
usbStartTransmitI(&USB_DRIVER, MOUSE_IN_EPNUM, (uint8_t *)report, sizeof(report_mouse_t));
osalSysUnlock();
}