]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - tmk_core/protocol/usb_hid.mk
usb_hid: Update arduino cores to 1.8.13
[max/tmk_keyboard.git] / tmk_core / protocol / usb_hid.mk
1 USB_HID_DIR = protocol/usb_hid
2
3
4 #
5 # USB Host Shield
6 #
7 USB_HOST_SHIELD_DIR = $(USB_HID_DIR)/USB_Host_Shield_2.0-tmk
8 USB_HOST_SHIELD_SRC = \
9         $(USB_HOST_SHIELD_DIR)/Usb.cpp \
10         $(USB_HOST_SHIELD_DIR)/usbhid.cpp \
11         $(USB_HOST_SHIELD_DIR)/usbhub.cpp \
12         $(USB_HOST_SHIELD_DIR)/parsetools.cpp \
13         $(USB_HOST_SHIELD_DIR)/message.cpp 
14
15
16
17 #
18 # Arduino
19 #
20 ARDUINO_DIR = $(USB_HID_DIR)/arduino-1.8.13
21 ARDUINO_CORES_DIR = $(ARDUINO_DIR)/cores/arduino
22 ARDUINO_CORES_SRC = \
23         $(ARDUINO_CORES_DIR)/abi.cpp \
24         $(ARDUINO_CORES_DIR)/Print.cpp \
25         $(ARDUINO_CORES_DIR)/Stream.cpp
26
27 # replaced with override_Serial.c
28 #       $(ARDUINO_CORES_DIR)/CDC.cpp \
29 #       $(ARDUINO_CORES_DIR)/HID.cpp \
30 #       $(ARDUINO_CORES_DIR)/USBCore.cpp \
31
32 # replaced with override_wiring.c and common/timer.c
33 #       $(ARDUINO_CORES_DIR)/wiring.c \
34
35
36
37 #
38 # HID parser
39 #
40 SRC += $(USB_HID_DIR)/parser.cpp
41
42 # replace arduino/CDC.cpp
43 SRC += $(USB_HID_DIR)/override_Serial.cpp
44
45 # replace arduino/wiring.c
46 SRC += $(USB_HID_DIR)/override_wiring.c
47 SRC += common/avr/timer.c
48
49 SRC += $(USB_HOST_SHIELD_SRC)
50 SRC += $(ARDUINO_CORES_SRC)
51
52
53 OPT_DEFS += -DARDUINO=1813
54 # Arduino USBCore needs USB_VID and USB_PID.
55 #OPT_DEFS += -DARDUINO=101 -DUSB_VID=0x2341 -DUSB_PID=0x8036
56
57
58
59 #
60 # Search Path
61 #
62 VPATH += $(TMK_DIR)/$(USB_HID_DIR)
63 VPATH += $(TMK_DIR)/$(USB_HOST_SHIELD_DIR)
64
65 # for #include "Arduino.h"
66 VPATH += $(TMK_DIR)/$(ARDUINO_CORES_DIR)
67
68 # for #include "pins_arduino.h"
69 VPATH += $(TMK_DIR)/$(ARDUINO_DIR)/variants/leonardo
70
71 # ad hoc workaround for compile problem on Windows:
72 #    Windows doesn't know difference between common/print.h and arduino/Print.h.
73 #    On Linux no problem.
74 #    Change file name common/print.h to console.h ?
75 VPATH := $(TMK_DIR)/common $(VPATH)