From ebb45b0f48e4fb7f9a6bd73f84c5dceeec79c3d0 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 4 Sep 2012 13:29:21 +0900 Subject: [PATCH] usb_hid: workaround for compile on Windows. --- common/timer.h | 3 +++ protocol/usb_hid.mk | 6 ++++++ protocol/usb_hid/README | 10 ++++++++++ 3 files changed, 19 insertions(+) mode change 100644 => 100755 protocol/usb_hid/README diff --git a/common/timer.h b/common/timer.h index 70b008e6..6437473f 100644 --- a/common/timer.h +++ b/common/timer.h @@ -43,11 +43,13 @@ along with this program. If not, see . #define TIMER_DIFF_8(a, b) TIMER_DIFF(a, b, UINT8_MAX) #define TIMER_DIFF_16(a, b) TIMER_DIFF(a, b, UINT16_MAX) #define TIMER_DIFF_32(a, b) TIMER_DIFF(a, b, UINT32_MAX) +#define TIMER_DIFF_RAW(a, b) TIMER_DIFF_8(a, b) #ifdef __cplusplus extern "C" { #endif + extern volatile uint32_t timer_count; @@ -57,6 +59,7 @@ uint16_t timer_read(void); uint32_t timer_read32(void); uint16_t timer_elapsed(uint16_t last); uint32_t timer_elapsed32(uint32_t last); + #ifdef __cplusplus } #endif diff --git a/protocol/usb_hid.mk b/protocol/usb_hid.mk index f3149f7f..fb4916d5 100644 --- a/protocol/usb_hid.mk +++ b/protocol/usb_hid.mk @@ -65,3 +65,9 @@ VPATH += $(TOP_DIR)/$(ARDUINO_CORES_DIR) # for #include "pins_arduino.h" VPATH += $(TOP_DIR)/$(ARDUINO_DIR)/variants/leonardo + +# ad hoc workaround for compile problem on Windows: +# Windows doesn't know difference between common/print.h and arduino/Print.h. +# On Linux no problem. +# Change file name common/print.h to console.h ? +VPATH := $(TOP_DIR)/common $(VPATH) diff --git a/protocol/usb_hid/README b/protocol/usb_hid/README old mode 100644 new mode 100755 index 5d49cc8d..1357a4c7 --- a/protocol/usb_hid/README +++ b/protocol/usb_hid/README @@ -27,6 +27,11 @@ Restriction and Bug ------------------- Not statble yet. +Switching power on VBUS: + To power reset device. + http://www.circuitsathome.com/camera-control/simulating-cable-disconnect-on-usb-host-shield-2-0 + This is needed for a device which are not initilized with 'USB Bus Reset'(long SE0) + Can't bus-reset a keyboard which already attached on bus properly. Slow start up of Leonardo's bootloader causes this? Need to unplug/plug a keyboard after firmware starts up. @@ -34,3 +39,8 @@ Can't bus-reset a keyboard which already attached on bus properly. Keyboard with other endpoints than boot keyboard may go wrong. On my keyboard with mouse key the converter locks up when using mouse key function. + +Can't compile on Windows filesystem. + On Linux no problem. + Windows doesn't know difference between common/print.h and arduino/Print.h. + Change file name common/print.h to console.h ?