summaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common.mk9
-rw-r--r--tmk_core/common/action.c4
-rw-r--r--tmk_core/common/action_tapping.c6
-rw-r--r--tmk_core/common/action_tapping.h2
-rw-r--r--tmk_core/common/chibios/printf.c233
-rw-r--r--tmk_core/common/chibios/printf.h110
-rw-r--r--tmk_core/common/command.c4
-rw-r--r--tmk_core/common/print.h5
-rw-r--r--tmk_core/protocol/arm_atsam/led_matrix.c2
-rw-r--r--tmk_core/protocol/chibios/main.c3
-rw-r--r--tmk_core/protocol/chibios/usb_main.c5
-rw-r--r--tmk_core/protocol/chibios/usb_main.h2
-rw-r--r--tmk_core/protocol/iwrap.mk18
-rw-r--r--tmk_core/protocol/iwrap/main.c2
-rw-r--r--tmk_core/protocol/vusb.mk16
-rw-r--r--tmk_core/protocol/vusb/main.c4
-rw-r--r--tmk_core/protocol/vusb/sendchar_usart.c2
-rw-r--r--tmk_core/protocol/vusb/usbdrv/Changelog.txt308
-rw-r--r--tmk_core/protocol/vusb/usbdrv/CommercialLicense.txt166
-rw-r--r--tmk_core/protocol/vusb/usbdrv/License.txt361
-rw-r--r--tmk_core/protocol/vusb/usbdrv/Readme.txt172
-rw-r--r--tmk_core/protocol/vusb/usbdrv/USB-ID-FAQ.txt149
-rw-r--r--tmk_core/protocol/vusb/usbdrv/USB-IDs-for-free.txt148
-rw-r--r--tmk_core/protocol/vusb/usbdrv/asmcommon.inc188
-rw-r--r--tmk_core/protocol/vusb/usbdrv/oddebug.c46
-rw-r--r--tmk_core/protocol/vusb/usbdrv/oddebug.h121
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbconfig-prototype.h376
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrv.c622
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrv.h730
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm.S393
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm.asm21
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm12.inc393
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm128.inc750
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm15.inc423
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm16.inc346
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm165.inc453
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm18-crc.inc707
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbdrvasm20.inc360
-rw-r--r--tmk_core/protocol/vusb/usbdrv/usbportability.h146
-rw-r--r--tmk_core/protocol/vusb/vusb.c34
40 files changed, 60 insertions, 7780 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index aa8a0eb7ad..63de7c7ede 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -1,3 +1,5 @@
+PRINTF_PATH = $(LIB_PATH)/printf
+
COMMON_DIR = common
PLATFORM_COMMON_DIR = $(COMMON_DIR)/$(PLATFORM_KEY)
@@ -21,7 +23,12 @@ TMK_COMMON_SRC += $(COMMON_DIR)/host.c \
ifeq ($(PLATFORM),AVR)
TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/xprintf.S
else ifeq ($(PLATFORM),CHIBIOS)
- TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c
+ TMK_COMMON_SRC += $(PRINTF_PATH)/printf.c
+ TMK_COMMON_DEFS += -DPRINTF_DISABLE_SUPPORT_FLOAT
+ TMK_COMMON_DEFS += -DPRINTF_DISABLE_SUPPORT_EXPONENTIAL
+ TMK_COMMON_DEFS += -DPRINTF_DISABLE_SUPPORT_LONG_LONG
+ TMK_COMMON_DEFS += -DPRINTF_DISABLE_SUPPORT_PTRDIFF_T
+ VPATH += $(PRINTF_PATH)
else ifeq ($(PLATFORM),ARM_ATSAM)
TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c
endif
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 3b1268dc94..7a53e08ed3 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -48,7 +48,7 @@ int retro_tapping_counter = 0;
#endif
#ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
-__attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode) { return false; }
+__attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { return false; }
#endif
#ifndef TAP_CODE_DELAY
@@ -335,7 +335,7 @@ void process_action(keyrecord_t *record, action_t action) {
# if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY)
if (
# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
- !get_ignore_mod_tap_interrupt(get_event_keycode(record->event, false)) &&
+ !get_ignore_mod_tap_interrupt(get_event_keycode(record->event, false), &record) &&
# endif
record->tap.interrupted) {
dprint("mods_tap: tap: cancel: add_mods\n");
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c
index 34f08d8904..fe545c79a0 100644
--- a/tmk_core/common/action_tapping.c
+++ b/tmk_core/common/action_tapping.c
@@ -19,10 +19,10 @@
# define IS_TAPPING_RELEASED() (IS_TAPPING() && !tapping_key.event.pressed)
# define IS_TAPPING_KEY(k) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (k)))
-__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode) { return TAPPING_TERM; }
+__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { return TAPPING_TERM; }
# ifdef TAPPING_TERM_PER_KEY
-# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_event_keycode(tapping_key.event, false)))
+# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_event_keycode(tapping_key.event, false), &tapping_key))
# else
# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM)
# endif
@@ -122,7 +122,7 @@ bool process_tapping(keyrecord_t *keyp) {
# if defined(TAPPING_TERM_PER_KEY) || (TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD) || defined(PERMISSIVE_HOLD_PER_KEY)
else if (
# ifdef TAPPING_TERM_PER_KEY
- (get_tapping_term(get_event_keycode(tapping_key.event, false)) >= 500) &&
+ (get_tapping_term(get_event_keycode(tapping_key.event, false), keyp) >= 500) &&
# endif
# ifdef PERMISSIVE_HOLD_PER_KEY
!get_permissive_hold(get_event_keycode(tapping_key.event, false), keyp) &&
diff --git a/tmk_core/common/action_tapping.h b/tmk_core/common/action_tapping.h
index 5eaef1c5f0..7015ce7612 100644
--- a/tmk_core/common/action_tapping.h
+++ b/tmk_core/common/action_tapping.h
@@ -33,7 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef NO_ACTION_TAPPING
uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache);
-uint16_t get_tapping_term(uint16_t keycode);
+uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record);
void action_tapping_process(keyrecord_t record);
#endif
diff --git a/tmk_core/common/chibios/printf.c b/tmk_core/common/chibios/printf.c
deleted file mode 100644
index a99752bb3d..0000000000
--- a/tmk_core/common/chibios/printf.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * found at: http://www.sparetimelabs.com/tinyprintf/tinyprintf.php
- * and: http://www.sparetimelabs.com/printfrevisited/printfrevisited.php
- */
-
-/*
-File: printf.c
-
-Copyright (C) 2004 Kustaa Nyholm
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-#include "printf.h"
-
-typedef void (*putcf)(void*, char);
-static putcf stdout_putf;
-static void* stdout_putp;
-
-// this adds cca 400 bytes
-#define PRINTF_LONG_SUPPORT
-
-#ifdef PRINTF_LONG_SUPPORT
-
-static void uli2a(unsigned long int num, unsigned int base, int uc, char* bf) {
- int n = 0;
- unsigned int d = 1;
- while (num / d >= base) d *= base;
- while (d != 0) {
- int dgt = num / d;
- num %= d;
- d /= base;
- if (n || dgt > 0 || d == 0) {
- *bf++ = dgt + (dgt < 10 ? '0' : (uc ? 'A' : 'a') - 10);
- ++n;
- }
- }
- *bf = 0;
-}
-
-static void li2a(long num, char* bf) {
- if (num < 0) {
- num = -num;
- *bf++ = '-';
- }
- uli2a(num, 10, 0, bf);
-}
-
-#endif
-
-static void ui2a(unsigned int num, unsigned int base, int uc, char* bf) {
- int n = 0;
- unsigned int d = 1;
- while (num / d >= base) d *= base;
- while (d != 0) {
- int dgt = num / d;
- num %= d;
- d /= base;
- if (n || dgt > 0 || d == 0) {
- *bf++ = dgt + (dgt < 10 ? '0' : (uc ? 'A' : 'a') - 10);
- ++n;
- }
- }
- *bf = 0;
-}
-
-static void i2a(int num, char* bf) {
- if (num < 0) {
- num = -num;
- *bf++ = '-';
- }
- ui2a(num, 10, 0, bf);
-}
-
-static int a2d(char ch) {
- if (ch >= '0' && ch <= '9')
- return ch - '0';
- else if (ch >= 'a' && ch <= 'f')
- return ch - 'a' + 10;
- else if (ch >= 'A' && ch <= 'F')
- return ch - 'A' + 10;
- else
- return -1;
-}
-
-static char a2i(char ch, const char** src, int base, int* nump) {
- const char* p = *src;
- int num = 0;
- int digit;
- while ((digit = a2d(ch)) >= 0) {
- if (digit > base) break;
- num = num * base + digit;
- ch = *p++;
- }
- *src = p;
- *nump = num;
- return ch;
-}
-
-static void putchw(void* putp, putcf putf, int n, char z, char* bf) {
- char fc = z ? '0' : ' ';
- char ch;
- char* p = bf;
- while (*p++ && n > 0) n--;
- while (n-- > 0) putf(putp, fc);
- while ((ch = *bf++)) putf(putp, ch);
-}
-
-void tfp_format(void* putp, putcf putf, const char* fmt, va_list va) {
- // This used to handle max of 12, but binary support jumps this to at least 32
- char bf[36];
-
- char ch;
-
- while ((ch = *(fmt++))) {
- if (ch != '%')
- putf(putp, ch);
- else {
- char lz = 0;
-#ifdef PRINTF_LONG_SUPPORT
- char lng = 0;
-#endif
- int w = 0;
- ch = *(fmt++);
- if (ch == '0') {
- ch = *(fmt++);
- lz = 1;
- }
- if (ch >= '0' && ch <= '9') {
- ch = a2i(ch, &fmt, 10, &w);
- }
-#ifdef PRINTF_LONG_SUPPORT
- if (ch == 'l') {
- ch = *(fmt++);
- lng = 1;
- }
-#endif
- switch (ch) {
- case 0:
- goto abort;
- case 'u': {
-#ifdef PRINTF_LONG_SUPPORT
- if (lng)
- uli2a(va_arg(va, unsigned long int), 10, 0, bf);
- else
-#endif
- ui2a(va_arg(va, unsigned int), 10, 0, bf);
- putchw(putp, putf, w, lz, bf);
- break;
- }
- case 'd': {
-#ifdef PRINTF_LONG_SUPPORT
- if (lng)
- li2a(va_arg(va, unsigned long int), bf);
- else
-#endif
- i2a(va_arg(va, int), bf);
- putchw(putp, putf, w, lz, bf);
- break;
- }
- case 'x':
- case 'X':
-#ifdef PRINTF_LONG_SUPPORT
- if (lng)
- uli2a(va_arg(va, unsigned long int), 16, (ch == 'X'), bf);
- else
-#endif
- ui2a(va_arg(va, unsigned int), 16, (ch == 'X'), bf);
- putchw(putp, putf, w, lz, bf);
- break;
- case 'c':
- putf(putp, (char)(va_arg(va, int)));
- break;
- case 's':
- putchw(putp, putf, w, 0, va_arg(va, char*));
- break;
- case 'b':
-#ifdef PRINTF_LONG_SUPPORT
- if (lng)
- uli2a(va_arg(va, unsigned long int), 2, 0, bf);
- else
-#endif
- ui2a(va_arg(va, unsigned int), 2, 0, bf);
- putchw(putp, putf, w, lz, bf);
- break;
- case '%':
- putf(putp, ch);
- default:
- break;
- }
- }
- }
-abort:;
-}
-
-void init_printf(void* putp, void (*putf)(void*, char)) {
- stdout_putf = putf;
- stdout_putp = putp;
-}
-
-int tfp_printf(const char* fmt, ...) {
- va_list va;
- va_start(va, fmt);
- tfp_format(stdout_putp, stdout_putf, fmt, va);
- va_end(va);
-
- return 1;
-}
-
-static void putcp(void* p, char c) { *(*((char**)p))++ = c; }
-
-int tfp_sprintf(char* s, const char* fmt, ...) {
- va_list va;
- va_start(va, fmt);
- tfp_format(&s, putcp, fmt, va);
- putcp(&s, 0);
- va_end(va);
-
- return 1;
-}
diff --git a/tmk_core/common/chibios/printf.h b/tmk_core/common/chibios/printf.h
deleted file mode 100644
index 775459e1e8..0000000000
--- a/tmk_core/common/chibios/printf.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * found at: http://www.sparetimelabs.com/tinyprintf/tinyprintf.php
- * and: http://www.sparetimelabs.com/printfrevisited/printfrevisited.php
- */
-
-/*
-File: printf.h
-
-Copyright (C) 2004 Kustaa Nyholm
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-See the GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-This library is realy just two files: 'printf.h' and 'printf.c'.
-
-They provide a simple and small (+200 loc) printf functionality to
-be used in embedded systems.
-
-I've found them so usefull in debugging that I do not bother with a
-debugger at all.
-
-They are distributed in source form, so to use them, just compile them
-into your project.
-
-Two printf variants are provided: printf and sprintf.
-
-The formats supported by this implementation are: 'd' 'u' 'c' 's' 'x' 'X'.
-
-Zero padding and field width are also supported.
-
-If the library is compiled with 'PRINTF_SUPPORT_LONG' defined then the
-long specifier is also
-supported. Note that this will pull in some long math routines (pun intended!)
-and thus make your executable noticably longer.
-
-The memory foot print of course depends on the target cpu, compiler and
-compiler options, but a rough guestimate (based on a H8S target) is about
-1.4 kB for code and some twenty 'int's and 'char's, say 60 bytes of stack space.
-Not too bad. Your milage may vary. By hacking the source code you can
-get rid of some hunred bytes, I'm sure, but personally I feel the balance of
-functionality and flexibility versus code size is close to optimal for
-many embedded systems.
-
-To use the printf you need to supply your own character output function,
-something like :
-
- void putc ( void* p, char c)
- {
- while (!SERIAL_PORT_EMPTY) ;
- SERIAL_PORT_TX_REGISTER = c;
- }
-
-Before you can call printf you need to initialize it to use your
-character output function with something like:
-
- init_printf(NULL,putc);
-
-Notice the 'NULL' in 'init_printf' and the parameter 'void* p' in 'putc',
-the NULL (or any pointer) you pass into the 'init_printf' will eventually be
-passed to your 'putc' routine. This allows you to pass some storage space (or
-anything realy) to the character output function, if necessary.
-This is not often needed but it was implemented like that because it made
-implementing the sprintf function so neat (look at the source code).
-
-The code is re-entrant, except for the 'init_printf' function, so it
-is safe to call it from interupts too, although this may result in mixed output.
-If you rely on re-entrancy, take care that your 'putc' function is re-entrant!
-
-The printf and sprintf functions are actually macros that translate to
-'tfp_printf' and 'tfp_sprintf'. This makes it possible
-to use them along with 'stdio.h' printf's in a single source file.
-You just need to undef the names before you include the 'stdio.h'.
-Note that these are not function like macros, so if you have variables
-or struct members with these names, things will explode in your face.
-Without variadic macros this is the best we can do to wrap these
-fucnction. If it is a problem just give up the macros and use the
-functions directly or rename them.
-
-For further details see source code.
-
-regs Kusti, 23.10.2004
-*/
-
-#ifndef __TFP_PRINTF__
-#define __TFP_PRINTF__
-
-#include <stdarg.h>
-
-void init_printf(void* putp, void (*putf)(void*, char));
-
-int tfp_printf(const char* fmt, ...);
-int tfp_sprintf(char* s, const char* fmt, ...);
-
-void tfp_format(void* putp, void (*putf)(void*, char), const char* fmt, va_list va);
-
-#define printf tfp_printf
-#define sprintf tfp_sprintf
-
-#endif
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c
index ee3188646c..3cfcba3058 100644
--- a/tmk_core/common/command.c
+++ b/tmk_core/common/command.c
@@ -43,10 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# include "mousekey.h"
#endif
-#ifdef PROTOCOL_VUSB
-# include "usbdrv.h"
-#endif
-
#ifdef AUDIO_ENABLE
# include "audio.h"
#endif /* AUDIO_ENABLE */
diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h
index 04ca558109..1c77236212 100644
--- a/tmk_core/common/print.h
+++ b/tmk_core/common/print.h
@@ -72,9 +72,7 @@ extern "C"
# elif defined(PROTOCOL_CHIBIOS) /* PROTOCOL_CHIBIOS */
-# ifndef TERMINAL_ENABLE
-# include "chibios/printf.h"
-# endif
+# include "printf.h" // lib/printf/printf.h
# ifdef USER_PRINT /* USER_PRINT */
@@ -89,7 +87,6 @@ extern "C"
# define uprintf printf
# else /* NORMAL PRINT */
-
// Create user & normal print defines
# define print(s) printf(s)
# define println(s) printf(s "\r\n")
diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c
index 24eab25067..4b8cc7c5e1 100644
--- a/tmk_core/protocol/arm_atsam/led_matrix.c
+++ b/tmk_core/protocol/arm_atsam/led_matrix.c
@@ -270,7 +270,7 @@ void flush(void) {
}
// This should only be performed once per frame
- pomod = (float)((g_rgb_counters.tick / 10) % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed;
+ pomod = (float)((g_rgb_timer / 10) % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed;
pomod *= 100.0f;
pomod = (uint32_t)pomod % 10000;
pomod /= 100.0f;
diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c
index 61665eb6f4..7d32c16ed8 100644
--- a/tmk_core/protocol/chibios/main.c
+++ b/tmk_core/protocol/chibios/main.c
@@ -158,9 +158,6 @@ int main(void) {
/* Init USB */
init_usb_driver(&USB_DRIVER);
- /* init printf */
- init_printf(NULL, sendchar_pf);
-
#ifdef MIDI_ENABLE
setup_midi();
#endif
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index ecc83d9ecc..65bd291bec 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -796,9 +796,8 @@ int8_t sendchar(uint8_t c) {
}
#endif /* CONSOLE_ENABLE */
-void sendchar_pf(void *p, char c) {
- (void)p;
- sendchar((uint8_t)c);
+void _putchar(char character) {
+ sendchar(character);
}
#ifdef RAW_ENABLE
diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h
index 17041b4f2f..94baf9b35e 100644
--- a/tmk_core/protocol/chibios/usb_main.h
+++ b/tmk_core/protocol/chibios/usb_main.h
@@ -87,6 +87,4 @@ void console_flush_output(void);
#endif /* CONSOLE_ENABLE */
-void sendchar_pf(void *p, char c);
-
#endif /* _USB_MAIN_H_ */
diff --git a/tmk_core/protocol/iwrap.mk b/tmk_core/protocol/iwrap.mk
index eeedd83af2..934235bd81 100644
--- a/tmk_core/protocol/iwrap.mk
+++ b/tmk_core/protocol/iwrap.mk
@@ -16,11 +16,17 @@ VPATH += $(TMK_DIR)/protocol/iwrap
# V-USB
#
VUSB_DIR = protocol/vusb
-OPT_DEFS += -DPROTOCOL_VUSB
-SRC += $(VUSB_DIR)/vusb.c \
- $(VUSB_DIR)/usbdrv/usbdrv.c \
- $(VUSB_DIR)/usbdrv/usbdrvasm.S \
- $(VUSB_DIR)/usbdrv/oddebug.c
-VPATH += $(TMK_DIR)/protocol/vusb:$(TMK_DIR)/protocol/vusb/usbdrv
+# Path to the V-USB library
+VUSB_PATH = $(LIB_PATH)/vusb
+
+SRC += $(VUSB_DIR)/vusb.c \
+ $(VUSB_PATH)/usbdrv/usbdrv.c \
+ $(VUSB_PATH)/usbdrv/usbdrvasm.S \
+ $(VUSB_PATH)/usbdrv/oddebug.c
+# Search Path
+VPATH += $(TMK_PATH)/$(VUSB_DIR)
+VPATH += $(VUSB_PATH)
+
+OPT_DEFS += -DPROTOCOL_VUSB
diff --git a/tmk_core/protocol/iwrap/main.c b/tmk_core/protocol/iwrap/main.c
index 6e9b5455b1..4048a9791d 100644
--- a/tmk_core/protocol/iwrap/main.c
+++ b/tmk_core/protocol/iwrap/main.c
@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "iwrap.h"
#ifdef PROTOCOL_VUSB
# include "vusb.h"
-# include "usbdrv.h"
+# include <usbdrv/usbdrv.h>
#endif
#include "uart.h"
#include "suart.h"
diff --git a/tmk_core/protocol/vusb.mk b/tmk_core/protocol/vusb.mk
index 6df0d0d339..5e564f7480 100644
--- a/tmk_core/protocol/vusb.mk
+++ b/tmk_core/protocol/vusb.mk
@@ -1,13 +1,13 @@
VUSB_DIR = protocol/vusb
-OPT_DEFS += -DPROTOCOL_VUSB
+# Path to the V-USB library
+VUSB_PATH = $(LIB_PATH)/vusb
-SRC += $(VUSB_DIR)/main.c \
+SRC += $(VUSB_DIR)/main.c \
$(VUSB_DIR)/vusb.c \
- $(VUSB_DIR)/usbdrv/usbdrv.c \
- $(VUSB_DIR)/usbdrv/usbdrvasm.S \
- $(VUSB_DIR)/usbdrv/oddebug.c
-
+ $(VUSB_PATH)/usbdrv/usbdrv.c \
+ $(VUSB_PATH)/usbdrv/usbdrvasm.S \
+ $(VUSB_PATH)/usbdrv/oddebug.c
ifneq ($(strip $(CONSOLE_ENABLE)), yes)
ifndef NO_UART
@@ -18,4 +18,6 @@ endif
# Search Path
VPATH += $(TMK_PATH)/$(VUSB_DIR)
-VPATH += $(TMK_PATH)/$(VUSB_DIR)/usbdrv
+VPATH += $(VUSB_PATH)
+
+OPT_DEFS += -DPROTOCOL_VUSB
diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c
index 7dc16926d2..b4063273da 100644
--- a/tmk_core/protocol/vusb/main.c
+++ b/tmk_core/protocol/vusb/main.c
@@ -12,8 +12,8 @@
#include <avr/wdt.h>
#include <avr/sleep.h>
#include <util/delay.h>
-#include "usbdrv.h"
-#include "oddebug.h"
+#include <usbdrv/usbdrv.h>
+#include <usbdrv/oddebug.h>
#include "vusb.h"
#include "keyboard.h"
#include "host.h"
diff --git a/tmk_core/protocol/vusb/sendchar_usart.c b/tmk_core/protocol/vusb/sendchar_usart.c
index 42bd9ee363..a920a9a536 100644
--- a/tmk_core/protocol/vusb/sendchar_usart.c
+++ b/tmk_core/protocol/vusb/sendchar_usart.c
@@ -3,7 +3,7 @@
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
*/
#include <stdint.h>
-#include "oddebug.h"
+#include <usbdrv/oddebug.h>
#include "sendchar.h"
#if DEBUG_LEVEL > 0
diff --git a/tmk_core/protocol/vusb/usbdrv/Changelog.txt b/tmk_core/protocol/vusb/usbdrv/Changelog.txt
deleted file mode 100644
index 1e74180a9e..0000000000
--- a/tmk_core/protocol/vusb/usbdrv/Changelog.txt
+++ /dev/null
@@ -1,308 +0,0 @@
-This file documents changes in the firmware-only USB driver for atmel's AVR
-microcontrollers. New entries are always appended to the end of the file.
-Scroll down to the bottom to see the most recent changes.
-
-2005-04-01:
- - Implemented endpoint 1 as interrupt-in endpoint.
- - Moved all configuration options to usbconfig.h which is not part of the
- driver.
- - Changed interface for usbVendorSetup().
- - Fixed compatibility with ATMega8 device.
- - Various minor optimizations.
-
-2005-04-11:
- - Changed interface to application: Use usbFunctionSetup(), usbFunctionRead()
- and usbFunctionWrite() now. Added configuration options to choose which
- of these functions to compile in.
- - Assembler module delivers receive data non-inverted now.
- - Made register and bit names compatible with more AVR devices.
-
-2005-05-03:
- - Allow address of usbRxBuf on any memory page as long as the buffer does
- not cross 256 byte page boundaries.
- - Better device compatibility: works with Mega88 now.
- - Code optimization in debugging module.
- - Documentation updates.
-
-2006-01-02:
- - Added (free) default Vendor- and Product-IDs bought from voti.nl.
- - Added USBID-License.txt file which defines the rules for using the free
- shared VID/PID pair.
- - Added readme.txt to the usbdrv directory which clarifies administrative
- issues.
-
-2006-01-25:
- - Added "configured state" to become more standards compliant.
- - Added "HALT" state for interrupt endpoint.
- - Driver passes the "USB Command Verifier" test from usb.org now.
- - Made "serial number" a configuration option.
- - Minor optimizations, we now recommend compiler option "-Os" for best
- results.
- - Added a version number to usbdrv.h
-
-2006-02-03:
- - New configuration variable USB_BUFFER_SECTION for the memory section where
- the USB rx buffer will go. This defaults to ".bss" if not defined. Since
- this buffer MUST NOT cross 256 byte pages (not even touch a page at the
- end), the user may want to pass a linker option similar to
- "-Wl,--section-start=.mybuffer=0x800060".
- - Provide structure for usbRequest_t.
- - New defines for USB constants.
- - Prepared for HID implementations.
- - Increased data size limit for interrupt transfers to 8 bytes.
- - New macro usbInterruptIsReady() to query interrupt buffer state.
-
-2006-02-18:
- - Ensure that the data token which is sent as an ack to an OUT transfer is
- always zero sized. This fixes a bug where the host reports an error after
- sending an out transfer to the device, although all data arrived at the
- device.
- - Updated docs in usbdrv.h to reflect changed API in usbFunctionWrite().
-
-* Release 2006-02-20
-
- - Give a compiler warning when compiling with debugging turned on.
- - Added Oleg Semyonov's changes for IAR-cc compatibility.
- - Added new (optional) functions usbDeviceConnect() and usbDeviceDisconnect()
- (also thanks to Oleg!).
- - Rearranged tests in usbPoll() to save a couple of instructions in the most
- likely case that no actions are pending.
- - We need a delay between the SET ADDRESS request until the new address
- becomes active. This delay was handled in usbPoll() until now. Since the
- spec says that the delay must not exceed 2ms, previous versions required
- aggressive polling during the enumeration phase. We have now moved the
- handling of the delay into the interrupt routine.
- - We must not reply with NAK to a SETUP transaction. We can only achieve this
- by making sure that the rx buffer is empty when SETUP tokens are expected.
- We there