From bc2516607e309a6dccf1bb55f670b7bbc2a15af6 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 6 Mar 2015 20:39:23 -0800 Subject: [PATCH] Starting to update the keyboardio core for arduino --- hardware/keyboardio/avr/boards.txt | 37 + .../bootloaders/caterina/Caterina-Esplora.hex | 0 .../bootloaders/caterina/Caterina-Esplora.txt | 0 .../caterina/Caterina-Leonardo.hex | 0 .../caterina/Caterina-Leonardo.txt | 0 .../bootloaders/caterina/Caterina-Model00.hex | 0 .../bootloaders/caterina/Caterina-Model00.txt | 0 .../caterina/Caterina-symmetric60.hex} | 0 .../{ => avr}/bootloaders/caterina/Caterina.c | 0 .../{ => avr}/bootloaders/caterina/Caterina.h | 0 .../bootloaders/caterina/Descriptors.c | 0 .../bootloaders/caterina/Descriptors.h | 0 .../Esplora-prod-firmware-2012-12-10.hex | 0 .../Esplora-prod-firmware-2012-12-10.txt | 0 .../Leonardo-prod-firmware-2012-04-26.hex | 0 .../Leonardo-prod-firmware-2012-04-26.txt | 0 .../Leonardo-prod-firmware-2012-12-10.hex | 0 .../Leonardo-prod-firmware-2012-12-10.txt | 0 .../{ => avr}/bootloaders/caterina/Makefile | 0 .../Micro-prod-firmware-2012-11-23.hex | 0 .../Micro-prod-firmware-2012-11-23.txt | 0 .../Micro-prod-firmware-2012-12-10.hex | 1024 +++++++++++++++++ .../Micro-prod-firmware-2012-12-10.txt | 0 .../{ => avr}/cores/keyboardio/Arduino.h | 68 +- .../{ => avr}/cores/keyboardio/CDC.cpp | 118 +- .../keyboardio/avr/cores/keyboardio/Client.h | 45 + .../keyboardio/avr/cores/keyboardio/HID.cpp | 803 +++++++++++++ .../avr/cores/keyboardio/HIDTables.h | 677 +++++++++++ .../avr/cores/keyboardio/HardwareSerial.cpp | 252 ++++ .../cores/keyboardio/HardwareSerial.h | 122 +- .../avr/cores/keyboardio/HardwareSerial0.cpp | 79 ++ .../avr/cores/keyboardio/HardwareSerial1.cpp | 69 ++ .../avr/cores/keyboardio/HardwareSerial2.cpp | 57 + .../avr/cores/keyboardio/HardwareSerial3.cpp | 57 + .../cores/keyboardio/HardwareSerial_private.h | 123 ++ .../avr/cores/keyboardio/IPAddress.cpp | 74 ++ .../avr/cores/keyboardio/IPAddress.h | 75 ++ .../{ => avr}/cores/keyboardio/Print.cpp | 8 +- .../{ => avr}/cores/keyboardio/Print.h | 3 + .../{ => avr}/cores/keyboardio/Printable.h | 2 +- .../keyboardio/avr/cores/keyboardio/Server.h | 30 + .../{ => avr}/cores/keyboardio/Stream.cpp | 4 +- .../{ => avr}/cores/keyboardio/Stream.h | 6 + .../{ => avr}/cores/keyboardio/Tone.cpp | 0 .../{ => avr}/cores/keyboardio/USBAPI.h | 81 +- .../{ => avr}/cores/keyboardio/USBCore.cpp | 100 +- .../{ => avr}/cores/keyboardio/USBCore.h | 2 +- .../{ => avr}/cores/keyboardio/USBDesc.h | 0 .../{ => avr}/cores/keyboardio/Udp.h | 0 .../{ => avr}/cores/keyboardio/WCharacter.h | 0 .../{ => avr}/cores/keyboardio/WInterrupts.c | 0 .../{ => avr}/cores/keyboardio/WMath.cpp | 0 .../{ => avr}/cores/keyboardio/WString.cpp | 93 +- .../{ => avr}/cores/keyboardio/WString.h | 17 +- .../keyboardio/avr/cores/keyboardio/abi.cpp | 35 + .../{ => avr}/cores/keyboardio/binary.h | 19 + .../keyboardio/avr/cores/keyboardio/hooks.c | 31 + .../keyboardio/avr/cores/keyboardio/main.cpp | 49 + .../keyboardio/avr/cores/keyboardio/new.cpp | 36 + .../keyboardio/avr/cores/keyboardio/new.h | 30 + .../{ => avr}/cores/keyboardio/wiring.c | 1 + .../cores/keyboardio/wiring_analog.c | 8 + .../cores/keyboardio/wiring_digital.c | 3 + .../cores/keyboardio/wiring_private.h | 2 +- .../{ => avr}/cores/keyboardio/wiring_pulse.c | 0 .../{ => avr}/cores/keyboardio/wiring_shift.c | 0 hardware/keyboardio/avr/platform.txt | 1 + .../{ => avr}/variants/model00/pins_arduino.h | 0 .../avr/variants/symmetric60/pins_arduino.h | 359 ++++++ hardware/keyboardio/boards.txt | 18 - hardware/keyboardio/cores/keyboardio/Client.h | 26 - hardware/keyboardio/cores/keyboardio/HID.cpp | 708 ------------ .../cores/keyboardio/HardwareSerial.cpp | 508 -------- .../keyboardio/cores/keyboardio/IPAddress.cpp | 56 - .../keyboardio/cores/keyboardio/IPAddress.h | 76 -- .../keyboardio/cores/keyboardio/Platform.h | 23 - hardware/keyboardio/cores/keyboardio/Server.h | 9 - .../cores/keyboardio/avr-libc/malloc.c | 267 ----- .../cores/keyboardio/avr-libc/realloc.c | 150 --- .../cores/keyboardio/avr-libc/sectionname.h | 49 - .../keyboardio/avr-libc/stdlib_private.h | 58 - .../keyboardio/cores/keyboardio/license.txt | 753 ------------ hardware/keyboardio/cores/keyboardio/main.cpp | 20 - hardware/keyboardio/cores/keyboardio/new.cpp | 28 - hardware/keyboardio/cores/keyboardio/new.h | 24 - hardware/keyboardio/cores/keyboardio/todo.txt | 201 ---- 86 files changed, 4362 insertions(+), 3212 deletions(-) create mode 100644 hardware/keyboardio/avr/boards.txt rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Caterina-Esplora.hex (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Caterina-Esplora.txt (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Caterina-Leonardo.hex (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Caterina-Leonardo.txt (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Caterina-Model00.hex (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Caterina-Model00.txt (100%) rename hardware/keyboardio/{bootloaders/caterina/Micro-prod-firmware-2012-12-10.hex => avr/bootloaders/caterina/Caterina-symmetric60.hex} (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Caterina.c (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Caterina.h (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Descriptors.c (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Descriptors.h (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.hex (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.txt (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.hex (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.txt (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.hex (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.txt (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Makefile (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Micro-prod-firmware-2012-11-23.hex (100%) rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Micro-prod-firmware-2012-11-23.txt (100%) create mode 100644 hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-12-10.hex rename hardware/keyboardio/{ => avr}/bootloaders/caterina/Micro-prod-firmware-2012-12-10.txt (100%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/Arduino.h (78%) mode change 100755 => 100644 rename hardware/keyboardio/{ => avr}/cores/keyboardio/CDC.cpp (67%) create mode 100644 hardware/keyboardio/avr/cores/keyboardio/Client.h create mode 100644 hardware/keyboardio/avr/cores/keyboardio/HID.cpp create mode 100644 hardware/keyboardio/avr/cores/keyboardio/HIDTables.h create mode 100644 hardware/keyboardio/avr/cores/keyboardio/HardwareSerial.cpp rename hardware/keyboardio/{ => avr}/cores/keyboardio/HardwareSerial.h (55%) create mode 100644 hardware/keyboardio/avr/cores/keyboardio/HardwareSerial0.cpp create mode 100644 hardware/keyboardio/avr/cores/keyboardio/HardwareSerial1.cpp create mode 100644 hardware/keyboardio/avr/cores/keyboardio/HardwareSerial2.cpp create mode 100644 hardware/keyboardio/avr/cores/keyboardio/HardwareSerial3.cpp create mode 100644 hardware/keyboardio/avr/cores/keyboardio/HardwareSerial_private.h create mode 100644 hardware/keyboardio/avr/cores/keyboardio/IPAddress.cpp create mode 100644 hardware/keyboardio/avr/cores/keyboardio/IPAddress.h rename hardware/keyboardio/{ => avr}/cores/keyboardio/Print.cpp (97%) mode change 100755 => 100644 rename hardware/keyboardio/{ => avr}/cores/keyboardio/Print.h (95%) mode change 100755 => 100644 rename hardware/keyboardio/{ => avr}/cores/keyboardio/Printable.h (98%) create mode 100644 hardware/keyboardio/avr/cores/keyboardio/Server.h rename hardware/keyboardio/{ => avr}/cores/keyboardio/Stream.cpp (99%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/Stream.h (86%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/Tone.cpp (100%) mode change 100755 => 100644 rename hardware/keyboardio/{ => avr}/cores/keyboardio/USBAPI.h (79%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/USBCore.cpp (89%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/USBCore.h (99%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/USBDesc.h (100%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/Udp.h (100%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/WCharacter.h (100%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/WInterrupts.c (100%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/WMath.cpp (100%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/WString.cpp (89%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/WString.h (91%) create mode 100644 hardware/keyboardio/avr/cores/keyboardio/abi.cpp rename hardware/keyboardio/{ => avr}/cores/keyboardio/binary.h (92%) create mode 100644 hardware/keyboardio/avr/cores/keyboardio/hooks.c create mode 100644 hardware/keyboardio/avr/cores/keyboardio/main.cpp create mode 100644 hardware/keyboardio/avr/cores/keyboardio/new.cpp create mode 100644 hardware/keyboardio/avr/cores/keyboardio/new.h rename hardware/keyboardio/{ => avr}/cores/keyboardio/wiring.c (99%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/wiring_analog.c (97%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/wiring_digital.c (98%) rename hardware/keyboardio/{ => avr}/cores/keyboardio/wiring_private.h (93%) mode change 100755 => 100644 rename hardware/keyboardio/{ => avr}/cores/keyboardio/wiring_pulse.c (100%) mode change 100755 => 100644 rename hardware/keyboardio/{ => avr}/cores/keyboardio/wiring_shift.c (100%) mode change 100755 => 100644 create mode 100644 hardware/keyboardio/avr/platform.txt rename hardware/keyboardio/{ => avr}/variants/model00/pins_arduino.h (100%) create mode 100644 hardware/keyboardio/avr/variants/symmetric60/pins_arduino.h delete mode 100644 hardware/keyboardio/boards.txt delete mode 100644 hardware/keyboardio/cores/keyboardio/Client.h delete mode 100644 hardware/keyboardio/cores/keyboardio/HID.cpp delete mode 100644 hardware/keyboardio/cores/keyboardio/HardwareSerial.cpp delete mode 100644 hardware/keyboardio/cores/keyboardio/IPAddress.cpp delete mode 100644 hardware/keyboardio/cores/keyboardio/IPAddress.h delete mode 100644 hardware/keyboardio/cores/keyboardio/Platform.h delete mode 100644 hardware/keyboardio/cores/keyboardio/Server.h delete mode 100644 hardware/keyboardio/cores/keyboardio/avr-libc/malloc.c delete mode 100644 hardware/keyboardio/cores/keyboardio/avr-libc/realloc.c delete mode 100644 hardware/keyboardio/cores/keyboardio/avr-libc/sectionname.h delete mode 100644 hardware/keyboardio/cores/keyboardio/avr-libc/stdlib_private.h delete mode 100644 hardware/keyboardio/cores/keyboardio/license.txt delete mode 100644 hardware/keyboardio/cores/keyboardio/main.cpp delete mode 100644 hardware/keyboardio/cores/keyboardio/new.cpp delete mode 100644 hardware/keyboardio/cores/keyboardio/new.h delete mode 100644 hardware/keyboardio/cores/keyboardio/todo.txt diff --git a/hardware/keyboardio/avr/boards.txt b/hardware/keyboardio/avr/boards.txt new file mode 100644 index 00000000..03ef2680 --- /dev/null +++ b/hardware/keyboardio/avr/boards.txt @@ -0,0 +1,37 @@ +keyboardio.name=Keyboardio Model 00 +keyboardio.upload.protocol=avr109 +keyboardio.upload.maximum_size=28672 +keyboardio.upload.speed=57600 +keyboardio.upload.disable_flushing=true +keyboardio.bootloader.low_fuses=0xff +keyboardio.bootloader.high_fuses=0xd8 +keyboardio.bootloader.extended_fuses=0xcb +keyboardio.bootloader.path=caterina +keyboardio.bootloader.file=Caterina-keyboardio.hex +keyboardio.bootloader.unlock_bits=0x3F +keyboardio.bootloader.lock_bits=0x2F +keyboardio.build.mcu=atmega32u4 +keyboardio.build.f_cpu=16000000L +keyboardio.build.vid=0x2341 +keyboardio.build.pid=0x8037 +keyboardio.build.core=keyboardio +keyboardio.build.variant=model00 + +symmetric60.name=Keyboardio Symmetric 60 +symmetric60.upload.protocol=avr109 +symmetric60.upload.maximum_size=28672 +symmetric60.upload.speed=57600 +symmetric60.upload.disable_flushing=true +symmetric60.bootloader.low_fuses=0xff +symmetric60.bootloader.high_fuses=0xd8 +symmetric60.bootloader.extended_fuses=0xcb +symmetric60.bootloader.path=caterina +symmetric60.bootloader.file=Caterina-symmetric60.hex +symmetric60.bootloader.unlock_bits=0x3F +symmetric60.bootloader.lock_bits=0x2F +symmetric60.build.mcu=atmega32u4 +symmetric60.build.f_cpu=16000000L +symmetric60.build.vid=0x2341 +symmetric60.build.pid=0x8037 +symmetric60.build.core=keyboardio +symmetric60.build.variant=symmetric60 diff --git a/hardware/keyboardio/bootloaders/caterina/Caterina-Esplora.hex b/hardware/keyboardio/avr/bootloaders/caterina/Caterina-Esplora.hex similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Caterina-Esplora.hex rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina-Esplora.hex diff --git a/hardware/keyboardio/bootloaders/caterina/Caterina-Esplora.txt b/hardware/keyboardio/avr/bootloaders/caterina/Caterina-Esplora.txt similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Caterina-Esplora.txt rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina-Esplora.txt diff --git a/hardware/keyboardio/bootloaders/caterina/Caterina-Leonardo.hex b/hardware/keyboardio/avr/bootloaders/caterina/Caterina-Leonardo.hex similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Caterina-Leonardo.hex rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina-Leonardo.hex diff --git a/hardware/keyboardio/bootloaders/caterina/Caterina-Leonardo.txt b/hardware/keyboardio/avr/bootloaders/caterina/Caterina-Leonardo.txt similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Caterina-Leonardo.txt rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina-Leonardo.txt diff --git a/hardware/keyboardio/bootloaders/caterina/Caterina-Model00.hex b/hardware/keyboardio/avr/bootloaders/caterina/Caterina-Model00.hex similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Caterina-Model00.hex rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina-Model00.hex diff --git a/hardware/keyboardio/bootloaders/caterina/Caterina-Model00.txt b/hardware/keyboardio/avr/bootloaders/caterina/Caterina-Model00.txt similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Caterina-Model00.txt rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina-Model00.txt diff --git a/hardware/keyboardio/bootloaders/caterina/Micro-prod-firmware-2012-12-10.hex b/hardware/keyboardio/avr/bootloaders/caterina/Caterina-symmetric60.hex similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Micro-prod-firmware-2012-12-10.hex rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina-symmetric60.hex diff --git a/hardware/keyboardio/bootloaders/caterina/Caterina.c b/hardware/keyboardio/avr/bootloaders/caterina/Caterina.c similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Caterina.c rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina.c diff --git a/hardware/keyboardio/bootloaders/caterina/Caterina.h b/hardware/keyboardio/avr/bootloaders/caterina/Caterina.h similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Caterina.h rename to hardware/keyboardio/avr/bootloaders/caterina/Caterina.h diff --git a/hardware/keyboardio/bootloaders/caterina/Descriptors.c b/hardware/keyboardio/avr/bootloaders/caterina/Descriptors.c similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Descriptors.c rename to hardware/keyboardio/avr/bootloaders/caterina/Descriptors.c diff --git a/hardware/keyboardio/bootloaders/caterina/Descriptors.h b/hardware/keyboardio/avr/bootloaders/caterina/Descriptors.h similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Descriptors.h rename to hardware/keyboardio/avr/bootloaders/caterina/Descriptors.h diff --git a/hardware/keyboardio/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.hex b/hardware/keyboardio/avr/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.hex similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.hex rename to hardware/keyboardio/avr/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.hex diff --git a/hardware/keyboardio/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.txt b/hardware/keyboardio/avr/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.txt similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.txt rename to hardware/keyboardio/avr/bootloaders/caterina/Esplora-prod-firmware-2012-12-10.txt diff --git a/hardware/keyboardio/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.hex b/hardware/keyboardio/avr/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.hex similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.hex rename to hardware/keyboardio/avr/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.hex diff --git a/hardware/keyboardio/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.txt b/hardware/keyboardio/avr/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.txt similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.txt rename to hardware/keyboardio/avr/bootloaders/caterina/Leonardo-prod-firmware-2012-04-26.txt diff --git a/hardware/keyboardio/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.hex b/hardware/keyboardio/avr/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.hex similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.hex rename to hardware/keyboardio/avr/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.hex diff --git a/hardware/keyboardio/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.txt b/hardware/keyboardio/avr/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.txt similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.txt rename to hardware/keyboardio/avr/bootloaders/caterina/Leonardo-prod-firmware-2012-12-10.txt diff --git a/hardware/keyboardio/bootloaders/caterina/Makefile b/hardware/keyboardio/avr/bootloaders/caterina/Makefile similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Makefile rename to hardware/keyboardio/avr/bootloaders/caterina/Makefile diff --git a/hardware/keyboardio/bootloaders/caterina/Micro-prod-firmware-2012-11-23.hex b/hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-11-23.hex similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Micro-prod-firmware-2012-11-23.hex rename to hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-11-23.hex diff --git a/hardware/keyboardio/bootloaders/caterina/Micro-prod-firmware-2012-11-23.txt b/hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-11-23.txt similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Micro-prod-firmware-2012-11-23.txt rename to hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-11-23.txt diff --git a/hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-12-10.hex b/hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-12-10.hex new file mode 100644 index 00000000..804dfd3a --- /dev/null +++ b/hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-12-10.hex @@ -0,0 +1,1024 @@ +:200000000C946E010C9496010C9496010C9496010C9496010C9496010C9496010C94960150 +:200020000C9496010C9496010C94F8040C947F050C9496010C9496010C9496010C949601B6 +:200040000C9496010C9496010C9496010C9496010C9496010C9496010C9496010C94B501C9 +:200060000C9496010C9496010C9496010C9496010C9496010C9496010C9496010C949601C8 +:200080000C9496010C9496010C9496010C9496010C9496010C9496010C9496010C949601A8 +:2000A0000C9496010C9496010C94960100000000240027002A002D003000000000002500A4 +:2000C00028002B002E003100000000002300260029002C002F00040404040403040502027D +:2000E0000202040302020202060606060606040402020204040802011040804010204080A8 +:200100004080080204018040201002011080102040400000000200080E0000030401000BB2 +:200120000000070605040100080A0B0C0D09040309042203410072006400750069006E00CD +:200140006F0020004D006900630072006F00200020002000180341007200640075006900A6 +:200160006E006F0020004C004C00430012010002000000404123378000010102000112011F +:200180000002020000404123378000010102000100C18081C1080B00020202010009040051 +:2001A000000102020000052400100105240101010424020605240600010705810310004094 +:2001C00009040100020A000000070502024000000705830240000005010902A1010901A186 +:2001E000008501050919012903150025019503750181029501750581030501093009310943 +:20020000381581257F750895038106C0C005010906A1018502050719E029E715002501754D +:20022000019508810295017508810395067508150025650507190029658100C0090402004C +:2002400001030000000921010100012265000705840340000100000000000000002A2B2895 +:200260000000000000000000000000000000000000000000002C9EB4A0A1A2A434A6A7A553 +:20028000AE362D3738271E1F20212223242526B333B62EB7B89F8485868788898A8B8C8D58 +:2002A0008E8F909192939495969798999A9B9C9D2F3130A3AD350405060708090A0B0C0D7C +:2002C0000E0F101112131415161718191A1B1C1DAFB1B0B5000032041207170811241FBE81 +:2002E000CFEFDAE0DEBFCDBF11E0A0E0B1E0E4EAF2E102C005900D92AC32B107D9F711E06D +:20030000ACE2B1E001C01D92AD39B107E1F712E0CCEDD2E004C02297FE010E944C09C63D05 +:20032000D107C9F70E946C030C9450090C9400008091000161E00E94390368EE73E080E041 +:2003400090E00E94FD018091000160E00E94390368EE73E080E090E00E94FD010895809196 +:20036000000161E00E94AC0208951F920F920FB60F9211242F933F938F939F93AF93BF93E5 +:200380008091300190913101A0913201B0913301309134010196A11DB11D232F2D5F2D3794 +:2003A00020F02D570196A11DB11D209334018093300190933101A0933201B0933301809117 +:2003C0002C0190912D01A0912E01B0912F010196A11DB11D80932C0190932D01A0932E01BA +:2003E000B0932F01BF91AF919F918F913F912F910F900FBE0F901F9018959B01AC017FB734 +:20040000F89480912C0190912D01A0912E01B0912F0166B5A89B05C06F3F19F00196A11DC3 +:20042000B11D7FBFBA2FA92F982F8827860F911DA11DB11D62E0880F991FAA1FBB1F6A9577 +:20044000D1F7BC012DC0FFB7F89480912C0190912D01A0912E01B0912F01E6B5A89B05C0E7 +:20046000EF3F19F00196A11DB11DFFBFBA2FA92F982F88278E0F911DA11DB11DE2E0880FFD +:20048000991FAA1FBB1FEA95D1F7861B970B885E9340C8F2215030404040504068517C4F8F +:2004A000211531054105510571F60895789484B5826084BD84B5816084BD85B5826085BD0F +:2004C00085B5816085BDEEE6F0E0808181608083E1E8F0E010828081826080838081816043 +:2004E0008083E0E8F0E0808181608083E1E9F0E0808182608083808181608083E0E9F0E07E +:20050000808181608083E1ECF0E0808184608083808182608083808181608083E3ECF0E007 +:20052000808181608083E0ECF0E0808182608083E2ECF0E0808181608083EAE7F0E080812F +:20054000846080838081826080838081816080838081806880830895CF93DF93482F50E0E5 +:20056000CA018C509F4FFC0134914A525F4FFA018491882369F190E0880F991FFC01E455D0 +:20058000FF4FA591B491FC01E654FF4FC591D491662351F42FB7F8948C91932F9095892362 +:2005A0008C93888189230BC0623061F42FB7F8948C91932F909589238C938881832B8883B2 +:2005C0002FBF06C09FB7F8948C91832B8C939FBFDF91CF910895883071F1893068F48230EF +:2005E00031F1833020F4813009F042C01DC0833089F08430E9F512C08B3059F18C3028F41C +:200600008930E9F08A30A1F51EC08C3031F18E3079F529C0809180008F7703C0809180003C +:200620008F7D80938000089584B58F7702C084B58F7D84BD0895809190008F7707C08091DB +:2006400090008F7D03C080919000877F8093900008958091C0008F7703C08091C0008F7DDD +:200660008093C00008958091C200877F8093C2000895FF920F931F93F62E482F50E0CA0144 +:200680008E5E9E4FFC012491CA018C509F4FFC0114914A525F4FFA0104910023C9F022239D +:2006A00019F0822F0E94EB02E02FF0E0EE0FFF1FE654FF4FA591B4919FB7F894FF2021F4DE +:2006C0008C911095812302C08C91812B8C939FBF1F910F91FF900895CF93DF930E94560262 +:2006E0008DE391E00E9433040E94AF01C0E0D0E00E9498012097E1F30E940000F9CF282F17 +:20070000809137018823C1F057FF1AC015C0289A909336018091F1008193E217F307B9F75A +:200720004115510539F08091F200882319F48BE68093E800AFBF02C04FEF5FEFCA01089599 +:20074000AFB7F89427702093E9008091F200282F30E0241735070CF4A901FB019B01240F1E +:20076000311D94E6DACFDF93CF930F92CDB7DEB7BE016F5F7F4F41E050E00E947F03019712 +:2007800019F02FEF3FEF03C08981282F30E0C9010F90CF91DF910895FF920F931F93F82EEF +:2007A000142F052F40913A0150913B01212F302FC901DC01FB016EEF29C0F7FE02C0949125 +:2007C00001C09081209138013091390124173507ACF48091E8008570E1F38091E80082FF0F +:2007E00003C02FEF3FEF17C09093F100C90101968F739070892B11F46093E8002F5F3F4FEC +:200800003093390120933801119731961097A9F6812F902F9C01C9011F910F91FF900895E8 +:200820009C018091E80082FFFCCFF901260F311D03C08091F1008193E217F307D1F7289A03 +:2008400084E6809336018BEF8093E800CB0108958093E9008091F200882319F08AE38093D3 +:20086000E800089508951092370181E08093D70080EA8093D80082E189BD09B400FEFDCFAC +:2008800061E070E080E090E00E94FD0180E98093D8008CE08093E2001092E000559A209A77 +:2008A0005D98289808955F926F927F928F929F92AF92BF92CF92DF92EF92FF920F931F93C7 +:2008C000CF93DF93E82E842E752E80913701882371F18B01242F352FC901EC017AEFF72EFB +:2008E00067E0962E9E2050E4552E8E2D90E040E2A42EB12CA822B9223AE3632E20E4C22E35 +:20090000D12CC822D92258C09FB7F8949092E9008091E80085FD02C020E004C08091F200EC +:20092000252D281B9FBF222361F4FA9419F42FEF3FEF4DC061E070E080E090E00E94FD0135 +:200940003BC0822F90E0C817D9070CF42C2FC21BD1094FB7F8949092E900A114B10421F48E +:2009600006C01092F10021502223D9F719C0E7FC03C0F801922F10C0C801322F06C0FC01A2 +:200980000196E491E093F10031503323C1F706C081918093F10091509923D1F7020F111DD8 +:2009A0008091E80085FF05C0209729F4C114D10411F06092E8004FBF209709F0A5CF5D9A73 +:2009C00084E680933501282D372DC9019C01C901DF91CF911F910F91FF90EF90DF90CF907E +:2009E000BF90AF909F908F907F906F905F9008951F920F920FB60F9211242F933F934F931E +:200A00005F936F937F938F939F93AF93BF93EF93FF938091E1001092E100982F83FF0FC047 +:200A20001092E90081E08093EB001092EC0082E38093ED001092370188E08093F00092FF03 +:200A400034C083E08093E9008091F200882319F08AE38093E8008FB7F89492E09093E900D4 +:200A60009091F2008FBF992321F082E891E00E94550780913501882351F080913501815024 +:200A80008093350180913501882309F45D9880913601882351F08091360181508093360192 +:200AA00080913601882309F42898FF91EF91BF91AF919F918F917F916F915F914F913F91E6 +:200AC0002F910F900FBE0F901F9018950F931F93DF93CF930F92CDB7DEB719828E010F5F75 +:200AE0001F4FC8010E947B07C8010E941409898190E00F90CF91DF911F910F9108951F928C +:200B00000F920FB60F921124EF92FF921F932F933F934F935F936F937F938F939F93AF93C3 +:200B2000BF93EF93FF93DF93CF93CDB7DEB76197DEBFCDBF1092E9008091E80083FF0FC16B +:200B4000FE0131969E01275F3F4F03C08091F1008193E217F307D1F7289A84E68093360112 +:200B600082EF8093E800998197FF05C08091E80080FFFCCF03C08EEF8093E800292F30E0AE +:200B8000C90180769070892B09F0C2C08A81882329F41092F1001092F100D6C0813009F429 +:200BA000D3C0833009F4D0C0853049F48091E80080FFFCCF8B8180688093E300C5C0863008 +:200BC00009F07CC01C81EF80F8841230C1F51092E900109239011092380110923B0110929E +:200BE0003A010E94660599E0FE013996DF01292F1D922A95E9F799871A8791E09E8790E811 +:200C0000988B9AEF998B2091380130913901275F3F4F3C872B878D871092E900109239011B +:200C200010923801F0923B01E0923A0180E0BF0149E050E00E94CC030E94660585C0109290 +:200C4000E9001092390110923801F0923B01E0923A01123241F482E290E00E940C09892BD1 +:200C600009F476C071C0113079F488E0E816F10419F481E080933C0180913C01882309F057 +:200C80006BC0ECE6F1E013C0133009F061C08B81882319F4EEE2F1E00AC0823019F4E2E3A3 +:200CA000F1E005C0813009F053C0E4E5F1E0449180E8BF0150E00E94CC0346C0873009F4EF +:200CC00047C0883021F481E08093F1003DC08930D9F523703070232BD9F5E1E9F1E091E0FC +:200CE00031E026E39093E9003093EB0084918093EC002093ED009F5F3196953099F78EE7DD +:200D00008093EA001092EA008B81809337011CC08F8198851092E9001092390110923801A8 +:200D200090933B0180933A018D81882329F4CE0101960E94870706C0823051F4CE01019677 +:200D40000E94DD07882321F08EEF8093E80007C081E28093EB0003C0EEE7F1E0A8CF6196DA +:200D6000DEBFCDBFCF91DF91FF91EF91BF91AF919F918F917F916F915F914F913F912F911A +:200D80001F91FF90EF900F900FBE0F901F90189520917E0130917F01809180019091810188 +:200DA000281B390B2F733070C901089520917E0130917F01809180019091810128173907DE +:200DC00019F42FEF3FEF09C0E0918001F0918101E25CFE4F8081282F30E0C90108952091F1 +:200DE0007E0130917F0180918001909181012817390719F42FEF3FEF13C0E0918001F091E0 +:200E00008101E25CFE4F2081809180019091810101968F739070909381018093800130E00D +:200E2000C9010895109285011092840188EE93E0A0E0B0E08093860190938701A093880102 +:200E4000B093890180E191E0909383018093820108950F931F93DF93CF930F92CDB7DEB737 +:200E60008C01698380910901882369F083E0BE016F5F7F4F41E050E00E9453041816190685 +:200E800014F49C0107C081E090E0F8019383828320E030E0C9010F90CF91DF911F910F9168 +:200EA000089583E00E9428040895CF93DF9312C082E00E94B3032FEF8F3F9207C9F0E091B8 +:200EC0007E01F0917F01E25CFE4F8083D0937F01C0937E01C0917E01D0917F012196CF73A5 +:200EE000D0708091800190918101C817D90701F7DF91CF910895FC0180818E5F808380E803 +:200F000065E971E042E450E00E94CC030895FC0181819081913A59F4813209F04CC080E08E +:200F200062E071E047E050E00E94CC0342C0913209F041C0803239F482E091E067E070E04E +:200F40000E94100436C0823209F035C08281809309018091020190910301A0910401B09173 +:200F60000501805B9440A040B04019F58091090180FD12C087E797E7909301088093000841 +:200F80002BE088E190E00FB6F894A895809360000FBE209360000DC088E10FB6F8948093F2 +:200FA0006000109260000FBEA895109201081092000881E0089580E00895FC019181808165 +:200FC000813A31F4913089F080E0933089F40DC0813269F49B3021F4828180930A0105C0B4 +:200FE0009A3029F4828180930B0181E0089580E00895EF92FF920F931F938C01E62EDC0109 +:20100000ED91FC910480F581E02D0995F82ED801ED91FC910680F781E02DC8016E2D099509 +:201020008F2D90E01F910F91FF90EF90089510929001109294011092930182E291E09093F1 +:201040009201809391010895EF92FF920F931F93DF93CF930F92CDB7DEB789838B017A01B4 +:2010600084E0BE016F5F7F4F41E050E00E94530484E4B801A7010E9453040F90CF91DF9136 +:201080001F910F91FF90EF90089582E048E050E00E9424080895FC011682178210861186D5 +:2010A0001286138614823496BF010E9445080895DC01683810F0685829C0E62FF0E067FFE2 +:2010C00013C0E058F04081E090E002C0880F991FEA95E2F7809514962C911497282314967F +:2010E0002C93149760E012C0EB5AFD4F6491662319F420E030E01DC067FF08C014968C9176 +:2011000014978D7F14968C9314976F77FD0190E0662321F08681861709F416829F5F3196B8 +:201120009630B1F7CD011496BD010E94450821E030E0C9010895CF93DF93DC01683810F053 +:20114000685825C0E62FF0E067FF12C0E058F04081E090E002C0880F991FEA95E2F7149681 +:201160002C911497282B14962C93149760E00FC0EB5AFD4F64916623D9F167FF08C01496E0 +:201180008C911497826014968C9314976F7716968C9116978617A9F117968C911797861789 +:2011A00081F118968C911897861759F119968C911997861731F11A968C911A97861709F10C +:2011C0001B968C911B978617E1F0ED01E0E0F0E09E2F8E81882321F4EA0FFB1F668306C045 +:2011E0009F5F31962196E630F10591F7963049F481E090E013969C938E93129720E030E059 +:2012000007C0CD011496BD010E94450821E030E0C901DF91CF91089580E867ED71E045E662 +:2012200050E00E94CC030895FC0180818F5F808380E86CE372E049E150E00E94CC03089510 +:20124000CF92DF92EF92FF920F931F93CF93DF937C016B018A01C0E0D0E00FC0D6016D911A +:201260006D01D701ED91FC910190F081E02DC7010995C80FD91F015010400115110571F7A4 +:20128000CE01DF91CF911F910F91FF90EF90DF90CF900895EE0FFF1F0590F491E02D099407 +:2012A000F894FFCF0D0000E100000000000001010000000029072009C806EF06D606510794 +:2012C000550700000000F90720099B0858084B08FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:2012E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E +:20130000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED +:20132000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD +:20134000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAD +:20136000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8D +:20138000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6D +:2013A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4D +:2013C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2D +:2013E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF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FFFFFFFFFFFFFFFFFFFFFFFD2 +:206EE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB2 +:206F0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91 +:206F2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF71 +:206F4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF51 +:206F6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF31 +:206F8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11 +:206FA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1 +:206FC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD1 +:206FE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:2070000055C000006EC000006CC000006AC0000068C0000066C0000064C0000062C0000043 +:2070200060C000005EC00000F2C400005AC0000058C0000056C0000054C0000052C00000EE +:2070400050C0000078C000004CC000004AC0000048C0000046C0000044C0000042C00000BE +:2070600040C000003EC000003CC000003AC0000038C0000036C0000034C0000032C0000048 +:2070800030C000002EC000002CC000002AC0000028C0000026C0000024C0000022C00000A8 +:2070A00020C000001EC000001CC0000011241FBECFEFDAE0DEBFCDBF11E0A0E0B1E0E2E3BC +:2070C000FFE702C005900D92A83AB107D9F711E0A8EAB1E001C01D92AE3BB107E1F78FD30B +:2070E00026C78ECFF89410926F0010928100109285001092840081E085BF15BE47985D98ED +:2071000028980C94000008952091B2013091B3012F5F3F4F3093B3012093B201932F37FFA8 +:2071200003C08EEF831B982F990F921710F447980895479A08951F920F920FB60F9211246E +:207140002F938F939F93EF93FF9310928500109284008091A8019091A901009741F00197D3 +:207160009093A9018093A801892B09F45D988091AA019091AB01009741F001979093AB0128 +:207180008093AA01892B09F42898E0E0F0E0859194918F5F9F4F49F08091AC019091AD0153 +:2071A00001969093AD018093AC01FF91EF919F918F912F910F900FBE0F901F90189584E0BC +:2071C0008093E9000DC08091E8008B778093E80003C08EB3882351F08091E80082FFF9CFBE +:2071E0008091E80085FFEFCF8091F1000895982F83E08093E9008091E80085FD0DC0809136 +:20720000E8008E778093E80003C08EB3882369F08091E80080FFF9CF9093F1005D9A84E6C9 +:2072200090E09093A9018093A80108954F925F926F927F928F929F92AF92BF92CF92DF921E +:20724000EF92FF920F931F93CF93DF9384E08093E9008091E80082FF57C2289A84E690E065 +:207260009093AB018093AA01AADF182F853481F48CE49DE19093AD018093AC0107B600FC4B +:20728000FDCFF999FECF81E180935700E89503C0843519F494DF8DE00DC28C34E1F38035F9 +:2072A000D1F3843721F484E4A2DF80E003C2813611F489E5FFC18134B1F481DF182F7FDFE3 +:2072C00090E0880F991FAA2797FDA095BA2F312F330F20E0442737FD4095542F822B932B68 +:2072E000A42BB52BB8C1803711F483E5E3C1833549F4C0E0D1E089917ADF21E0C730D20714 +:20730000D1F7D9C1863521F481E371DF80E3D2C1833731F487E86BDF85E969DF8EE1CAC149 +:207320008536B9F4E0E0F0E093E085E090935700E89507B600FCFDCF80935700E89507B65D +:2073400000FCFDCFE058FF4FA0E7E030FA0771F7A2CF823739F4E1E0F0E089E08093570024 +:207360008491A8C1863439F4E0E0F0E089E08093570084919FC18E3439F4E3E0F0E089E0E5 +:2073800080935700849196C1813539F4E2E0F0E089E08093570084918DC1823631F489E521 +:2073A00026DF80E024DF80E885C1823419F0873609F0E5C01092AD011092AC0100DF082FE8 +:2073C000FEDEF82EFCDE682E8554823008F071C1902F80E0CF2DD0E0C82BD92B10926F00B3 +:2073E000173609F04BC081E180935700E895DD24CC24C3943FC0E090AE01F090AF010091CC +:20740000B0011091B101B6E46B16D9F4ED2DF0E0EE29FF29E4918E2FEADEDD2081F082E08D +:2074200090E0A0E0B0E0E80EF91E0A1F1B1FE092AE01F092AF010093B0011093B101DC2470 +:2074400018C0D801C701B695A7959795879559D5CEDE82E090E0A0E0B0E0E80EF91E0A1FF2 +:207460001B1FE092AE01F092AF010093B0011093B1012197209709F0BECF7DC08090AE01F5 +:207480009090AF01A090B001B090B10196E4691609F05DC083E0F40180935700E89507B63E +:2074A00000FCFDCF54C0F6E46F1661F5772031F1E090AE01F090AF010091B0011091B1019E +:2074C0007EDED82ECC24852D90E08C299D29F7010C0140925700E895112482E090E0A0E08B +:2074E000B0E0E80EF91E0A1F1B1FE092AE01F092AF010093B0011093B10102C060DE582E1A +:20750000742423C0E090AE01F090AF010091B0011091B10116950795F794E79450DE682FFA +:20752000C701F7D48091AE019091AF01A091B001B091B1010296A11DB11D8093AE01909349 +:20754000AF01A093B001B093B101219704C05524772444244394209709F0A5CF96E46916B6 +:2075600041F485E0F40180935700E89507B600FCFDCF8DE03CDE82E080936F009CC0833492 +:2075800071F40091AE011091AF0119DE90E021E0F8010C0120935700E89511247CCE8336C8 +:2075A00019F5E090AE01F090AF010091B0011091B10105DEF701E16090E021E00C0120938C +:2075C0005700E895112482E090E0A0E0B0E0E80EF91E0A1F1B1FE092AE01F092AF0100936A +:2075E000B0011093B10157CE8D3661F4E091AE01F091AF0185E080935700E89507B600FCF2 +:20760000FDCF49CE823551F4E091AE01F091AF0105911491812FEBDD802F4CC0843421F5FE +:20762000E090AE01F090AF010091B0011091B10116950795F794E794C2DD682FC70169D4DE +:207640008091AE019091AF01A091B001B091B1010296A11DB11D8093AE019093AF01A093D8 +:20766000B001B093B10117CE843609F5E090AE01F090AF010091B0011091B101D801C70142 +:20768000B695A795979587953CD4B1DD82E090E0A0E0B0E0E80EF91E0A1F1B1FE092AE010A +:2076A000F092AF010093B0011093B10104C08B3111F08FE39CDD83E08093E9009091E8002B +:2076C0008091E8008E778093E80095FF04C010C08EB38823C9F08091E80080FFF9CF809193 +:2076E000E8008E778093E80003C08EB3882361F08091E80080FFF9CF84E08093E9008091F1 +:20770000E8008B778093E800DF91CF911F910F91FF90EF90DF90CF90BF90AF909F908F90AC +:207720007F906F905F904F9008959091B601892F8F77813249F58091B7018032A1F081328A +:2077400019F5913A09F58091E800877F8093E8008DE091E067E070E00BD28091E8008B770B +:207760008093E8000895913279F48091E800877F8093E8008DE091E067E070E05DD2809192 +:20778000E8008E778093E800089582E061EC42E0B5D083E061E842E1B1D084E060E842E1EF +:2077A000ADC084B7877F84BF88E10FB6F89480936000109260000FBE20E880E090E00FB63F +:2077C000F89420936100809361000FBE81E085BF92E095BF3F9A209A559AE1E6F0E02083A1 +:2077E000108247985D982898109289008AEF8093880090936F0083E080938100F0C040911A +:20780000000850910108109201081092000894B714BE88E10FB6F8948093600010926000D5 +:207820000FBE292F30E0F901E270F07091FD18C090FF05C0859194918F5F9F4F81F423FFFF +:207840000FC08091090190910A014817590741F0E0E0F0E0859194918F5F9F4F09F042DC64 +:20786000A0DF78941092AD011092AC010CC0DEDC36D38091AC019091AD0181549F4110F00D +:207880001092140141DC80911401882381F78091E00081608093E00025DC80E090E0089598 +:2078A000FA01923049F0933061F09130F9F485E191E022E130E01EC087E291E02EE330E04D +:2078C00019C0882329F485E691E024E030E012C0813029F489E691E022E230E00BC0823006 +:2078E00029F48DE891E028E130E004C080E090E020E030E091838083C90108958093E9004E +:207900008091EB0081608093EB001092ED006093EC004093ED008091EE00881F8827881F62 +:2079200008958091B60188238CF403C08EB38823B1F08091E80082FFF9CF8091E8008B772A +:207940008093E80008958EB3882349F08091E80080FFF9CF8091E8008E778093E800089594 +:20796000EF92FF920F931F9345D04CD008ED10E0F80180818F77808380818068808380819B +:207980008F7D808319BC1EBA1092B40180EEE82EF12CF70180818B7F8083F8018081816052 +:2079A000808380E060E042E0A9DFE1EEF0E080818E7F8083E2EEF0E0808181608083808144 +:2079C00088608083F70180818E7F8083F8018081806180831F910F91FF90EF900895E7ED06 +:2079E000F0E08081816080838AE482BF81E08093B501B6CFE8EDF0E080818E7F808310921C +:207A0000E20008951092DA001092E10008951F920F920FB60F9211242F933F934F935F93F6 +:207A20006F937F938F939F93AF93BF93EF93FF938091DA0080FF1BC08091D80080FF17C0B2 +:207A40008091DA008E7F8093DA008091D90080FF0BC080E189BD82E189BD09B400FEFDCF36 +:207A600081E08EBB3BD203C019BC1EBA37D28091E10080FF17C08091E20080FF13C0809138 +:207A8000E2008E7F8093E2008091E20080618093E2008091D80080628093D80019BC85E049 +:207AA0008EBB1CD28091E10084FF2CC08091E20084FF28C080E189BD82E189BD09B400FEC5 +:207AC000FDCF8091D8008F7D8093D8008091E1008F7E8093E1008091E2008F7E8093E20012 +:207AE0008091E20081608093E2008091B401882331F48091E30087FD02C081E001C084E067 +:207B00008EBBECD18091E10083FF21C08091E20083FF1DC08091E100877F8093E10082E06A +:207B20008EBB1092B4018091E1008E7F8093E1008091E2008E7F8093E2008091E2008061E9 +:207B40008093E20080E060E042E0D8DEC7D1FF91EF91BF91AF919F918F917F916F915F9130 +:207B60004F913F912F910F900FBE0F901F9018959C014091BC015091BD014617570718F49D +:207B8000F90190E044C06115710511F0AB01F8CF8091E8008E778093E80040E050E0F0CF0F +:207BA0008EB3882309F444C0853009F443C08091E80083FF02C081E008958091E80082FD70 +:207BC00031C08091E80080FF22C08091F3009091F200782F60E0292F30E0262B372B07C07A +:207BE00081918093F100415050402F5F3F4F4115510519F02830310598F390E02830310566 +:207C000009F491E08091E8008E778093E8004115510531F6992321F605C08EB3882341F075 +:207C2000853041F08091E80082FFF7CF80E0089582E0089583E008959C016115710529F47C +:207C40008091E8008B778093E800F90126C08EB3882391F1853091F18091E80083FF02C06C +:207C600081E008958091E80082FFF1CF06C08091F10081936150704059F02091F300809191 +:207C8000F200322F20E090E0822B932B892B79F78091E8008B778093E80061157105B9F601 +:207CA00005C08EB3882341F0853041F08091E80080FFF7CF80E0089582E0089583E00895C2 +:207CC0000F931F93DF93CF9300D0CDB7DEB7E6EBF1E08091F100819381E0EE3BF807C9F792 +:207CE00024DD8091E80083FFE4C08091B6019091B701953009F46DC0963040F4913081F1A7 +:207D0000913070F0933009F0D4C02AC0983009F4A3C0993009F4B2C0963009F0CAC07CC023 +:207D2000803809F4C6C0823809F0C3C08091BA0187708093E9008091EB001092E9002091DB +:207D4000E800277F2093E80090E025E0969587952A95E1F781708093F1001092F10087C0D8 +:207D6000882319F0823009F0A4C08F71823009F0A0C08091B801882331F52091BA01277097 +:207D800009F497C02093E9008091EB0080FF1BC0933021F48091EB00806213C08091EB0018 +:207DA00080618093EB0081E090E002C0880F991F2A95E2F78093EA001092EA008091EB00E5 +:207DC00088608093EB001092E9008091E800877F51C0882309F06DC01091B8011F770FB79B +:207DE000F8948091E800877F8093E8009ADD8091E80080FFFCCF8091E3008078812B809398 +:207E0000E30080688093E300112311F482E001C083E08EBB0FBF4DC08058823008F049C033 +:207E20008091B8019091B9016091BA01AE014F5F5F4F36DDBC01009709F43BC08091E8008E +:207E4000877F8093E80089819A8192DE8091E8008B778093E8002DC0803859F58091E800AA +:207E6000877F8093E8008091B4018093F1008091E8008E778093E80054DD1BC08823C9F4CA +:207E80009091B8019230A8F48091E800877F8093E8009093B40145DD8091B401882331F420 +:207EA0008091E30087FD02C081E001C084E08EBB6CDC8091E80083FF0AC08091EB0080624E +:207EC0008093EB008091E800877F8093E8000F900F90CF91DF911F910F91089508951F9360 +:207EE0008EB3882361F01091E9001092E9008091E80083FF01C0E4DE17701093E9001F916F +:207F00000895F999FECF92BD81BDF89A992780B50895262FF999FECF1FBA92BD81BD20BDBD +:207F20000FB6F894FA9AF99A0FBE01960895F894FFCF4341544552494E4100777700080031 +:207F40000000000000080112011001020000084123370001000201000109023E00020100FE +:207F600080320904000001020201000524001001042402040524060001070582030800FF0C +:207F800009040100020A000000070504021000010705830210000104030904220341007216 +:207FA000006400750069006E006F0020004D006900630072006F0020002000200000001810 +:1A7FC00003410072006400750069006E006F0020004C004C004300000000D7 +:00000001FF diff --git a/hardware/keyboardio/bootloaders/caterina/Micro-prod-firmware-2012-12-10.txt b/hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-12-10.txt similarity index 100% rename from hardware/keyboardio/bootloaders/caterina/Micro-prod-firmware-2012-12-10.txt rename to hardware/keyboardio/avr/bootloaders/caterina/Micro-prod-firmware-2012-12-10.txt diff --git a/hardware/keyboardio/cores/keyboardio/Arduino.h b/hardware/keyboardio/avr/cores/keyboardio/Arduino.h old mode 100755 new mode 100644 similarity index 78% rename from hardware/keyboardio/cores/keyboardio/Arduino.h rename to hardware/keyboardio/avr/cores/keyboardio/Arduino.h index 3b9ccca3..ac775f13 --- a/hardware/keyboardio/cores/keyboardio/Arduino.h +++ b/hardware/keyboardio/avr/cores/keyboardio/Arduino.h @@ -1,7 +1,27 @@ +/* + Arduino.h - Main include file for the Arduino SDK + Copyright (c) 2005-2013 Arduino Team. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + #ifndef Arduino_h #define Arduino_h #include +#include #include #include @@ -15,6 +35,8 @@ extern "C"{ #endif +void yield(void); + #define HIGH 0x1 #define LOW 0x0 @@ -22,14 +44,12 @@ extern "C"{ #define OUTPUT 0x1 #define INPUT_PULLUP 0x2 -#define true 0x1 -#define false 0x0 - #define PI 3.1415926535897932384626433832795 #define HALF_PI 1.5707963267948966192313216916398 #define TWO_PI 6.283185307179586476925286766559 #define DEG_TO_RAD 0.017453292519943295769236907684886 #define RAD_TO_DEG 57.295779513082320876798154814105 +#define EULER 2.718281828459045235360287471352 #define SERIAL 0x0 #define DISPLAY 0x1 @@ -85,6 +105,10 @@ extern "C"{ #define bitClear(value, bit) ((value) &= ~(1UL << (bit))) #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) +// avr-libc defines _NOP() since 1.6.2 +#ifndef _NOP +#define _NOP() do { __asm__ volatile ("nop"); } while (0) +#endif typedef unsigned int word; @@ -94,6 +118,9 @@ typedef uint8_t boolean; typedef uint8_t byte; void init(void); +void initVariant(void); + +int atexit(void (*func)()) __attribute__((weak)); void pinMode(uint8_t, uint8_t); void digitalWrite(uint8_t, uint8_t); @@ -149,6 +176,8 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[]; #define NOT_A_PIN 0 #define NOT_A_PORT 0 +#define NOT_AN_INTERRUPT -1 + #ifdef ARDUINO_MAIN #define PA 1 #define PB 2 @@ -168,20 +197,21 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[]; #define TIMER0B 2 #define TIMER1A 3 #define TIMER1B 4 -#define TIMER2 5 -#define TIMER2A 6 -#define TIMER2B 7 - -#define TIMER3A 8 -#define TIMER3B 9 -#define TIMER3C 10 -#define TIMER4A 11 -#define TIMER4B 12 -#define TIMER4C 13 -#define TIMER4D 14 -#define TIMER5A 15 -#define TIMER5B 16 -#define TIMER5C 17 +#define TIMER1C 5 +#define TIMER2 6 +#define TIMER2A 7 +#define TIMER2B 8 + +#define TIMER3A 9 +#define TIMER3B 10 +#define TIMER3C 11 +#define TIMER4A 12 +#define TIMER4B 13 +#define TIMER4C 14 +#define TIMER4D 15 +#define TIMER5A 16 +#define TIMER5B 17 +#define TIMER5C 18 #ifdef __cplusplus } // extern "C" @@ -191,6 +221,10 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[]; #include "WCharacter.h" #include "WString.h" #include "HardwareSerial.h" +#include "USBAPI.h" +#if defined(HAVE_HWSERIAL0) && defined(HAVE_CDCSERIAL) +#error "Targets with both UART0 and CDC serial not supported" +#endif uint16_t makeWord(uint16_t w); uint16_t makeWord(byte h, byte l); diff --git a/hardware/keyboardio/cores/keyboardio/CDC.cpp b/hardware/keyboardio/avr/cores/keyboardio/CDC.cpp similarity index 67% rename from hardware/keyboardio/cores/keyboardio/CDC.cpp rename to hardware/keyboardio/avr/cores/keyboardio/CDC.cpp index e1e859d1..5d4f2a08 100644 --- a/hardware/keyboardio/cores/keyboardio/CDC.cpp +++ b/hardware/keyboardio/avr/cores/keyboardio/CDC.cpp @@ -16,28 +16,12 @@ ** SOFTWARE. */ -#include "Platform.h" #include "USBAPI.h" #include #if defined(USBCON) #ifdef CDC_ENABLED -#if (RAMEND < 1000) -#define SERIAL_BUFFER_SIZE 16 -#else -#define SERIAL_BUFFER_SIZE 64 -#endif - -struct ring_buffer -{ - unsigned char buffer[SERIAL_BUFFER_SIZE]; - volatile int head; - volatile int tail; -}; - -ring_buffer cdc_rx_buffer = { { 0 }, 0, 0}; - typedef struct { u32 dwDTERate; @@ -95,102 +79,81 @@ bool WEAK CDC_Setup(Setup& setup) if (CDC_SET_LINE_CODING == r) { USB_RecvControl((void*)&_usbLineInfo,7); - return true; } if (CDC_SET_CONTROL_LINE_STATE == r) { _usbLineInfo.lineState = setup.wValueL; + } + if (CDC_SET_LINE_CODING == r || CDC_SET_CONTROL_LINE_STATE == r) + { // auto-reset into the bootloader is triggered when the port, already // open at 1200 bps, is closed. this is the signal to start the watchdog // with a relatively long period so it can finish housekeeping tasks // like servicing endpoints before the sketch ends - if (1200 == _usbLineInfo.dwDTERate) { - // We check DTR state to determine if host port is open (bit 0 of lineState). - if ((_usbLineInfo.lineState & 0x01) == 0) { - *(uint16_t *)0x0800 = 0x7777; - wdt_enable(WDTO_120MS); - } else { - // Most OSs do some intermediate steps when configuring ports and DTR can - // twiggle more than once before stabilizing. - // To avoid spurious resets we set the watchdog to 250ms and eventually - // cancel if DTR goes back high. - - wdt_disable(); - wdt_reset(); - *(uint16_t *)0x0800 = 0x0; - } + + // We check DTR state to determine if host port is open (bit 0 of lineState). + if (1200 == _usbLineInfo.dwDTERate && (_usbLineInfo.lineState & 0x01) == 0) + { + *(uint16_t *)0x0800 = 0x7777; + wdt_enable(WDTO_120MS); + } + else + { + // Most OSs do some intermediate steps when configuring ports and DTR can + // twiggle more than once before stabilizing. + // To avoid spurious resets we set the watchdog to 250ms and eventually + // cancel if DTR goes back high. + + wdt_disable(); + wdt_reset(); + *(uint16_t *)0x0800 = 0x0; } - return true; } + return true; } return false; } -int _serialPeek = -1; -void Serial_::begin(unsigned long baud_count) +void Serial_::begin(unsigned long /* baud_count */) { + peek_buffer = -1; } -void Serial_::begin(unsigned long baud_count, byte config) +void Serial_::begin(unsigned long /* baud_count */, byte /* config */) { + peek_buffer = -1; } void Serial_::end(void) { } -void Serial_::accept(void) -{ - ring_buffer *buffer = &cdc_rx_buffer; - int i = (unsigned int)(buffer->head+1) % SERIAL_BUFFER_SIZE; - - // if we should be storing the received character into the location - // just before the tail (meaning that the head would advance to the - // current location of the tail), we're about to overflow the buffer - // and so we don't write the character or advance the head. - - // while we have room to store a byte - while (i != buffer->tail) { - int c = USB_Recv(CDC_RX); - if (c == -1) - break; // no more data - buffer->buffer[buffer->head] = c; - buffer->head = i; - - i = (unsigned int)(buffer->head+1) % SERIAL_BUFFER_SIZE; - } -} - int Serial_::available(void) { - ring_buffer *buffer = &cdc_rx_buffer; - return (unsigned int)(SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % SERIAL_BUFFER_SIZE; + if (peek_buffer >= 0) { + return 1 + USB_Available(CDC_RX); + } + return USB_Available(CDC_RX); } int Serial_::peek(void) { - ring_buffer *buffer = &cdc_rx_buffer; - if (buffer->head == buffer->tail) { - return -1; - } else { - return buffer->buffer[buffer->tail]; - } + if (peek_buffer < 0) + peek_buffer = USB_Recv(CDC_RX); + return peek_buffer; } int Serial_::read(void) { - ring_buffer *buffer = &cdc_rx_buffer; - // if the head isn't ahead of the tail, we don't have any characters - if (buffer->head == buffer->tail) { - return -1; - } else { - unsigned char c = buffer->buffer[buffer->tail]; - buffer->tail = (unsigned int)(buffer->tail + 1) % SERIAL_BUFFER_SIZE; + if (peek_buffer >= 0) { + int c = peek_buffer; + peek_buffer = -1; return c; - } + } + return USB_Recv(CDC_RX); } void Serial_::flush(void) @@ -199,6 +162,11 @@ void Serial_::flush(void) } size_t Serial_::write(uint8_t c) +{ + return write(&c, 1); +} + +size_t Serial_::write(const uint8_t *buffer, size_t size) { /* only try to send bytes if the high-level CDC connection itself is open (not just the pipe) - the OS should set lineState when the port @@ -210,7 +178,7 @@ size_t Serial_::write(uint8_t c) // open connection isn't broken cleanly (cable is yanked out, host dies // or locks up, or host virtual serial port hangs) if (_usbLineInfo.lineState > 0) { - int r = USB_Send(CDC_TX,&c,1); + int r = USB_Send(CDC_TX,buffer,size); if (r > 0) { return r; } else { diff --git a/hardware/keyboardio/avr/cores/keyboardio/Client.h b/hardware/keyboardio/avr/cores/keyboardio/Client.h new file mode 100644 index 00000000..b8e5d935 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/Client.h @@ -0,0 +1,45 @@ +/* + Client.h - Base class that provides Client + Copyright (c) 2011 Adrian McEwen. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef client_h +#define client_h +#include "Print.h" +#include "Stream.h" +#include "IPAddress.h" + +class Client : public Stream { + +public: + virtual int connect(IPAddress ip, uint16_t port) =0; + virtual int connect(const char *host, uint16_t port) =0; + virtual size_t write(uint8_t) =0; + virtual size_t write(const uint8_t *buf, size_t size) =0; + virtual int available() = 0; + virtual int read() = 0; + virtual int read(uint8_t *buf, size_t size) = 0; + virtual int peek() = 0; + virtual void flush() = 0; + virtual void stop() = 0; + virtual uint8_t connected() = 0; + virtual operator bool() = 0; +protected: + uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; +}; + +#endif diff --git a/hardware/keyboardio/avr/cores/keyboardio/HID.cpp b/hardware/keyboardio/avr/cores/keyboardio/HID.cpp new file mode 100644 index 00000000..56d920b2 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/HID.cpp @@ -0,0 +1,803 @@ + + +/* Copyright (c) 2011, Peter Barrett +** +** Sleep/Wakeup/SystemControl support added by Michael Dreher +** +** Permission to use, copy, modify, and/or distribute this software for +** any purpose with or without fee is hereby granted, provided that the +** above copyright notice and this permission notice appear in all copies. +** +** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR +** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +** SOFTWARE. +*/ + +#include "USBAPI.h" +#include "USBDesc.h" +#include "HIDTables.h" + +#if defined(USBCON) +#ifdef HID_ENABLED +#define HID_MOUSE_ABS_ENABLED +//#define RAWHID_ENABLED + +// Singletons for mouse and keyboard + +Mouse_ Mouse; +Keyboard_ Keyboard; + +//================================================================================ +//================================================================================ + +// HID report descriptor + +#define LSB(_x) ((_x) & 0xFF) +#define MSB(_x) ((_x) >> 8) + +#define RAWHID_USAGE_PAGE 0xFFC0 +#define RAWHID_USAGE 0x0C00 +#define RAWHID_TX_SIZE 64 +#define RAWHID_RX_SIZE 64 + +#define HID_REPORTID_KEYBOARD (1) +#define HID_REPORTID_MOUSE (2) +#define HID_REPORTID_MOUSE_ABS (3) +#define HID_REPORTID_SYSTEMCONTROL (4) +#define HID_REPORTID_CONSUMERCONTROL (5) +#define HID_REPORTID_RAWHID (6) + +#define HID_REPORT_KEYBOARD /* Keyboard */ \ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) 47 */ \ + 0x09, 0x06, /* USAGE (Keyboard) */ \ + 0xa1, 0x01, /* COLLECTION (Application) */ \ + 0x85, HID_REPORTID_KEYBOARD, /* REPORT_ID */ \ + 0x05, 0x07, /* USAGE_PAGE (Keyboard) */ \ +\ + /* Keyboard Modifiers (shift, alt, ...) */ \ + 0x19, 0xe0, /* USAGE_MINIMUM (Keyboard LeftControl) */ \ + 0x29, 0xe7, /* USAGE_MAXIMUM (Keyboard Right GUI) */ \ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ \ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ \ + 0x75, 0x01, /* REPORT_SIZE (1) */ \ +\ + 0x95, 0x08, /* REPORT_COUNT (8) */ \ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ \ + 0x95, 0x01, /* REPORT_COUNT (1) */ \ + 0x75, 0x08, /* REPORT_SIZE (8) */ \ + 0x81, 0x03, /* INPUT (Cnst,Var,Abs) */ \ +\ + /* Keyboard keys */ \ + 0x95, 0x06, /* REPORT_COUNT (6) */ \ + 0x75, 0x08, /* REPORT_SIZE (8) */ \ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ \ + 0x26, 0xDF, 0x00, /* LOGICAL_MAXIMUM (239) */ \ + 0x05, 0x07, /* USAGE_PAGE (Keyboard) */ \ + 0x19, 0x00, /* USAGE_MINIMUM (Reserved (no event indicated)) */ \ + 0x29, 0xDF, /* USAGE_MAXIMUM (Left Control - 1) */ \ + 0x81, 0x00, /* INPUT (Data,Ary,Abs) */ \ + 0xc0 /* END_COLLECTION */ + +#define HID_REPORT_MOUSE_ABSOLUTE /* Mouse absolute */ \ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ \ + 0x09, 0x02, /* USAGE (Mouse) */ \ + 0xa1, 0x01, /* COLLECTION (Application) */ \ + 0x09, 0x01, /* USAGE (Pointer) */ \ + 0xa1, 0x00, /* COLLECTION (Physical) */ \ + 0x85, HID_REPORTID_MOUSE_ABS, /* REPORT_ID */ \ + 0x05, 0x09, /* USAGE_PAGE (Button) */ \ + 0x19, 0x01, /* USAGE_MINIMUM (Button 1) */ \ + 0x29, 0x03, /* USAGE_MAXIMUM (Button 3) */ \ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ \ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ \ + 0x95, 0x03, /* REPORT_COUNT (3) */ \ + 0x75, 0x01, /* REPORT_SIZE (1) */ \ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ \ + 0x95, 0x01, /* REPORT_COUNT (1) */ \ + 0x75, 0x05, /* REPORT_SIZE (5) */ \ + 0x81, 0x03, /* INPUT (Cnst,Var,Abs) */ \ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ \ + 0x09, 0x30, /* USAGE (X) */ \ + 0x09, 0x31, /* USAGE (Y) */ \ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ \ + 0x26, 0xff, 0x7f, /* LOGICAL_MAXIMUM (32767) */ \ + 0x75, 0x10, /* REPORT_SIZE (16) */ \ + 0x95, 0x02, /* REPORT_COUNT (2) */ \ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ \ + 0xc0, /* END_COLLECTION */ \ + 0xc0 /* END_COLLECTION */ + +#define HID_REPORT_MOUSE_RELATIVE /* Mouse relative */ \ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) 54 */ \ + 0x09, 0x02, /* USAGE (Mouse) */ \ + 0xa1, 0x01, /* COLLECTION (Application) */ \ + 0x09, 0x01, /* USAGE (Pointer) */ \ + 0xa1, 0x00, /* COLLECTION (Physical) */ \ + 0x85, HID_REPORTID_MOUSE, /* REPORT_ID */ \ + 0x05, 0x09, /* USAGE_PAGE (Button) */ \ + 0x19, 0x01, /* USAGE_MINIMUM (Button 1) */ \ + 0x29, 0x05, /* USAGE_MAXIMUM (Button 5) */ \ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ \ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ \ + 0x95, 0x05, /* REPORT_COUNT (5) */ \ + 0x75, 0x01, /* REPORT_SIZE (1) */ \ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ \ + 0x95, 0x01, /* REPORT_COUNT (1) */ \ + 0x75, 0x03, /* REPORT_SIZE (3) */ \ + 0x81, 0x01, /* INPUT (Cnst,Var,Abs) */ \ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ \ + 0x09, 0x30, /* USAGE (X) */ \ + 0x09, 0x31, /* USAGE (Y) */ \ + 0x09, 0x38, /* USAGE (Wheel) */ \ + 0x15, 0x81, /* LOGICAL_MINIMUM (-127) */ \ + 0x25, 0x7f, /* LOGICAL_MAXIMUM (127) */ \ + 0x75, 0x08, /* REPORT_SIZE (8) */ \ + 0x95, 0x03, /* REPORT_COUNT (3) */ \ + 0x81, 0x06, /* INPUT (Data,Var,Rel) */ \ + 0xc0, /* END_COLLECTION */ \ + 0xc0 /* END_COLLECTION */ + +#define HID_REPORT_SYSTEMCONTROL /* System Control (Power Down, Sleep, Wakeup, ...) */ \ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ \ + 0x09, 0x80, /* USAGE (System Control) */ \ + 0xa1, 0x01, /* COLLECTION (Application) */ \ + 0x85, HID_REPORTID_SYSTEMCONTROL, /* REPORT_ID */ \ + 0x09, 0x81, /* USAGE (System Power Down) */ \ + 0x09, 0x82, /* USAGE (System Sleep) */ \ + 0x09, 0x83, /* USAGE (System Wakeup) */ \ + 0x09, 0x8E, /* USAGE (System Cold Restart) */ \ + 0x09, 0x8F, /* USAGE (System Warm Restart) */ \ + 0x09, 0xA0, /* USAGE (System Dock) */ \ + 0x09, 0xA1, /* USAGE (System Undock) */ \ + 0x09, 0xA7, /* USAGE (System Speaker Mute) */ \ + 0x09, 0xA8, /* USAGE (System Hibernate) */ \ + /* although these display usages are not that important, they don't cost */ \ + /* much more than declaring the otherwise necessary constant fill bits */ \ + 0x09, 0xB0, /* USAGE (System Display Invert) */ \ + 0x09, 0xB1, /* USAGE (System Display Internal) */ \ + 0x09, 0xB2, /* USAGE (System Display External) */ \ + 0x09, 0xB3, /* USAGE (System Display Both) */ \ + 0x09, 0xB4, /* USAGE (System Display Dual) */ \ + 0x09, 0xB5, /* USAGE (System Display Toggle Intern/Extern) */ \ + 0x09, 0xB6, /* USAGE (System Display Swap) */ \ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ \ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ \ + 0x75, 0x01, /* REPORT_SIZE (1) */ \ + 0x95, 0x10, /* REPORT_COUNT (16) */ \ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ \ + 0xc0 /* END_COLLECTION */ + +#define HID_REPORT_CONSUMERCONTROL /* Consumer Control (Sound/Media keys) */ \ + 0x05, 0x0c, /* USAGE_PAGE (Consumer Devices) */ \ + 0x09, 0x01, /* USAGE (Consumer Control) */ \ + 0xa1, 0x01, /* COLLECTION (Application) */ \ + 0x85, HID_REPORTID_CONSUMERCONTROL, /* REPORT_ID */ \ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ \ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ \ + 0x75, 0x01, /* REPORT_SIZE (1) */ \ + 0x95, 0x08, /* REPORT_COUNT (8) */ \ + 0x09, 0xe2, /* USAGE (Mute) 0x01 */ \ + 0x09, 0xe9, /* USAGE (Volume Up) 0x02 */ \ + 0x09, 0xea, /* USAGE (Volume Down) 0x03 */ \ + 0x09, 0xcd, /* USAGE (Play/Pause) 0x04 */ \ + 0x09, 0xb7, /* USAGE (Stop) 0x05 */ \ + 0x09, 0xb6, /* USAGE (Scan Previous Track) 0x06 */ \ + 0x09, 0xb5, /* USAGE (Scan Next Track) 0x07 */ \ + 0x09, 0xb8, /* USAGE (Eject) 0x08 */ \ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ \ + 0xc0 + +#define HID_REPORT_RAWHID /* RAW HID */ \ + 0x06, LSB(RAWHID_USAGE_PAGE), MSB(RAWHID_USAGE_PAGE), /* 30 */ \ + 0x0A, LSB(RAWHID_USAGE), MSB(RAWHID_USAGE), \ +\ + 0xA1, 0x01, /* Collection 0x01 */ \ + 0x85, HID_REPORTID_RAWHID, /* REPORT_ID */ \ + 0x75, 0x08, /* report size = 8 bits */ \ + 0x15, 0x00, /* logical minimum = 0 */ \ + 0x26, 0xFF, 0x00, /* logical maximum = 255 */ \ +\ + 0x95, 64, /* report count TX */ \ + 0x09, 0x01, /* usage */ \ + 0x81, 0x02, /* Input (array) */ \ +\ + 0x95, 64, /* report count RX */ \ + 0x09, 0x02, /* usage */ \ + 0x91, 0x02, /* Output (array) */ \ + 0xC0 /* end collection */ + +extern const u8 _hidReportDescriptor[] PROGMEM; +const u8 _hidReportDescriptor[] = { + + HID_REPORT_KEYBOARD, + HID_REPORT_MOUSE_RELATIVE, +#ifdef HID_MOUSE_ABS_ENABLED + HID_REPORT_MOUSE_ABSOLUTE, +#endif + HID_REPORT_SYSTEMCONTROL, + HID_REPORT_CONSUMERCONTROL, +#if RAWHID_ENABLED + HID_REPORT_RAWHID +#endif +}; + +extern const HIDDescriptor _hidInterface PROGMEM; +const HIDDescriptor _hidInterface = +{ + D_INTERFACE(HID_INTERFACE,1,3,0,0), + D_HIDREPORT(sizeof(_hidReportDescriptor)), + D_ENDPOINT(USB_ENDPOINT_IN (HID_ENDPOINT_INT),USB_ENDPOINT_TYPE_INTERRUPT,0x40,0x01) +}; + +//================================================================================ +//================================================================================ +// Driver + +u8 _hid_protocol = 1; +u8 _hid_idle = 1; + +#define WEAK __attribute__ ((weak)) + +int WEAK HID_GetInterface(u8* interfaceNum) +{ + interfaceNum[0] += 1; // uses 1 + return USB_SendControl(TRANSFER_PGM,&_hidInterface,sizeof(_hidInterface)); +} + +int WEAK HID_GetDescriptor(int /* i */) +{ + return USB_SendControl(TRANSFER_PGM,_hidReportDescriptor,sizeof(_hidReportDescriptor)); +} + +void WEAK HID_SendReport(u8 id, const void* data, int len) +{ + USB_Send(HID_TX, &id, 1); + USB_Send(HID_TX | TRANSFER_RELEASE,data,len); +} + +bool WEAK HID_Setup(Setup& setup) +{ + u8 r = setup.bRequest; + u8 requestType = setup.bmRequestType; + if (REQUEST_DEVICETOHOST_CLASS_INTERFACE == requestType) + { + if (HID_GET_REPORT == r) + { + //HID_GetReport(); + return true; + } + if (HID_GET_PROTOCOL == r) + { + //Send8(_hid_protocol); // TODO + return true; + } + } + + if (REQUEST_HOSTTODEVICE_CLASS_INTERFACE == requestType) + { + if (HID_SET_PROTOCOL == r) + { + _hid_protocol = setup.wValueL; + return true; + } + + if (HID_SET_IDLE == r) + { + _hid_idle = setup.wValueL; + return true; + } + } + return false; +} + +//================================================================================ +//================================================================================ +// Mouse + +Mouse_::Mouse_(void) : _buttons(0) +{ +} + +void Mouse_::begin(void) +{ +} + +void Mouse_::end(void) +{ +} + +void Mouse_::click(uint8_t b) +{ + _buttons = b; + move(0,0,0); + _buttons = 0; + move(0,0,0); +} + +void Mouse_::move(signed char x, signed char y, signed char wheel) +{ + u8 m[4]; + m[0] = _buttons; + m[1] = x; + m[2] = y; + m[3] = wheel; + HID_SendReport(HID_REPORTID_MOUSE,m,sizeof(m)); +} + +// X and Y have the range of 0 to 32767. +// The USB Host will convert them to pixels on the screen. +// +// x=0,y=0 is top-left corner of the screen +// x=32767,y=0 is the top right corner +// x=32767,y=32767 is the bottom right corner +// x=0,y=32767 is the bottom left corner +// +// When converting these coordinates to pixels on screen, Mac OS X's +// default HID driver maps the inner 85% of the coordinate space to +// the screen's physical dimensions. This means that any value between +// 0 and 2293 or 30474 and 32767 will move the mouse to the screen +// edge on a Mac +// +// For details, see: +// http://lists.apple.com/archives/usb/2011/Jun/msg00032.html + + +void Mouse_::moveAbsolute(uint16_t x, uint16_t y) +{ + u8 m[5]; + m[0] = _buttons; + m[1] = LSB(x); + m[2] = MSB(x); + m[3] = LSB(y); + m[4] = MSB(y); + HID_SendReport(HID_REPORTID_MOUSE_ABS,m,sizeof(m)); +} + +void Mouse_::buttons(uint8_t b) +{ + if (b != _buttons) + { + _buttons = b; + move(0,0,0); + } +} + +void Mouse_::press(uint8_t b) +{ + buttons(_buttons | b); +} + +void Mouse_::release(uint8_t b) +{ + buttons(_buttons & ~b); +} + +bool Mouse_::isPressed(uint8_t b) +{ + if ((b & _buttons) > 0) + return true; + return false; +} + +//================================================================================ +//================================================================================ +// Keyboard + +Keyboard_::Keyboard_(void) +{ +} + +void Keyboard_::begin(void) +{ +} + +void Keyboard_::end(void) +{ +} + +void Keyboard_::sendReport(KeyReport* keys) +{ + HID_SendReport(HID_REPORTID_KEYBOARD,keys,sizeof(*keys)); +} + +extern +const uint8_t _asciimap[128] PROGMEM; + +#define SHIFT 0x80 +const uint8_t _asciimap[128] = +{ + 0x00, // NUL + 0x00, // SOH + 0x00, // STX + 0x00, // ETX + 0x00, // EOT + 0x00, // ENQ + 0x00, // ACK + 0x00, // BEL + 0x2a, // BS Backspace + 0x2b, // TAB Tab + 0x28, // LF Enter + 0x00, // VT + 0x00, // FF + 0x00, // CR + 0x00, // SO + 0x00, // SI + 0x00, // DEL + 0x00, // DC1 + 0x00, // DC2 + 0x00, // DC3 + 0x00, // DC4 + 0x00, // NAK + 0x00, // SYN + 0x00, // ETB + 0x00, // CAN + 0x00, // EM + 0x00, // SUB + 0x00, // ESC + 0x00, // FS + 0x00, // GS + 0x00, // RS + 0x00, // US + + 0x2c, // ' ' + 0x1e|SHIFT, // ! + 0x34|SHIFT, // " + 0x20|SHIFT, // # + 0x21|SHIFT, // $ + 0x22|SHIFT, // % + 0x24|SHIFT, // & + 0x34, // ' + 0x26|SHIFT, // ( + 0x27|SHIFT, // ) + 0x25|SHIFT, // * + 0x2e|SHIFT, // + + 0x36, // , + 0x2d, // - + 0x37, // . + 0x38, // / + 0x27, // 0 + 0x1e, // 1 + 0x1f, // 2 + 0x20, // 3 + 0x21, // 4 + 0x22, // 5 + 0x23, // 6 + 0x24, // 7 + 0x25, // 8 + 0x26, // 9 + 0x33|SHIFT, // : + 0x33, // ; + 0x36|SHIFT, // < + 0x2e, // = + 0x37|SHIFT, // > + 0x38|SHIFT, // ? + 0x1f|SHIFT, // @ + 0x04|SHIFT, // A + 0x05|SHIFT, // B + 0x06|SHIFT, // C + 0x07|SHIFT, // D + 0x08|SHIFT, // E + 0x09|SHIFT, // F + 0x0a|SHIFT, // G + 0x0b|SHIFT, // H + 0x0c|SHIFT, // I + 0x0d|SHIFT, // J + 0x0e|SHIFT, // K + 0x0f|SHIFT, // L + 0x10|SHIFT, // M + 0x11|SHIFT, // N + 0x12|SHIFT, // O + 0x13|SHIFT, // P + 0x14|SHIFT, // Q + 0x15|SHIFT, // R + 0x16|SHIFT, // S + 0x17|SHIFT, // T + 0x18|SHIFT, // U + 0x19|SHIFT, // V + 0x1a|SHIFT, // W + 0x1b|SHIFT, // X + 0x1c|SHIFT, // Y + 0x1d|SHIFT, // Z + 0x2f, // [ + 0x31, // bslash + 0x30, // ] + 0x23|SHIFT, // ^ + 0x2d|SHIFT, // _ + 0x35, // ` + 0x04, // a + 0x05, // b + 0x06, // c + 0x07, // d + 0x08, // e + 0x09, // f + 0x0a, // g + 0x0b, // h + 0x0c, // i + 0x0d, // j + 0x0e, // k + 0x0f, // l + 0x10, // m + 0x11, // n + 0x12, // o + 0x13, // p + 0x14, // q + 0x15, // r + 0x16, // s + 0x17, // t + 0x18, // u + 0x19, // v + 0x1a, // w + 0x1b, // x + 0x1c, // y + 0x1d, // z + 0x2f|SHIFT, // + 0x31|SHIFT, // | + 0x30|SHIFT, // } + 0x35|SHIFT, // ~ + 0 // DEL +}; + +uint8_t USBPutChar(uint8_t c); + + + // pressKeycode() adds the specified key (printing, non-printing, or modifier) + // to the persistent key report and sends the report. Because of the way + // USB HID works, the host acts like the key remains pressed until we + // call releaseKeycode(), releaseAll(), or otherwise clear the report and resend. + size_t Keyboard_::pressKeycode(uint8_t k) + { + if (!addKeycodeToReport(k)) { + return 0; + } + sendReport(&_keyReport); + } + + size_t Keyboard_::addKeycodeToReport(uint8_t k) + { + uint8_t index = 0; + uint8_t done = 0; + + if ((k >= HID_KEYBOARD_LEFT_CONTROL) && (k <= HID_KEYBOARD_RIGHT_GUI)) { + // it's a modifier key + _keyReport.modifiers |= (0x01 << (k - HID_KEYBOARD_LEFT_CONTROL)); + } else { + // it's some other key: + // Add k to the key report only if it's not already present + // and if there is an empty slot. + for (index = 0; index < KEYREPORT_KEYCOUNT; index++) { + if (_keyReport.keys[index] != k) { // is k already in list? + if (0 == _keyReport.keys[index]) { // have we found an empty slot? + _keyReport.keys[index] = k; + done = 1; + break; + } + } else { + done = 1; + break; + } + + } + + // use separate variable to check if slot was found + // for style reasons - we do not know how the compiler + // handles the for() index when it leaves the loop + if (0 == done) { + setWriteError(); + return 0; + } + } + + return 1; + } + + // press() transforms the given key to the actual keycode and calls + // pressKeycode() to actually press this key. + // + size_t Keyboard_::press(uint8_t k) + { + if (k >= KEY_RIGHT_GUI + 1) { + // it's a non-printing key (not a modifier) + k = k - (KEY_RIGHT_GUI + 1); + } else { + if (k >= KEY_LEFT_CTRL) { + // it's a modifier key + k = k - KEY_LEFT_CTRL + HID_KEYBOARD_LEFT_CONTROL; + } else { + k = pgm_read_byte(_asciimap + k); + if (k) { + if (k & SHIFT) { + // it's a capital letter or other character reached with shift + // the left shift modifier + addKeycodeToReport(HID_KEYBOARD_LEFT_SHIFT); + k = k ^ SHIFT; + } + } else { + return 0; + } + } + } + + pressKeycode(k); + return 1; + } + +// System Control +// k is one of the SYSTEM_CONTROL defines which come from the HID usage table "Generic Desktop Page (0x01)" +// in "HID Usage Tables" (HUT1_12v2.pdf) +size_t Keyboard_::systemControl(uint8_t k) +{ + if(k <= 16) + { + u16 mask = 0; + u8 m[2]; + + if(k > 0) + { + mask = 1 << (k - 1); + } + + m[0] = LSB(mask); + m[1] = MSB(mask); + HID_SendReport(HID_REPORTID_SYSTEMCONTROL,m,sizeof(m)); + + // these are all OSCs, so send a clear to make it possible to send it again later + m[0] = 0; + m[1] = 0; + HID_SendReport(HID_REPORTID_SYSTEMCONTROL,m,sizeof(m)); + return 1; + } + else + { + setWriteError(); + return 0; + } +} + +// Consumer Control +// k is one of the CONSUMER_CONTROL defines which come from the HID usage table "Consumer Devices Page (0x0c)" +// in "HID Usage Tables" (HUT1_12v2.pdf) +size_t Keyboard_::consumerControl(uint8_t k) +{ + if(k <= 8) + { + u16 mask = 0; + u8 m[2]; + + if(k > 0) + { + mask = 1 << (k - 1); + } + + m[0] = LSB(mask); + m[1] = MSB(mask); + HID_SendReport(HID_REPORTID_CONSUMERCONTROL,m,sizeof(m)); + + // these are all OSCs, so send a clear to make it possible to send it again later + m[0] = 0; + m[1] = 0; + HID_SendReport(HID_REPORTID_CONSUMERCONTROL,m,sizeof(m)); + return 1; + } + else + { + setWriteError(); + return 0; + } +} + +// releaseKeycode() takes the specified key out of the persistent key report and +// sends the report. This tells the OS the key is no longer pressed and that +// it shouldn't be repeated any more. +// When send is set to FALSE (= 0) no sendReport() is executed. This comes in +// handy when combining key releases (e.g. SHIFT+A). +size_t Keyboard_::releaseKeycode(uint8_t k) +{ + if (!removeKeycodeFromReport(k)) { + return 0; + } + sendReport(&_keyReport); +} + +size_t Keyboard_::removeKeycodeFromReport(uint8_t k) +{ + uint8_t indexA; + uint8_t indexB; + uint8_t count; + + if ((k >= HID_KEYBOARD_LEFT_CONTROL) && (k <= HID_KEYBOARD_RIGHT_GUI)) { + // it's a modifier key + _keyReport.modifiers = _keyReport.modifiers & (~(0x01 << (k - HID_KEYBOARD_LEFT_CONTROL))); + } else { + // it's some other key: + // Test the key report to see if k is present. Clear it if it exists. + // Check all positions in case the key is present more than once (which it shouldn't be) + for (indexA = 0; indexA < KEYREPORT_KEYCOUNT; indexA++) { + if (_keyReport.keys[indexA] == k) { + _keyReport.keys[indexA] = 0; + } + } + + // finally rearrange the keys list so that the free (= 0x00) are at the + // end of the keys list - some implementations stop for keys at the + // first occurence of an 0x00 in the keys list + // so (0x00)(0x01)(0x00)(0x03)(0x02)(0x00) becomes + // (0x01)(0x03)(0x02)(0x00)(0x00)(0x00) + count = 0; // holds the number of zeros we've found + indexA = 0; + while ((indexA + count) < KEYREPORT_KEYCOUNT) { + if (0 == _keyReport.keys[indexA]) { + count++; // one more zero + for (indexB = indexA; indexB < KEYREPORT_KEYCOUNT-count; indexB++) { + _keyReport.keys[indexB] = _keyReport.keys[indexB+1]; + } + _keyReport.keys[KEYREPORT_KEYCOUNT-count] = 0; + } else { + indexA++; // one more non-zero + } + } + } + + return 1; +} + +// release() transforms the given key to the actual keycode and calls +// releaseKeycode() to actually release this key. +// +size_t Keyboard_::release(uint8_t k) +{ + uint8_t i; + + if (k >= KEY_RIGHT_GUI + 1) { + // it's a non-printing key (not a modifier) + k = k - (KEY_RIGHT_GUI + 1); + } else { + if (k >= KEY_LEFT_CTRL) { + // it's a modifier key + k = k - KEY_LEFT_CTRL + HID_KEYBOARD_LEFT_CONTROL; + } else { + k = pgm_read_byte(_asciimap + k); + if (k) { + if ((k & SHIFT)) { + // it's a capital letter or other character reached with shift + // the left shift modifier + removeKeycodeFromReport(HID_KEYBOARD_LEFT_SHIFT); + k = k ^ SHIFT; + } + } else { + return 0; + } + } + } + + releaseKeycode(k); + return 1; +} + +void Keyboard_::releaseAll(void) +{ + memset(&_keyReport, 0x00, sizeof(_keyReport)); + sendReport(&_keyReport); +} + +size_t Keyboard_::write(uint8_t c) +{ + uint8_t p = press(c); // Keydown + release(c); // Keyup + return p; // just return the result of press() since release() almost always returns 1 +} + +size_t Keyboard_::writeKeycode(uint8_t c) +{ + uint8_t p = pressKeycode(c); // Keydown + releaseKeycode(c); // Keyup + return (p); // just return the result of pressKeycode() since release() almost always returns 1 +} + +#endif + +#endif /* if defined(USBCON) */ diff --git a/hardware/keyboardio/avr/cores/keyboardio/HIDTables.h b/hardware/keyboardio/avr/cores/keyboardio/HIDTables.h new file mode 100644 index 00000000..8092e1fb --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/HIDTables.h @@ -0,0 +1,677 @@ +#ifndef __HIDTables__ +#define HID___HIDTables__ + + +// These mappings were extracted and transcribed from +// http://www.usb.org_SLASH_developers_SLASH_devclass_docs_SLASH_Hut1_12v2.pdf +// +// In most cases, I've preserved the "official" USB Implementers forum +// "Usage Name", though I've standardized some abbreviations and spacing +// that were inconsistent in the original specification. Non alpha-numeric +// characters in symbol names were converted into those characters' names. +// +// To match Arduino code style, all hid usage names are fully upper case. +// +// Not every HID usage listed in this file is currently supported by Arduino +// In particular, any System Control or Consumer Control entry that doesn't +// have a comment indicating that it's "HID type OSC" will require additional +// code in the Arduino core to work. +// +// Non-working usages are listed here in the interest of not having to manually +// convert more usage names each and every time our HID stack gets a little bit +// better. +// +// +// -- Jesse Vincent , January 2014 + + + +// System control mappings + +#define HID_SYSTEM_POWER_DOWN 0x81 // HID type OSC +#define HID_SYSTEM_SLEEP 0x82 // HID type OSC +#define HID_SYSTEM_WAKE_UP 0x83 // HID type OSC +#define HID_SYSTEM_CONTEXT_MENU 0x84 // HID type OSC +#define HID_SYSTEM_MAIN_MENU 0x85 // HID type OSC +#define HID_SYSTEM_APP_MENU 0x86 // HID type OSC +#define HID_SYSTEM_MENU_HELP 0x87 // HID type OSC +#define HID_SYSTEM_MENU_EXIT 0x88 // HID type OSC +#define HID_SYSTEM_MENU_SELECT 0x89 // HID type OSC +#define HID_SYSTEM_MENU_RIGHT 0x8A // HID type RTC +#define HID_SYSTEM_MENU_LEFT 0x8B // HID type RTC +#define HID_SYSTEM_MENU_UP 0x8C // HID type RTC +#define HID_SYSTEM_MENU_DOWN 0x8D // HID type RTC +#define HID_SYSTEM_COLD_RESTART 0x8E // HID type OSC +#define HID_SYSTEM_WARM_RESTART 0x8F // HID type OSC +#define HID_D_PAD_UP 0x90 // HID type OOC +#define HID_D_PAD_DOWN 0x91 // HID type OOC +#define HID_D_PAD_RIGHT 0x92 // HID type OOC +#define HID_D_PAD_LEFT 0x93 // HID type OOC +// 0x94-0x9F are reserved +#define HID_SYSTEM_DOCK 0xA0 // HID type OSC +#define HID_SYSTEM_UNDOCK 0xA1 // HID type OSC +#define HID_SYSTEM_SETUP 0xA2 // HID type OSC +#define HID_SYSTEM_BREAK 0xA3 // HID type OSC +#define HID_SYSTEM_DEBUGGER_BREAK 0xA4 // HID type OSC +#define HID_APPLICATION_BREAK 0xA5 // HID type OSC +#define HID_APPLICATION_DEBUGGER_BREAK 0xA6 // HID type OSC +#define HID_SYSTEM_SPEAKER_MUTE 0xA7 // HID type OSC +#define HID_SYSTEM_HIBERNATE 0xA8 // HID type OSC +// 0xA9-0xAF are reserved +#define HID_SYSTEM_DISPLAY_INVERT 0xB0 // HID type OSC +#define HID_SYSTEM_DISPLAY_INTERNAL 0xB1 // HID type OSC +#define HID_SYSTEM_DISPLAY_EXTERNAL 0xB2 // HID type OSC +#define HID_SYSTEM_DISPLAY_BOTH 0xB3 // HID type OSC +#define HID_SYSTEM_DISPLAY_DUAL 0xB4 // HID type OSC +#define HID_SYSTEM_DISPLAY_TOGGLE_INT_SLASH_EXT 0xB5 // HID type OSC +#define HID_SYSTEM_DISPLAY_SWAP_PRIMARY_SLASH_SECONDARY 0xB6 // HID type OSC +#define HID_SYSTEM_DISPLAY_LCD_AUTOSCALE 0xB7 // HID type OSC + +// Keyboard HID mappings + +// Reserved (no_event_indicated) 0x00 +#define HID_KEYBOARD_ERROR_ROLLOVER 0x01 +#define HID_KEYBOARD_POST_FAIL 0x02 +#define HID_KEYBOARD_ERROR_UNDEFINED 0x03 +#define HID_KEYBOARD_A_AND_A 0x04 +#define HID_KEYBOARD_B_AND_B 0x05 +#define HID_KEYBOARD_C_AND_C 0x06 +#define HID_KEYBOARD_D_AND_D 0x07 +#define HID_KEYBOARD_E_AND_E 0x08 +#define HID_KEYBOARD_F_AND_F 0x09 +#define HID_KEYBOARD_G_AND_G 0x0A +#define HID_KEYBOARD_H_AND_H 0x0B +#define HID_KEYBOARD_I_AND_I 0x0C +#define HID_KEYBOARD_J_AND_J 0x0D +#define HID_KEYBOARD_K_AND_K 0x0E +#define HID_KEYBOARD_L_AND_L 0x0F +#define HID_KEYBOARD_M_AND_M 0x10 +#define HID_KEYBOARD_N_AND_N 0x11 +#define HID_KEYBOARD_O_AND_O 0x12 +#define HID_KEYBOARD_P_AND_P 0x13 +#define HID_KEYBOARD_Q_AND_Q 0x14 +#define HID_KEYBOARD_R_AND_R 0x15 +#define HID_KEYBOARD_S_AND_S 0x16 +#define HID_KEYBOARD_T_AND_T 0x17 +#define HID_KEYBOARD_U_AND_U 0x18 +#define HID_KEYBOARD_V_AND_V 0x19 +#define HID_KEYBOARD_W_AND_W 0x1A +#define HID_KEYBOARD_X_AND_X 0x1B +#define HID_KEYBOARD_Y_AND_Y 0x1C +#define HID_KEYBOARD_Z_AND_Z 0x1D +#define HID_KEYBOARD_1_AND_EXCLAMATION_POINT 0x1E +#define HID_KEYBOARD_2_AND_AT 0x1F +#define HID_KEYBOARD_3_AND_POUND 0x20 +#define HID_KEYBOARD_4_AND_DOLLAR 0x21 +#define HID_KEYBOARD_5_AND_PERCENT 0x22 +#define HID_KEYBOARD_6_AND_CARAT 0x23 +#define HID_KEYBOARD_7_AND_AMPERSAND 0x24 +#define HID_KEYBOARD_8_AND_ASTERISK 0x25 +#define HID_KEYBOARD_9_AND_LEFT_PAREN 0x26 +#define HID_KEYBOARD_0_AND_RIGHT_PAREN 0x27 +#define HID_KEYBOARD_ENTER 0x28 // (MARKED AS ENTER_SLASH_RETURN) +#define HID_KEYBOARD_ESCAPE 0x29 +#define HID_KEYBOARD_DELETE 0x2A // (BACKSPACE) +#define HID_KEYBOARD_TAB 0x2B +#define HID_KEYBOARD_SPACEBAR 0x2C +#define HID_KEYBOARD_MINUS_AND_UNDERSCORE 0x2D // (UNDERSCORE) +#define HID_KEYBOARD_EQUALS_AND_PLUS 0x2E +#define HID_KEYBOARD_LEFT_BRACKET_AND_LEFT_CURLY_BRACE 0x2F +#define HID_KEYBOARD_RIGHT_BRACKET_AND_RIGHT_CURLY_BRACE 0x30 +#define HID_KEYBOARD_BACKSLASH_AND_PIPE 0x31 +#define HID_KEYBOARD_NON_US_POUND_AND_TILDE 0x32 +#define HID_KEYBOARD_SEMICOLON_AND_COLON 0x33 +#define HID_KEYBOARD_QUOTE_AND_DOUBLEQUOTE 0x34 +#define HID_KEYBOARD_GRAVE_ACCENT_AND_TILDE 0x35 +#define HID_KEYBOARD_COMMA_AND_LESS_THAN 0x36 +#define HID_KEYBOARD_PERIOD_AND_GREATER_THAN 0x37 +#define HID_KEYBOARD_SLASH_AND_QUESTION_MARK 0x38 +#define HID_KEYBOARD_CAPS_LOCK 0x39 +#define HID_KEYBOARD_F1 0x3A +#define HID_KEYBOARD_F2 0x3B +#define HID_KEYBOARD_F3 0x3C +#define HID_KEYBOARD_F4 0x3D +#define HID_KEYBOARD_F5 0x3E +#define HID_KEYBOARD_F6 0x3F +#define HID_KEYBOARD_F7 0x40 +#define HID_KEYBOARD_F8 0x41 +#define HID_KEYBOARD_F9 0x42 +#define HID_KEYBOARD_F10 0x43 +#define HID_KEYBOARD_F11 0x44 +#define HID_KEYBOARD_F12 0x45 +#define HID_KEYBOARD_PRINTSCREEN 0x46 +#define HID_KEYBOARD_SCROLL_LOCK 0x47 +#define HID_KEYBOARD_PAUSE 0x48 +#define HID_KEYBOARD_INSERT 0x49 +#define HID_KEYBOARD_HOME 0x4A +#define HID_KEYBOARD_PAGE_UP 0x4B +#define HID_KEYBOARD_DELETE_FORWARD 0x4C +#define HID_KEYBOARD_END 0x4D +#define HID_KEYBOARD_PAGE_DOWN 0x4E +#define HID_KEYBOARD_RIGHTARROW 0x4F +#define HID_KEYBOARD_LEFTARROW 0x50 +#define HID_KEYBOARD_DOWNARROW 0x51 +#define HID_KEYBOARD_UPARROW 0x52 +#define HID_KEYPAD_NUM_LOCK_AND_CLEAR 0x53 +#define HID_KEYPAD_DIVIDE 0x54 +#define HID_KEYPAD_MULTIPLY 0x55 +#define HID_KEYPAD_SUBTRACT 0x56 +#define HID_KEYPAD_ADD 0x57 +#define HID_KEYPAD_ENTER 0x58 +#define HID_KEYPAD_1_AND_END 0x59 +#define HID_KEYPAD_2_AND_DOWN_ARROW 0x5A +#define HID_KEYPAD_3_AND_PAGE_DOWN 0x5B +#define HID_KEYPAD_4_AND_LEFT_ARROW 0x5C +#define HID_KEYPAD_5 0x5D +#define HID_KEYPAD_6_AND_RIGHT_ARROW 0x5E +#define HID_KEYPAD_7_AND_HOME 0x5F +#define HID_KEYPAD_8_AND_UP_ARROW 0x60 +#define HID_KEYPAD_9_AND_PAGE_UP 0x61 +#define HID_KEYPAD_0_AND_INSERT 0x62 +#define HID_KEYPAD_PERIOD_AND_DELETE 0x63 +#define HID_KEYBOARD_NON_US_BACKSLASH_AND_PIPE 0x64 +#define HID_KEYBOARD_APPLICATION 0x65 +#define HID_KEYBOARD_POWER 0x66 +#define HID_KEYPAD_EQUALS 0x67 +#define HID_KEYBOARD_F13 0x68 +#define HID_KEYBOARD_F14 0x69 +#define HID_KEYBOARD_F15 0x6A +#define HID_KEYBOARD_F16 0x6B +#define HID_KEYBOARD_F17 0x6C +#define HID_KEYBOARD_F18 0x6D +#define HID_KEYBOARD_F19 0x6E +#define HID_KEYBOARD_F20 0x6F +#define HID_KEYBOARD_F21 0x70 +#define HID_KEYBOARD_F22 0x71 +#define HID_KEYBOARD_F23 0x72 +#define HID_KEYBOARD_F24 0x73 +#define HID_KEYBOARD_EXECUTE 0x74 +#define HID_KEYBOARD_HELP 0x75 +#define HID_KEYBOARD_MENU 0x76 +#define HID_KEYBOARD_SELECT 0x77 +#define HID_KEYBOARD_STOP 0x78 +#define HID_KEYBOARD_AGAIN 0x79 +#define HID_KEYBOARD_UNDO 0x7A +#define HID_KEYBOARD_CUT 0x7B +#define HID_KEYBOARD_COPY 0x7C +#define HID_KEYBOARD_PASTE 0x7D +#define HID_KEYBOARD_FIND 0x7E +#define HID_KEYBOARD_MUTE 0x7F +#define HID_KEYBOARD_VOLUME_UP 0x80 +#define HID_KEYBOARD_VOLUME_DOWN 0x81 +#define HID_KEYBOARD_LOCKING_CAPS_LOCK 0x82 +#define HID_KEYBOARD_LOCKING_NUM_LOCK 0x83 +#define HID_KEYBOARD_LOCKING_SCROLL_LOCK 0x84 +#define HID_KEYPAD_COMMA 0x85 +#define HID_KEYPAD_EQUAL_SIGN 0x86 +#define HID_KEYBOARD_INTERNATIONAL1 0x87 +#define HID_KEYBOARD_INTERNATIONAL2 0x88 +#define HID_KEYBOARD_INTERNATIONAL3 0x89 +#define HID_KEYBOARD_INTERNATIONAL4 0x8A +#define HID_KEYBOARD_INTERNATIONAL5 0x8B +#define HID_KEYBOARD_INTERNATIONAL6 0x8C +#define HID_KEYBOARD_INTERNATIONAL7 0x8D +#define HID_KEYBOARD_INTERNATIONAL8 0x8E +#define HID_KEYBOARD_INTERNATIONAL9 0x8F +#define HID_KEYBOARD_LANG1 0x90 +#define HID_KEYBOARD_LANG2 0x91 +#define HID_KEYBOARD_LANG3 0x92 +#define HID_KEYBOARD_LANG4 0x93 +#define HID_KEYBOARD_LANG5 0x94 +#define HID_KEYBOARD_LANG6 0x95 +#define HID_KEYBOARD_LANG7 0x96 +#define HID_KEYBOARD_LANG8 0x97 +#define HID_KEYBOARD_LANG9 0x98 +#define HID_KEYBOARD_ALTERNATE_ERASE 0x99 +#define HID_KEYBOARD_SYSREQ_SLASH_ATTENTION 0x9A +#define HID_KEYBOARD_CANCEL 0x9B +#define HID_KEYBOARD_CLEAR 0x9C +#define HID_KEYBOARD_PRIOR 0x9D +#define HID_KEYBOARD_RETURN 0x9E +#define HID_KEYBOARD_SEPARATOR 0x9F +#define HID_KEYBOARD_OUT 0xA0 +#define HID_KEYBOARD_OPER 0xA1 +#define HID_KEYBOARD_CLEAR_SLASH_AGAIN 0xA2 +#define HID_KEYBOARD_CRSEL_SLASH_PROPS 0xA3 +#define HID_KEYBOARD_EXSEL 0xA4 +// Reserved 0xA5-AF +#define HID_KEYPAD_00 0xB0 +#define HID_KEYPAD_000 0xB1 +#define HID_THOUSANDS_SEPARATOR 0xB2 +#define HID_DECIMAL_SEPARATOR 0xB3 +#define HID_CURRENCY_UNIT 0xB4 +#define HID_CURRENCY_SUBUNIT 0xB5 +#define HID_KEYPAD_LEFT_PAREN 0xB6 +#define HID_KEYPAD_RIGHT_PAREN 0xB7 +#define HID_KEYPAD_LEFT_CURLY_BRACE 0xB8 +#define HID_KEYPAD_RIGHT_CURLY_BRACE 0xB9 +#define HID_KEYPAD_TAB 0xBA +#define HID_KEYPAD_BACKSPACE 0xBB +#define HID_KEYPAD_A 0xBC +#define HID_KEYPAD_B 0xBD +#define HID_KEYPAD_C 0xBE +#define HID_KEYPAD_D 0xBF +#define HID_KEYPAD_E 0xC0 +#define HID_KEYPAD_F 0xC1 +#define HID_KEYPAD_XOR 0xC2 +#define HID_KEYPAD_CARAT 0xC3 +#define HID_KEYPAD_PERCENT 0xC4 +#define HID_KEYPAD_LESS_THAN 0xC5 +#define HID_KEYPAD_GREATER_THAN 0xC6 +#define HID_KEYPAD_AMPERSAND 0xC7 +#define HID_KEYPAD_DOUBLEAMPERSAND 0xC8 +#define HID_KEYPAD_PIPE 0xC9 +#define HID_KEYPAD_DOUBLEPIPE 0xCA +#define HID_KEYPAD_COLON 0xCB +#define HID_KEYPAD_POUND_SIGN 0xCC +#define HID_KEYPAD_SPACE 0xCD +#define HID_KEYPAD_AT_SIGN 0xCE +#define HID_KEYPAD_EXCLAMATION_POINT 0xCF +#define HID_KEYPAD_MEMORY_STORE 0xD0 +#define HID_KEYPAD_MEMORY_RECALL 0xD1 +#define HID_KEYPAD_MEMORY_CLEAR 0xD2 +#define HID_KEYPAD_MEMORY_ADD 0xD3 +#define HID_KEYPAD_MEMORY_SUBTRACT 0xD4 +#define HID_KEYPAD_MEMORY_MULTIPLY 0xD5 +#define HID_KEYPAD_MEMORY_DIVIDE 0xD6 +#define HID_KEYPAD_PLUS_SLASH_MINUS 0xD7 +#define HID_KEYPAD_CLEAR 0xD8 +#define HID_KEYPAD_CLEAR_ENTRY 0xD9 +#define HID_KEYPAD_BINARY 0xDA +#define HID_KEYPAD_OCTAL 0xDB +#define HID_KEYPAD_DECIMAL 0xDC +#define HID_KEYPAD_HEXADECIMAL 0xDD + +// 0xDE-0xDF - RESERVED +#define HID_KEYBOARD_LEFT_CONTROL 0xE0 +#define HID_KEYBOARD_LEFT_SHIFT 0xE1 +#define HID_KEYBOARD_LEFT_ALT 0xE2 +#define HID_KEYBOARD_LEFT_GUI 0xE3 +#define HID_KEYBOARD_RIGHT_CONTROL 0xE4 +#define HID_KEYBOARD_RIGHT_SHIFT 0xE5 +#define HID_KEYBOARD_RIGHT_ALT 0xE6 +#define HID_KEYBOARD_RIGHT_GUI 0xE7 + + +// Consumer_Page_(0x0C) 0x15 +#define HID_CONSUMER_NUMERIC_KEY_PAD 0x02 // HID type NARY +#define HID_CONSUMER_PROGRAMMABLE_BUTTONS 0x03 // HID type NARY +#define HID_CONSUMER_MICROPHONE_CA 0x04 +#define HID_CONSUMER_HEADPHONE_CA 0x05 +#define HID_CONSUMER_GRAPHIC_EQUALIZER_CA 0x06 +// Reserved 0x07-1F +#define HID_CONSUMER_PLUS_10 0x20 // HID type OSC +#define HID_CONSUMER_PLUS_100 0x21 // HID type OSC +#define HID_CONSUMER_AM_SLASH_PM 0x22 // HID type OSC +// Reserved 0x23-3F +#define HID_CONSUMER_POWER 0x30 // HID type OOC +#define HID_CONSUMER_RESET 0x31 // HID type OSC +#define HID_CONSUMER_SLEEP 0x32 // HID type OSC +#define HID_CONSUMER_SLEEP_AFTER 0x33 // HID type OSC +#define HID_CONSUMER_SLEEP_MODE 0x34 // HID type RTC +#define HID_CONSUMER_ILLUMINATION 0x35 // HID type OOC +#define HID_CONSUMER_FUNCTION_BUTTONS 0x36 // HID type NARY +// Reserved 0x37-3F +#define HID_CONSUMER_MENU 0x40 // HID type OOC +#define HID_CONSUMER_MENU_PICK 0x41 // HID type OSC +#define HID_CONSUMER_MENU_UP 0x42 // HID type OSC +#define HID_CONSUMER_MENU_DOWN 0x43 // HID type OSC +#define HID_CONSUMER_MENU_LEFT 0x44 // HID type OSC +#define HID_CONSUMER_MENU_RIGHT 0x45 // HID type OSC +#define HID_CONSUMER_MENU_ESCAPE 0x46 // HID type OSC +#define HID_CONSUMER_MENU_VALUE_INCREASE 0x47 // HID type OSC +#define HID_CONSUMER_MENU_VALUE_DECREASE 0x48 // HID type OSC +// Reserved 0x49-5F +#define HID_CONSUMER_DATA_ON_SCREEN 0x60 // HID type OOC +#define HID_CONSUMER_CLOSED_CAPTION 0x61 // HID type OOC +#define HID_CONSUMER_CLOSED_CAPTION_SELECT 0x62 // HID type OSC +#define HID_CONSUMER_VCR_SLASH_TV 0x63 // HID type OOC +#define HID_CONSUMER_BROADCAST_MODE 0x64 // HID type OSC +#define HID_CONSUMER_SNAPSHOT 0x65 // HID type OSC +#define HID_CONSUMER_STILL 0x66 // HID type OSC +// Reserved 0x67-7F +#define HID_CONSUMER_SELECTION 0x80 // HID type NARY +#define HID_CONSUMER_ASSIGN_SELECTION 0x81 // HID type OSC +#define HID_CONSUMER_MODE_STEP 0x82 // HID type OSC +#define HID_CONSUMER_RECALL_LAST 0x83 // HID type OSC +#define HID_CONSUMER_ENTER_CHANNEL 0x84 // HID type OSC +#define HID_CONSUMER_ORDER_MOVIE 0x85 // HID type OSC +#define HID_CONSUMER_CHANNEL 0x86 // HID type LC +#define HID_CONSUMER_MEDIA_SELECTION 0x87 // HID type NARY +#define HID_CONSUMER_MEDIA_SELECT_COMPUTER 0x88 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_TV 0x89 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_WWW 0x8A // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_DVD 0x8B // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_TELEPHONE 0x8C // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_PROGRAM_GUIDE 0x8D // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_VIDEO_PHONE 0x8E // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_GAMES 0x8F // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_MESSAGES 0x90 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_CD 0x91 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_VCR 0x92 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_TUNER 0x93 // HID type SEL +#define HID_CONSUMER_QUIT 0x94 // HID type OSC +#define HID_CONSUMER_HELP 0x95 // HID type OOC +#define HID_CONSUMER_MEDIA_SELECT_TAPE 0x96 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_CABLE 0x97 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_SATELLITE 0x98 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_SECURITY 0x99 // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_HOME 0x9A // HID type SEL +#define HID_CONSUMER_MEDIA_SELECT_CALL 0x9B // HID type SEL +#define HID_CONSUMER_CHANNEL_INCREMENT 0x9C // HID type OSC +#define HID_CONSUMER_CHANNEL_DECREMENT 0x9D // HID type OSC +#define HID_CONSUMER_MEDIA_SELECT_SAP 0x9E // HID type SEL +// Reserved 0x9F +#define HID_CONSUMER_VCR_PLUS 0xA0 // HID type OSC +#define HID_CONSUMER_ONCE 0xA1 // HID type OSC +#define HID_CONSUMER_DAILY 0xA2 // HID type OSC +#define HID_CONSUMER_WEEKLY 0xA3 // HID type OSC +#define HID_CONSUMER_MONTHLY 0xA4 // HID type OSC +// Reserved 0xA5-AF +#define HID_CONSUMER_PLAY 0xB0 // HID type OOC +#define HID_CONSUMER_PAUSE 0xB1 // HID type OOC +#define HID_CONSUMER_RECORD 0xB2 // HID type OOC +#define HID_CONSUMER_FAST_FORWARD 0xB3 // HID type OOC +#define HID_CONSUMER_REWIND 0xB4 // HID type OOC +#define HID_CONSUMER_SCAN_NEXT_TRACK 0xB5 // HID type OSC +#define HID_CONSUMER_SCAN_PREVIOUS_TRACK 0xB6 // HID type OSC +#define HID_CONSUMER_STOP 0xB7 // HID type OSC +#define HID_CONSUMER_EJECT 0xB8 // HID type OSC +#define HID_CONSUMER_RANDOM_PLAY 0xB9 // HID type OOC +#define HID_CONSUMER_SELECT_DISC 0xBA // HID type NARY +#define HID_CONSUMER_ENTER_DISC_MC 0xBB +#define HID_CONSUMER_REPEAT 0xBC // HID type OSC +#define HID_CONSUMER_TRACKING 0xBD // HID type LC +#define HID_CONSUMER_TRACK_NORMAL 0xBE // HID type OSC +#define HID_CONSUMER_SLOW_TRACKING 0xBF // HID type LC +#define HID_CONSUMER_FRAME_FORWARD 0xC0 // HID type RTC +#define HID_CONSUMER_FRAME_BACK 0xC1 // HID type RTC +#define HID_CONSUMER_MARK 0xC2 // HID type OSC +#define HID_CONSUMER_CLEAR_MARK 0xC3 // HID type OSC +#define HID_CONSUMER_REPEAT_FROM_MARK 0xC4 // HID type OOC +#define HID_CONSUMER_RETURN_TO_MARK 0xC5 // HID type OSC +#define HID_CONSUMER_SEARCH_MARK_FORWARD 0xC6 // HID type OSC +#define HID_CONSUMER_SEARCH_MARK_BACKWARDS 0xC7 // HID type OSC +#define HID_CONSUMER_COUNTER_RESET 0xC8 // HID type OSC +#define HID_CONSUMER_SHOW_COUNTER 0xC9 // HID type OSC +#define HID_CONSUMER_TRACKING_INCREMENT 0xCA // HID type RTC +#define HID_CONSUMER_TRACKING_DECREMENT 0xCB // HID type RTC +#define HID_CONSUMER_STOP_SLASH_EJECT 0xCC // HID type OSC +#define HID_CONSUMER_PLAY_SLASH_PAUSE 0xCD // HID type OSC +#define HID_CONSUMER_PLAY_SLASH_SKIP 0xCE // HID type OSC +// Reserved 0xCF-DF +#define HID_CONSUMER_VOLUME 0xE0 // HID type LC +#define HID_CONSUMER_BALANCE 0xE1 // HID type LC +#define HID_CONSUMER_MUTE 0xE2 // HID type OOC +#define HID_CONSUMER_BASS 0xE3 // HID type LC +#define HID_CONSUMER_TREBLE 0xE4 // HID type LC +#define HID_CONSUMER_BASS_BOOST 0xE5 // HID type OOC +#define HID_CONSUMER_SURROUND_MODE 0xE6 // HID type OSC +#define HID_CONSUMER_LOUDNESS 0xE7 // HID type OOC +#define HID_CONSUMER_MPX 0xE8 // HID type OOC +#define HID_CONSUMER_VOLUME_INCREMENT 0xE9 // HID type RTC +#define HID_CONSUMER_VOLUME_DECREMENT 0xEA // HID type RTC +// Reserved 0xEB-EF +#define HID_CONSUMER_SPEED_SELECT 0xF0 // HID type OSC +#define HID_CONSUMER_PLAYBACK_SPEED 0xF1 // HID type NARY +#define HID_CONSUMER_STANDARD_PLAY 0xF2 // HID type SEL +#define HID_CONSUMER_LONG_PLAY 0xF3 // HID type SEL +#define HID_CONSUMER_EXTENDED_PLAY 0xF4 // HID type SEL +#define HID_CONSUMER_SLOW 0xF5 // HID type OSC +// Reserved 0xF6-FF +#define HID_CONSUMER_FAN_ENABLE 0x100 // HID type OOC +#define HID_CONSUMER_FAN_SPEED 0x101 // HID type LC +#define HID_CONSUMER_LIGHT_ENABLE 0x102 // HID type OOC +#define HID_CONSUMER_LIGHT_ILLUMINATION_LEVEL 0x103 // HID type LC +#define HID_CONSUMER_CLIMATE_CONTROL_ENABLE 0x104 // HID type OOC +#define HID_CONSUMER_ROOM_TEMPERATURE 0x105 // HID type LC +#define HID_CONSUMER_SECURITY_ENABLE 0x106 // HID type OOC +#define HID_CONSUMER_FIRE_ALARM 0x107 // HID type OSC +#define HID_CONSUMER_POLICE_ALARM 0x108 // HID type OSC +#define HID_CONSUMER_PROXIMITY 0x109 // HID type LC +#define HID_CONSUMER_MOTION 0x10A // HID type OSC +#define HID_CONSUMER_DURESS_ALARM 0x10B // HID type OSC +#define HID_CONSUMER_HOLDUP_ALARM 0x10C // HID type OSC +#define HID_CONSUMER_MEDICAL_ALARM 0x10D // HID type OSC +// Reserved 0x10E-14F +#define HID_CONSUMER_BALANCE_RIGHT 0x150 // HID type RTC +#define HID_CONSUMER_BALANCE_LEFT 0x151 // HID type RTC +#define HID_CONSUMER_BASS_INCREMENT 0x152 // HID type RTC +#define HID_CONSUMER_BASS_DECREMENT 0x153 // HID type RTC +#define HID_CONSUMER_TREBLE_INCREMENT 0x154 // HID type RTC +#define HID_CONSUMER_TREBLE_DECREMENT 0x155 // HID type RTC +// Reserved 0x156-15F +#define HID_CONSUMER_SPEAKER_SYSTEM 0x160 // HID type CL +#define HID_CONSUMER_CHANNEL_LEFT 0x161 // HID type CL +#define HID_CONSUMER_CHANNEL_RIGHT 0x162 // HID type CL +#define HID_CONSUMER_CHANNEL_CENTER 0x163 // HID type CL +#define HID_CONSUMER_CHANNEL_FRONT 0x164 // HID type CL +#define HID_CONSUMER_CHANNEL_CENTER_FRONT 0x165 // HID type CL +#define HID_CONSUMER_CHANNEL_SIDE 0x166 // HID type CL +#define HID_CONSUMER_CHANNEL_SURROUND 0x167 // HID type CL +#define HID_CONSUMER_CHANNEL_LOW_FREQUENCY_ENHANCEMENT 0x168 // HID type CL +#define HID_CONSUMER_CHANNEL_TOP 0x169 // HID type CL +#define HID_CONSUMER_CHANNEL_UNKNOWN 0x16A // HID type CL +// Reserved 0x16B-16F +#define HID_CONSUMER_SUB-CHANNEL 0x170 // HID type LC +#define HID_CONSUMER_SUB-CHANNEL_INCREMENT 0x171 // HID type OSC +#define HID_CONSUMER_SUB-CHANNEL_DECREMENT 0x172 // HID type OSC +#define HID_CONSUMER_ALTERNATE_AUDIO_INCREMENT 0x173 // HID type OSC +#define HID_CONSUMER_ALTERNATE_AUDIO_DECREMENT 0x174 // HID type OSC +// Reserved 0x175-17F +#define HID_CONSUMER_APPLICATION_LAUNCH_BUTTONS 0x180 // HID type NARY +#define HID_CONSUMER_AL_LAUNCH_BUTTON_CONFIGURATION_TOOL 0x181 // HID type SEL +#define HID_CONSUMER_AL_PROGRAMMABLE_BUTTON_CONFIGURATION 0x182 // HID type SEL +#define HID_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION 0x183 // HID type SEL +#define HID_CONSUMER_AL_WORD_PROCESSOR 0x184 // HID type SEL +#define HID_CONSUMER_AL_TEXT_EDITOR 0x185 // HID type SEL +#define HID_CONSUMER_AL_SPREADSHEET 0x186 // HID type SEL +#define HID_CONSUMER_AL_GRAPHICS_EDITOR 0x187 // HID type SEL +#define HID_CONSUMER_AL_PRESENTATION_APP 0x188 // HID type SEL +#define HID_CONSUMER_AL_DATABASE_APP 0x189 // HID type SEL +#define HID_CONSUMER_AL_EMAIL_READER 0x18A // HID type SEL +#define HID_CONSUMER_AL_NEWSREADER 0x18B // HID type SEL +#define HID_CONSUMER_AL_VOICEMAIL 0x18C // HID type SEL +#define HID_CONSUMER_AL_CONTACTS_SLASH_ADDRESS_BOOK 0x18D // HID type SEL +#define HID_CONSUMER_AL_CALENDAR_SLASH_SCHEDULE 0x18E // HID type SEL +#define HID_CONSUMER_AL_TASK_SLASH_PROJECT_MANAGER 0x18F // HID type SEL +#define HID_CONSUMER_AL_LOG_SLASH_JOURNAL_SLASH_TIMECARD 0x190 // HID type SEL +#define HID_CONSUMER_AL_CHECKBOOK_SLASH_FINANCE 0x191 // HID type SEL +#define HID_CONSUMER_AL_CALCULATOR 0x192 // HID type SEL +#define HID_CONSUMER_AL_A_SLASH_V_CAPTURE_SLASH_PLAYBACK 0x193 // HID type SEL +#define HID_CONSUMER_AL_LOCAL_MACHINE_BROWSER 0x194 // HID type SEL +#define HID_CONSUMER_AL_LAN_SLASH_WAN_BROWSER 0x195 // HID type SEL +#define HID_CONSUMER_AL_INTERNET_BROWSER 0x196 // HID type SEL +#define HID_CONSUMER_AL_REMOTE_NETWORKING_SLASH_ISP_CONNECT 0x197 // HID type SEL +#define HID_CONSUMER_AL_NETWORK_CONFERENCE 0x198 // HID type SEL +#define HID_CONSUMER_AL_NETWORK_CHAT 0x199 // HID type SEL +#define HID_CONSUMER_AL_TELEPHONY_SLASH_DIALER 0x19A // HID type SEL +#define HID_CONSUMER_AL_LOGON 0x19B // HID type SEL +#define HID_CONSUMER_AL_LOGOFF 0x19C // HID type SEL +#define HID_CONSUMER_AL_LOGON_SLASH_LOGOFF 0x19D // HID type SEL +#define HID_CONSUMER_AL_TERMINAL_LOCK_SLASH_SCREENSAVER 0x19E // HID type SEL +#define HID_CONSUMER_AL_CONTROL_PANEL 0x19F // HID type SEL +#define HID_CONSUMER_AL_COMMAND_LINE_PROCESSOR_SLASH_RUN 0x1A0 // HID type SEL +#define HID_CONSUMER_AL_PROCESS_SLASH_TASK_MANAGER 0x1A1 // HID type SEL +#define HID_CONSUMER_AL_SELECT_TASK_SLASH_APPLICATION 0x1A2 // HID type SEL +#define HID_CONSUMER_AL_NEXT_TASK_SLASH_APPLICATION 0x1A3 // HID type SEL +#define HID_CONSUMER_AL_PREVIOUS_TASK_SLASH_APPLICATION 0x1A4 // HID type SEL +#define HID_CONSUMER_AL_PREEMPTIVE_HALT_TASK_SLASH_APPLICATION 0x1A5 // HID type SEL +#define HID_CONSUMER_AL_INTEGRATED_HELP_CENTER 0x1A6 // HID type SEL +#define HID_CONSUMER_AL_DOCUMENTS 0x1A7 // HID type SEL +#define HID_CONSUMER_AL_THESAURUS 0x1A8 // HID type SEL +#define HID_CONSUMER_AL_DICTIONARY 0x1A9 // HID type SEL +#define HID_CONSUMER_AL_DESKTOP 0x1AA // HID type SEL +#define HID_CONSUMER_AL_SPELL_CHECK 0x1AB // HID type SEL +#define HID_CONSUMER_AL_GRAMMAR_CHECK 0x1AC // HID type SEL +#define HID_CONSUMER_AL_WIRELESS_STATUS 0x1AD // HID type SEL +#define HID_CONSUMER_AL_KEYBOARD_LAYOUT 0x1AE // HID type SEL +#define HID_CONSUMER_AL_VIRUS_PROTECTION 0x1AF // HID type SEL +#define HID_CONSUMER_AL_ENCRYPTION 0x1B0 // HID type SEL +#define HID_CONSUMER_AL_SCREEN_SAVER 0x1B1 // HID type SEL +#define HID_CONSUMER_AL_ALARMS 0x1B2 // HID type SEL +#define HID_CONSUMER_AL_CLOCK 0x1B3 // HID type SEL +#define HID_CONSUMER_AL_FILE_BROWSER 0x1B4 // HID type SEL +#define HID_CONSUMER_AL_POWER_STATUS 0x1B5 // HID type SEL +#define HID_CONSUMER_AL_IMAGE_BROWSER 0x1B6 // HID type SEL +#define HID_CONSUMER_AL_AUDIO_BROWSER 0x1B7 // HID type SEL +#define HID_CONSUMER_AL_MOVIE_BROWSER 0x1B8 // HID type SEL +#define HID_CONSUMER_AL_DIGITAL_RIGHTS_MANAGER 0x1B9 // HID type SEL +#define HID_CONSUMER_AL_DIGITAL_WALLET 0x1BA // HID type SEL +// _Reserved 0x1BB +#define HID_CONSUMER_AL_INSTANT_MESSAGING 0x1BC // HID type SEL +#define HID_CONSUMER_AL_OEM_FEATURES_SLASH__TIPS_SLASH_TUTORIAL_BROWSER 0x1BD // HID type SEL +#define HID_CONSUMER_AL_OEM_HELP 0x1BE // HID type SEL +#define HID_CONSUMER_AL_ONLINE_COMMUNITY 0x1BF // HID type SEL +#define HID_CONSUMER_AL_ENTERTAINMENT_CONTENT_BROWSER 0x1C0 // HID type SEL +#define HID_CONSUMER_AL_ONLINE_SHOPPING_BROWSER 0x1C1 // HID type SEL +#define HID_CONSUMER_AL_SMARTCARD_INFORMATION_SLASH_HELP 0x1C2 // HID type SEL +#define HID_CONSUMER_AL_MARKET_MONITOR_SLASH_FINANCE_BROWSER 0x1C3 // HID type SEL +#define HID_CONSUMER_AL_CUSTOMIZED_CORPORATE_NEWS_BROWSER 0x1C4 // HID type SEL +#define HID_CONSUMER_AL_ONLINE_ACTIVITY_BROWSER 0x1C5 // HID type SEL +#define HID_CONSUMER_AL_RESEARCH_SLASH_SEARCH_BROWSER 0x1C6 // HID type SEL +#define HID_CONSUMER_AL_AUDIO_PLAYER 0x1C7 // HID type SEL +// Reserved 0x1C8-1FF +#define HID_CONSUMER_GENERIC_GUI_APPLICATION_CONTROLS 0x200 // HID type NARY +#define HID_CONSUMER_AC_NEW 0x201 // HID type SEL +#define HID_CONSUMER_AC_OPEN 0x202 // HID type SEL +#define HID_CONSUMER_AC_CLOSE 0x203 // HID type SEL +#define HID_CONSUMER_AC_EXIT 0x204 // HID type SEL +#define HID_CONSUMER_AC_MAXIMIZE 0x205 // HID type SEL +#define HID_CONSUMER_AC_MINIMIZE 0x206 // HID type SEL +#define HID_CONSUMER_AC_SAVE 0x207 // HID type SEL +#define HID_CONSUMER_AC_PRINT 0x208 // HID type SEL +#define HID_CONSUMER_AC_PROPERTIES 0x209 // HID type SEL +#define HID_CONSUMER_AC_UNDO 0x21A // HID type SEL +#define HID_CONSUMER_AC_COPY 0x21B // HID type SEL +#define HID_CONSUMER_AC_CUT 0x21C // HID type SEL +#define HID_CONSUMER_AC_PASTE 0x21D // HID type SEL +#define HID_CONSUMER_AC_SELECT_ALL 0x21E // HID type SEL +#define HID_CONSUMER_AC_FIND 0x21F // HID type SEL +#define HID_CONSUMER_AC_FIND_AND_REPLACE 0x220 // HID type SEL +#define HID_CONSUMER_AC_SEARCH 0x221 // HID type SEL +#define HID_CONSUMER_AC_GO_TO 0x222 // HID type SEL +#define HID_CONSUMER_AC_HOME 0x223 // HID type SEL +#define HID_CONSUMER_AC_BACK 0x224 // HID type SEL +#define HID_CONSUMER_AC_FORWARD 0x225 // HID type SEL +#define HID_CONSUMER_AC_STOP 0x226 // HID type SEL +#define HID_CONSUMER_AC_REFRESH 0x227 // HID type SEL +#define HID_CONSUMER_AC_PREVIOUS_LINK 0x228 // HID type SEL +#define HID_CONSUMER_AC_NEXT_LINK 0x229 // HID type SEL +#define HID_CONSUMER_AC_BOOKMARKS 0x22A // HID type SEL +#define HID_CONSUMER_AC_HISTORY 0x22B // HID type SEL +#define HID_CONSUMER_AC_SUBSCRIPTIONS 0x22C // HID type SEL +#define HID_CONSUMER_AC_ZOOM_IN 0x22D // HID type SEL +#define HID_CONSUMER_AC_ZOOM_OUT 0x22E // HID type SEL +#define HID_CONSUMER_AC_ZOOM 0x22F // HID type LC +#define HID_CONSUMER_AC_FULL_SCREEN_VIEW 0x230 // HID type SEL +#define HID_CONSUMER_AC_NORMAL_VIEW 0x231 // HID type SEL +#define HID_CONSUMER_AC_VIEW_TOGGLE 0x232 // HID type SEL +#define HID_CONSUMER_AC_SCROLL_UP 0x233 // HID type SEL +#define HID_CONSUMER_AC_SCROLL_DOWN 0x234 // HID type SEL +#define HID_CONSUMER_AC_SCROLL 0x235 // HID type LC +#define HID_CONSUMER_AC_PAN_LEFT 0x236 // HID type SEL +#define HID_CONSUMER_AC_PAN_RIGHT 0x237 // HID type SEL +#define HID_CONSUMER_AC_PAN 0x238 // HID type LC +#define HID_CONSUMER_AC_NEW_WINDOW 0x239 // HID type SEL +#define HID_CONSUMER_AC_TILE_HORIZONTALLY 0x23A // HID type SEL +#define HID_CONSUMER_AC_TILE_VERTICALLY 0x23B // HID type SEL +#define HID_CONSUMER_AC_FORMAT 0x23C // HID type SEL +#define HID_CONSUMER_AC_EDIT 0x23D // HID type SEL +#define HID_CONSUMER_AC_BOLD 0x23E // HID type SEL +#define HID_CONSUMER_AC_ITALICS 0x23F // HID type SEL +#define HID_CONSUMER_AC_UNDERLINE 0x240 // HID type SEL +#define HID_CONSUMER_AC_STRIKETHROUGH 0x241 // HID type SEL +#define HID_CONSUMER_AC_SUBSCRIPT 0x242 // HID type SEL +#define HID_CONSUMER_AC_SUPERSCRIPT 0x243 // HID type SEL +#define HID_CONSUMER_AC_ALL_CAPS 0x244 // HID type SEL +#define HID_CONSUMER_AC_ROTATE 0x245 // HID type SEL +#define HID_CONSUMER_AC_RESIZE 0x246 // HID type SEL +#define HID_CONSUMER_AC_FLIP_HORIZONTAL 0x247 // HID type SEL +#define HID_CONSUMER_AC_FLIP_VERTICAL 0x248 // HID type SEL +#define HID_CONSUMER_AC_MIRROR_HORIZONTAL 0x249 // HID type SEL +#define HID_CONSUMER_AC_MIRROR_VERTICAL 0x24A // HID type SEL +#define HID_CONSUMER_AC_FONT_SELECT 0x24B // HID type SEL +#define HID_CONSUMER_AC_FONT_COLOR 0x24C // HID type SEL +#define HID_CONSUMER_AC_FONT_SIZE 0x24D // HID type SEL +#define HID_CONSUMER_AC_JUSTIFY_LEFT 0x24E // HID type SEL +#define HID_CONSUMER_AC_JUSTIFY_CENTER_H 0x24F // HID type SEL +#define HID_CONSUMER_AC_JUSTIFY_RIGHT 0x250 // HID type SEL +#define HID_CONSUMER_AC_JUSTIFY_BLOCK_H 0x251 // HID type SEL +#define HID_CONSUMER_AC_JUSTIFY_TOP 0x252 // HID type SEL +#define HID_CONSUMER_AC_JUSTIFY_CENTER_V 0x253 // HID type SEL +#define HID_CONSUMER_AC_JUSTIFY_BOTTOM 0x254 // HID type SEL +#define HID_CONSUMER_AC_JUSTIFY_BLOCK_V 0x255 // HID type SEL +#define HID_CONSUMER_AC_INDENT_DECREASE 0x256 // HID type SEL +#define HID_CONSUMER_AC_INDENT_INCREASE 0x257 // HID type SEL +#define HID_CONSUMER_AC_NUMBERED_LIST 0x258 // HID type SEL +#define HID_CONSUMER_AC_RESTART_NUMBERING 0x259 // HID type SEL +#define HID_CONSUMER_AC_BULLETED_LIST 0x25A // HID type SEL +#define HID_CONSUMER_AC_PROMOTE 0x25B // HID type SEL +#define HID_CONSUMER_AC_DEMOTE 0x25C // HID type SEL +#define HID_CONSUMER_AC_YES 0x25D // HID type SEL +#define HID_CONSUMER_AC_NO 0x25E // HID type SEL +#define HID_CONSUMER_AC_CANCEL 0x25F // HID type SEL +#define HID_CONSUMER_AC_CATALOG 0x260 // HID type SEL +#define HID_CONSUMER_AC_BUY_SLASH_CHECKOUT 0x261 // HID type SEL +#define HID_CONSUMER_AC_ADD_TO_CART 0x262 // HID type SEL +#define HID_CONSUMER_AC_EXPAND 0x263 // HID type SEL +#define HID_CONSUMER_AC_EXPAND_ALL 0x264 // HID type SEL +#define HID_CONSUMER_AC_COLLAPSE 0x265 // HID type SEL +#define HID_CONSUMER_AC_COLLAPSE_ALL 0x266 // HID type SEL +#define HID_CONSUMER_AC_PRINT_PREVIEW 0x267 // HID type SEL +#define HID_CONSUMER_AC_PASTE_SPECIAL 0x268 // HID type SEL +#define HID_CONSUMER_AC_INSERT_MODE 0x269 // HID type SEL +#define HID_CONSUMER_AC_DELETE 0x26A // HID type SEL +#define HID_CONSUMER_AC_LOCK 0x26B // HID type SEL +#define HID_CONSUMER_AC_UNLOCK 0x26C // HID type SEL +#define HID_CONSUMER_AC_PROTECT 0x26D // HID type SEL +#define HID_CONSUMER_AC_UNPROTECT 0x26E // HID type SEL +#define HID_CONSUMER_AC_ATTACH_COMMENT 0x26F // HID type SEL +#define HID_CONSUMER_AC_DELETE_COMMENT 0x270 // HID type SEL +#define HID_CONSUMER_AC_VIEW_COMMENT 0x271 // HID type SEL +#define HID_CONSUMER_AC_SELECT_WORD 0x272 // HID type SEL +#define HID_CONSUMER_AC_SELECT_SENTENCE 0x273 // HID type SEL +#define HID_CONSUMER_AC_SELECT_PARAGRAPH 0x274 // HID type SEL +#define HID_CONSUMER_AC_SELECT_COLUMN 0x275 // HID type SEL +#define HID_CONSUMER_AC_SELECT_ROW 0x276 // HID type SEL +#define HID_CONSUMER_AC_SELECT_TABLE 0x277 // HID type SEL +#define HID_CONSUMER_AC_SELECT_OBJECT 0x278 // HID type SEL +#define HID_CONSUMER_AC_REDO_SLASH_REPEAT 0x279 // HID type SEL +#define HID_CONSUMER_AC_SORT 0x27A // HID type SEL +#define HID_CONSUMER_AC_SORT_ASCENDING 0x27B // HID type SEL +#define HID_CONSUMER_AC_SORT_DESCENDING 0x27C // HID type SEL +#define HID_CONSUMER_AC_FILTER 0x27D // HID type SEL +#define HID_CONSUMER_AC_SET_CLOCK 0x27E // HID type SEL +#define HID_CONSUMER_AC_VIEW_CLOCK 0x27F // HID type SEL +#define HID_CONSUMER_AC_SELECT_TIME_ZONE 0x280 // HID type SEL +#define HID_CONSUMER_AC_EDIT_TIME_ZONES 0x281 // HID type SEL +#define HID_CONSUMER_AC_SET_ALARM 0x282 // HID type SEL +#define HID_CONSUMER_AC_CLEAR_ALARM 0x283 // HID type SEL +#define HID_CONSUMER_AC_SNOOZE_ALARM 0x284 // HID type SEL +#define HID_CONSUMER_AC_RESET_ALARM 0x285 // HID type SEL +#define HID_CONSUMER_AC_SYNCHRONIZE 0x286 // HID type SEL +#define HID_CONSUMER_AC_SEND_SLASH_RECEIVE 0x287 // HID type SEL +#define HID_CONSUMER_AC_SEND_TO 0x288 // HID type SEL +#define HID_CONSUMER_AC_REPLY 0x289 // HID type SEL +#define HID_CONSUMER_AC_REPLY_ALL 0x28A // HID type SEL +#define HID_CONSUMER_AC_FORWARD_MSG 0x28B // HID type SEL +#define HID_CONSUMER_AC_SEND 0x28C // HID type SEL +#define HID_CONSUMER_AC_ATTACH_FILE 0x28D // HID type SEL +#define HID_CONSUMER_AC_UPLOAD 0x28E // HID type SEL +#define HID_CONSUMER_AC_DOWNLOAD_(SAVE_TARGET_AS) 0x28F // HID type SEL +#define HID_CONSUMER_AC_SET_BORDERS 0x290 // HID type SEL +#define HID_CONSUMER_AC_INSERT_ROW 0x291 // HID type SEL +#define HID_CONSUMER_AC_INSERT_COLUMN 0x292 // HID type SEL +#define HID_CONSUMER_AC_INSERT_FILE 0x293 // HID type SEL +#define HID_CONSUMER_AC_INSERT_PICTURE 0x294 // HID type SEL +#define HID_CONSUMER_AC_INSERT_OBJECT 0x295 // HID type SEL +#define HID_CONSUMER_AC_INSERT_SYMBOL 0x296 // HID type SEL +#define HID_CONSUMER_AC_SAVE_AND_CLOSE 0x297 // HID type SEL +#define HID_CONSUMER_AC_RENAME 0x298 // HID type SEL +#define HID_CONSUMER_AC_MERGE 0x299 // HID type SEL +#define HID_CONSUMER_AC_SPLIT 0x29A // HID type SEL +#define HID_CONSUMER_AC_DISRIBUTE_HORIZONTALLY 0x29B // HID type SEL +#define HID_CONSUMER_AC_DISTRIBUTE_VERTICALLY 0x29C // HID type SEL + +#endif // __HIDTables__ diff --git a/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial.cpp b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial.cpp new file mode 100644 index 00000000..41935e32 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial.cpp @@ -0,0 +1,252 @@ +/* + HardwareSerial.cpp - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Modified 23 November 2006 by David A. Mellis + Modified 28 September 2010 by Mark Sproul + Modified 14 August 2012 by Alarus + Modified 3 December 2013 by Matthijs Kooijman +*/ + +#include +#include +#include +#include +#include "Arduino.h" + +#include "HardwareSerial.h" +#include "HardwareSerial_private.h" + +// this next line disables the entire HardwareSerial.cpp, +// this is so I can support Attiny series and any other chip without a uart +#if defined(HAVE_HWSERIAL0) || defined(HAVE_HWSERIAL1) || defined(HAVE_HWSERIAL2) || defined(HAVE_HWSERIAL3) + +// SerialEvent functions are weak, so when the user doesn't define them, +// the linker just sets their address to 0 (which is checked below). +// The Serialx_available is just a wrapper around Serialx.available(), +// but we can refer to it weakly so we don't pull in the entire +// HardwareSerial instance if the user doesn't also refer to it. +#if defined(HAVE_HWSERIAL0) + void serialEvent() __attribute__((weak)); + bool Serial0_available() __attribute__((weak)); +#endif + +#if defined(HAVE_HWSERIAL1) + void serialEvent1() __attribute__((weak)); + bool Serial1_available() __attribute__((weak)); +#endif + +#if defined(HAVE_HWSERIAL2) + void serialEvent2() __attribute__((weak)); + bool Serial2_available() __attribute__((weak)); +#endif + +#if defined(HAVE_HWSERIAL3) + void serialEvent3() __attribute__((weak)); + bool Serial3_available() __attribute__((weak)); +#endif + +void serialEventRun(void) +{ +#if defined(HAVE_HWSERIAL0) + if (Serial0_available && serialEvent && Serial0_available()) serialEvent(); +#endif +#if defined(HAVE_HWSERIAL1) + if (Serial1_available && serialEvent1 && Serial1_available()) serialEvent1(); +#endif +#if defined(HAVE_HWSERIAL2) + if (Serial2_available && serialEvent2 && Serial2_available()) serialEvent2(); +#endif +#if defined(HAVE_HWSERIAL3) + if (Serial3_available && serialEvent3 && Serial3_available()) serialEvent3(); +#endif +} + +// Actual interrupt handlers ////////////////////////////////////////////////////////////// + +void HardwareSerial::_tx_udr_empty_irq(void) +{ + // If interrupts are enabled, there must be more data in the output + // buffer. Send the next byte + unsigned char c = _tx_buffer[_tx_buffer_tail]; + _tx_buffer_tail = (_tx_buffer_tail + 1) % SERIAL_TX_BUFFER_SIZE; + + *_udr = c; + + // clear the TXC bit -- "can be cleared by writing a one to its bit + // location". This makes sure flush() won't return until the bytes + // actually got written + sbi(*_ucsra, TXC0); + + if (_tx_buffer_head == _tx_buffer_tail) { + // Buffer empty, so disable interrupts + cbi(*_ucsrb, UDRIE0); + } +} + +// Public Methods ////////////////////////////////////////////////////////////// + +void HardwareSerial::begin(unsigned long baud, byte config) +{ + // Try u2x mode first + uint16_t baud_setting = (F_CPU / 4 / baud - 1) / 2; + *_ucsra = 1 << U2X0; + + // hardcoded exception for 57600 for compatibility with the bootloader + // shipped with the Duemilanove and previous boards and the firmware + // on the 8U2 on the Uno and Mega 2560. Also, The baud_setting cannot + // be > 4095, so switch back to non-u2x mode if the baud rate is too + // low. + if (((F_CPU == 16000000UL) && (baud == 57600)) || (baud_setting >4095)) + { + *_ucsra = 0; + baud_setting = (F_CPU / 8 / baud - 1) / 2; + } + + // assign the baud_setting, a.k.a. ubrr (USART Baud Rate Register) + *_ubrrh = baud_setting >> 8; + *_ubrrl = baud_setting; + + _written = false; + + //set the data bits, parity, and stop bits +#if defined(__AVR_ATmega8__) + config |= 0x80; // select UCSRC register (shared with UBRRH) +#endif + *_ucsrc = config; + + sbi(*_ucsrb, RXEN0); + sbi(*_ucsrb, TXEN0); + sbi(*_ucsrb, RXCIE0); + cbi(*_ucsrb, UDRIE0); +} + +void HardwareSerial::end() +{ + // wait for transmission of outgoing data + while (_tx_buffer_head != _tx_buffer_tail) + ; + + cbi(*_ucsrb, RXEN0); + cbi(*_ucsrb, TXEN0); + cbi(*_ucsrb, RXCIE0); + cbi(*_ucsrb, UDRIE0); + + // clear any received data + _rx_buffer_head = _rx_buffer_tail; +} + +int HardwareSerial::available(void) +{ + return ((unsigned int)(SERIAL_RX_BUFFER_SIZE + _rx_buffer_head - _rx_buffer_tail)) % SERIAL_RX_BUFFER_SIZE; +} + +int HardwareSerial::peek(void) +{ + if (_rx_buffer_head == _rx_buffer_tail) { + return -1; + } else { + return _rx_buffer[_rx_buffer_tail]; + } +} + +int HardwareSerial::read(void) +{ + // if the head isn't ahead of the tail, we don't have any characters + if (_rx_buffer_head == _rx_buffer_tail) { + return -1; + } else { + unsigned char c = _rx_buffer[_rx_buffer_tail]; + _rx_buffer_tail = (rx_buffer_index_t)(_rx_buffer_tail + 1) % SERIAL_RX_BUFFER_SIZE; + return c; + } +} + +int HardwareSerial::availableForWrite(void) +{ +#if (SERIAL_TX_BUFFER_SIZE>256) + uint8_t oldSREG = SREG; + cli(); +#endif + tx_buffer_index_t head = _tx_buffer_head; + tx_buffer_index_t tail = _tx_buffer_tail; +#if (SERIAL_TX_BUFFER_SIZE>256) + SREG = oldSREG; +#endif + if (head >= tail) return SERIAL_TX_BUFFER_SIZE - 1 - head + tail; + return tail - head - 1; +} + +void HardwareSerial::flush() +{ + // If we have never written a byte, no need to flush. This special + // case is needed since there is no way to force the TXC (transmit + // complete) bit to 1 during initialization + if (!_written) + return; + + while (bit_is_set(*_ucsrb, UDRIE0) || bit_is_clear(*_ucsra, TXC0)) { + if (bit_is_clear(SREG, SREG_I) && bit_is_set(*_ucsrb, UDRIE0)) + // Interrupts are globally disabled, but the DR empty + // interrupt should be enabled, so poll the DR empty flag to + // prevent deadlock + if (bit_is_set(*_ucsra, UDRE0)) + _tx_udr_empty_irq(); + } + // If we get here, nothing is queued anymore (DRIE is disabled) and + // the hardware finished tranmission (TXC is set). +} + +size_t HardwareSerial::write(uint8_t c) +{ + // If the buffer and the data register is empty, just write the byte + // to the data register and be done. This shortcut helps + // significantly improve the effective datarate at high (> + // 500kbit/s) bitrates, where interrupt overhead becomes a slowdown. + if (_tx_buffer_head == _tx_buffer_tail && bit_is_set(*_ucsra, UDRE0)) { + *_udr = c; + sbi(*_ucsra, TXC0); + return 1; + } + tx_buffer_index_t i = (_tx_buffer_head + 1) % SERIAL_TX_BUFFER_SIZE; + + // If the output buffer is full, there's nothing for it other than to + // wait for the interrupt handler to empty it a bit + while (i == _tx_buffer_tail) { + if (bit_is_clear(SREG, SREG_I)) { + // Interrupts are disabled, so we'll have to poll the data + // register empty flag ourselves. If it is set, pretend an + // interrupt has happened and call the handler to free up + // space for us. + if(bit_is_set(*_ucsra, UDRE0)) + _tx_udr_empty_irq(); + } else { + // nop, the interrupt handler will free up space for us + } + } + + _tx_buffer[_tx_buffer_head] = c; + _tx_buffer_head = i; + + sbi(*_ucsrb, UDRIE0); + _written = true; + + return 1; +} + + +#endif // whole file diff --git a/hardware/keyboardio/cores/keyboardio/HardwareSerial.h b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial.h similarity index 55% rename from hardware/keyboardio/cores/keyboardio/HardwareSerial.h rename to hardware/keyboardio/avr/cores/keyboardio/HardwareSerial.h index a73117f5..7dc2aa98 100644 --- a/hardware/keyboardio/cores/keyboardio/HardwareSerial.h +++ b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial.h @@ -18,6 +18,7 @@ Modified 28 September 2010 by Mark Sproul Modified 14 August 2012 by Alarus + Modified 3 December 2013 by Matthijs Kooijman */ #ifndef HardwareSerial_h @@ -27,46 +28,31 @@ #include "Stream.h" -struct ring_buffer; - -class HardwareSerial : public Stream -{ - private: - ring_buffer *_rx_buffer; - ring_buffer *_tx_buffer; - volatile uint8_t *_ubrrh; - volatile uint8_t *_ubrrl; - volatile uint8_t *_ucsra; - volatile uint8_t *_ucsrb; - volatile uint8_t *_ucsrc; - volatile uint8_t *_udr; - uint8_t _rxen; - uint8_t _txen; - uint8_t _rxcie; - uint8_t _udrie; - uint8_t _u2x; - bool transmitting; - public: - HardwareSerial(ring_buffer *rx_buffer, ring_buffer *tx_buffer, - volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, - volatile uint8_t *ucsra, volatile uint8_t *ucsrb, - volatile uint8_t *ucsrc, volatile uint8_t *udr, - uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udrie, uint8_t u2x); - void begin(unsigned long); - void begin(unsigned long, uint8_t); - void end(); - virtual int available(void); - virtual int peek(void); - virtual int read(void); - virtual void flush(void); - virtual size_t write(uint8_t); - inline size_t write(unsigned long n) { return write((uint8_t)n); } - inline size_t write(long n) { return write((uint8_t)n); } - inline size_t write(unsigned int n) { return write((uint8_t)n); } - inline size_t write(int n) { return write((uint8_t)n); } - using Print::write; // pull in write(str) and write(buf, size) from Print - operator bool(); -}; +// Define constants and variables for buffering incoming serial data. We're +// using a ring buffer (I think), in which head is the index of the location +// to which to write the next incoming character and tail is the index of the +// location from which to read. +// NOTE: a "power of 2" buffer size is reccomended to dramatically +// optimize all the modulo operations for ring buffers. +#if !(defined(SERIAL_TX_BUFFER_SIZE) && defined(SERIAL_RX_BUFFER_SIZE)) +#if (RAMEND < 1000) +#define SERIAL_TX_BUFFER_SIZE 16 +#define SERIAL_RX_BUFFER_SIZE 16 +#else +#define SERIAL_TX_BUFFER_SIZE 64 +#define SERIAL_RX_BUFFER_SIZE 64 +#endif +#endif +#if (SERIAL_TX_BUFFER_SIZE>256) +typedef uint16_t tx_buffer_index_t; +#else +typedef uint8_t tx_buffer_index_t; +#endif +#if (SERIAL_RX_BUFFER_SIZE>256) +typedef uint16_t rx_buffer_index_t; +#else +typedef uint8_t rx_buffer_index_t; +#endif // Define config for Serial.begin(baud, config); #define SERIAL_5N1 0x00 @@ -94,20 +80,70 @@ class HardwareSerial : public Stream #define SERIAL_7O2 0x3C #define SERIAL_8O2 0x3E +class HardwareSerial : public Stream +{ + protected: + volatile uint8_t * const _ubrrh; + volatile uint8_t * const _ubrrl; + volatile uint8_t * const _ucsra; + volatile uint8_t * const _ucsrb; + volatile uint8_t * const _ucsrc; + volatile uint8_t * const _udr; + // Has any byte been written to the UART since begin() + bool _written; + + volatile rx_buffer_index_t _rx_buffer_head; + volatile rx_buffer_index_t _rx_buffer_tail; + volatile tx_buffer_index_t _tx_buffer_head; + volatile tx_buffer_index_t _tx_buffer_tail; + + // Don't put any members after these buffers, since only the first + // 32 bytes of this struct can be accessed quickly using the ldd + // instruction. + unsigned char _rx_buffer[SERIAL_RX_BUFFER_SIZE]; + unsigned char _tx_buffer[SERIAL_TX_BUFFER_SIZE]; + + public: + inline HardwareSerial( + volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, + volatile uint8_t *ucsra, volatile uint8_t *ucsrb, + volatile uint8_t *ucsrc, volatile uint8_t *udr); + void begin(unsigned long baud) { begin(baud, SERIAL_8N1); } + void begin(unsigned long, uint8_t); + void end(); + virtual int available(void); + virtual int peek(void); + virtual int read(void); + int availableForWrite(void); + virtual void flush(void); + virtual size_t write(uint8_t); + inline size_t write(unsigned long n) { return write((uint8_t)n); } + inline size_t write(long n) { return write((uint8_t)n); } + inline size_t write(unsigned int n) { return write((uint8_t)n); } + inline size_t write(int n) { return write((uint8_t)n); } + using Print::write; // pull in write(str) and write(buf, size) from Print + operator bool() { return true; } + + // Interrupt handlers - Not intended to be called externally + inline void _rx_complete_irq(void); + void _tx_udr_empty_irq(void); +}; + #if defined(UBRRH) || defined(UBRR0H) extern HardwareSerial Serial; -#elif defined(USBCON) - #include "USBAPI.h" -// extern HardwareSerial Serial_; + #define HAVE_HWSERIAL0 #endif #if defined(UBRR1H) extern HardwareSerial Serial1; + #define HAVE_HWSERIAL1 #endif #if defined(UBRR2H) extern HardwareSerial Serial2; + #define HAVE_HWSERIAL2 #endif #if defined(UBRR3H) extern HardwareSerial Serial3; + #define HAVE_HWSERIAL3 #endif extern void serialEventRun(void) __attribute__((weak)); diff --git a/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial0.cpp b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial0.cpp new file mode 100644 index 00000000..1146eeba --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial0.cpp @@ -0,0 +1,79 @@ +/* + HardwareSerial0.cpp - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Modified 23 November 2006 by David A. Mellis + Modified 28 September 2010 by Mark Sproul + Modified 14 August 2012 by Alarus + Modified 3 December 2013 by Matthijs Kooijman +*/ + +#include "Arduino.h" +#include "HardwareSerial.h" +#include "HardwareSerial_private.h" + +// Each HardwareSerial is defined in its own file, sine the linker pulls +// in the entire file when any element inside is used. --gc-sections can +// additionally cause unused symbols to be dropped, but ISRs have the +// "used" attribute so are never dropped and they keep the +// HardwareSerial instance in as well. Putting each instance in its own +// file prevents the linker from pulling in any unused instances in the +// first place. + +#if defined(HAVE_HWSERIAL0) + +#if defined(USART_RX_vect) + ISR(USART_RX_vect) +#elif defined(USART0_RX_vect) + ISR(USART0_RX_vect) +#elif defined(USART_RXC_vect) + ISR(USART_RXC_vect) // ATmega8 +#else + #error "Don't know what the Data Received vector is called for Serial" +#endif + { + Serial._rx_complete_irq(); + } + +#if defined(UART0_UDRE_vect) +ISR(UART0_UDRE_vect) +#elif defined(UART_UDRE_vect) +ISR(UART_UDRE_vect) +#elif defined(USART0_UDRE_vect) +ISR(USART0_UDRE_vect) +#elif defined(USART_UDRE_vect) +ISR(USART_UDRE_vect) +#else + #error "Don't know what the Data Register Empty vector is called for Serial" +#endif +{ + Serial._tx_udr_empty_irq(); +} + +#if defined(UBRRH) && defined(UBRRL) + HardwareSerial Serial(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR); +#else + HardwareSerial Serial(&UBRR0H, &UBRR0L, &UCSR0A, &UCSR0B, &UCSR0C, &UDR0); +#endif + +// Function that can be weakly referenced by serialEventRun to prevent +// pulling in this file if it's not otherwise used. +bool Serial0_available() { + return Serial.available(); +} + +#endif // HAVE_HWSERIAL0 diff --git a/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial1.cpp b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial1.cpp new file mode 100644 index 00000000..19625e23 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial1.cpp @@ -0,0 +1,69 @@ +/* + HardwareSerial1.cpp - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Modified 23 November 2006 by David A. Mellis + Modified 28 September 2010 by Mark Sproul + Modified 14 August 2012 by Alarus + Modified 3 December 2013 by Matthijs Kooijman +*/ + +#include "Arduino.h" +#include "HardwareSerial.h" +#include "HardwareSerial_private.h" + +// Each HardwareSerial is defined in its own file, sine the linker pulls +// in the entire file when any element inside is used. --gc-sections can +// additionally cause unused symbols to be dropped, but ISRs have the +// "used" attribute so are never dropped and they keep the +// HardwareSerial instance in as well. Putting each instance in its own +// file prevents the linker from pulling in any unused instances in the +// first place. + +#if defined(HAVE_HWSERIAL1) + +#if defined(UART1_RX_vect) +ISR(UART1_RX_vect) +#elif defined(USART1_RX_vect) +ISR(USART1_RX_vect) +#else +#error "Don't know what the Data Register Empty vector is called for Serial1" +#endif +{ + Serial1._rx_complete_irq(); +} + +#if defined(UART1_UDRE_vect) +ISR(UART1_UDRE_vect) +#elif defined(USART1_UDRE_vect) +ISR(USART1_UDRE_vect) +#else +#error "Don't know what the Data Register Empty vector is called for Serial1" +#endif +{ + Serial1._tx_udr_empty_irq(); +} + +HardwareSerial Serial1(&UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UCSR1C, &UDR1); + +// Function that can be weakly referenced by serialEventRun to prevent +// pulling in this file if it's not otherwise used. +bool Serial1_available() { + return Serial1.available(); +} + +#endif // HAVE_HWSERIAL1 diff --git a/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial2.cpp b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial2.cpp new file mode 100644 index 00000000..fd334ae1 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial2.cpp @@ -0,0 +1,57 @@ +/* + HardwareSerial2.cpp - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Modified 23 November 2006 by David A. Mellis + Modified 28 September 2010 by Mark Sproul + Modified 14 August 2012 by Alarus + Modified 3 December 2013 by Matthijs Kooijman +*/ + +#include "Arduino.h" +#include "HardwareSerial.h" +#include "HardwareSerial_private.h" + +// Each HardwareSerial is defined in its own file, sine the linker pulls +// in the entire file when any element inside is used. --gc-sections can +// additionally cause unused symbols to be dropped, but ISRs have the +// "used" attribute so are never dropped and they keep the +// HardwareSerial instance in as well. Putting each instance in its own +// file prevents the linker from pulling in any unused instances in the +// first place. + +#if defined(HAVE_HWSERIAL2) + +ISR(USART2_RX_vect) +{ + Serial2._rx_complete_irq(); +} + +ISR(USART2_UDRE_vect) +{ + Serial2._tx_udr_empty_irq(); +} + +HardwareSerial Serial2(&UBRR2H, &UBRR2L, &UCSR2A, &UCSR2B, &UCSR2C, &UDR2); + +// Function that can be weakly referenced by serialEventRun to prevent +// pulling in this file if it's not otherwise used. +bool Serial2_available() { + return Serial2.available(); +} + +#endif // HAVE_HWSERIAL2 diff --git a/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial3.cpp b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial3.cpp new file mode 100644 index 00000000..a68095b3 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial3.cpp @@ -0,0 +1,57 @@ +/* + HardwareSerial3.cpp - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Modified 23 November 2006 by David A. Mellis + Modified 28 September 2010 by Mark Sproul + Modified 14 August 2012 by Alarus + Modified 3 December 2013 by Matthijs Kooijman +*/ + +#include "Arduino.h" +#include "HardwareSerial.h" +#include "HardwareSerial_private.h" + +// Each HardwareSerial is defined in its own file, sine the linker pulls +// in the entire file when any element inside is used. --gc-sections can +// additionally cause unused symbols to be dropped, but ISRs have the +// "used" attribute so are never dropped and they keep the +// HardwareSerial instance in as well. Putting each instance in its own +// file prevents the linker from pulling in any unused instances in the +// first place. + +#if defined(HAVE_HWSERIAL3) + +ISR(USART3_RX_vect) +{ + Serial3._rx_complete_irq(); +} + +ISR(USART3_UDRE_vect) +{ + Serial3._tx_udr_empty_irq(); +} + +HardwareSerial Serial3(&UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UCSR3C, &UDR3); + +// Function that can be weakly referenced by serialEventRun to prevent +// pulling in this file if it's not otherwise used. +bool Serial3_available() { + return Serial3.available(); +} + +#endif // HAVE_HWSERIAL3 diff --git a/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial_private.h b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial_private.h new file mode 100644 index 00000000..761a5e55 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/HardwareSerial_private.h @@ -0,0 +1,123 @@ +/* + HardwareSerial_private.h - Hardware serial library for Wiring + Copyright (c) 2006 Nicholas Zambetti. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Modified 23 November 2006 by David A. Mellis + Modified 28 September 2010 by Mark Sproul + Modified 14 August 2012 by Alarus +*/ + +#include "wiring_private.h" + +// this next line disables the entire HardwareSerial.cpp, +// this is so I can support Attiny series and any other chip without a uart +#if defined(HAVE_HWSERIAL0) || defined(HAVE_HWSERIAL1) || defined(HAVE_HWSERIAL2) || defined(HAVE_HWSERIAL3) + +// Ensure that the various bit positions we use are available with a 0 +// postfix, so we can always use the values for UART0 for all UARTs. The +// alternative, passing the various values for each UART to the +// HardwareSerial constructor also works, but makes the code bigger and +// slower. +#if !defined(TXC0) +#if defined(TXC) +// Some chips like ATmega8 don't have UPE, only PE. The other bits are +// named as expected. +#if !defined(UPE) && defined(PE) +#define UPE PE +#endif +// On ATmega8, the uart and its bits are not numbered, so there is no TXC0 etc. +#define TXC0 TXC +#define RXEN0 RXEN +#define TXEN0 TXEN +#define RXCIE0 RXCIE +#define UDRIE0 UDRIE +#define U2X0 U2X +#define UPE0 UPE +#define UDRE0 UDRE +#elif defined(TXC1) +// Some devices have uart1 but no uart0 +#define TXC0 TXC1 +#define RXEN0 RXEN1 +#define TXEN0 TXEN1 +#define RXCIE0 RXCIE1 +#define UDRIE0 UDRIE1 +#define U2X0 U2X1 +#define UPE0 UPE1 +#define UDRE0 UDRE1 +#else +#error No UART found in HardwareSerial.cpp +#endif +#endif // !defined TXC0 + +// Check at compiletime that it is really ok to use the bit positions of +// UART0 for the other UARTs as well, in case these values ever get +// changed for future hardware. +#if defined(TXC1) && (TXC1 != TXC0 || RXEN1 != RXEN0 || RXCIE1 != RXCIE0 || \ + UDRIE1 != UDRIE0 || U2X1 != U2X0 || UPE1 != UPE0 || \ + UDRE1 != UDRE0) +#error "Not all bit positions for UART1 are the same as for UART0" +#endif +#if defined(TXC2) && (TXC2 != TXC0 || RXEN2 != RXEN0 || RXCIE2 != RXCIE0 || \ + UDRIE2 != UDRIE0 || U2X2 != U2X0 || UPE2 != UPE0 || \ + UDRE2 != UDRE0) +#error "Not all bit positions for UART2 are the same as for UART0" +#endif +#if defined(TXC3) && (TXC3 != TXC0 || RXEN3 != RXEN0 || RXCIE3 != RXCIE0 || \ + UDRIE3 != UDRIE0 || U3X3 != U3X0 || UPE3 != UPE0 || \ + UDRE3 != UDRE0) +#error "Not all bit positions for UART3 are the same as for UART0" +#endif + +// Constructors //////////////////////////////////////////////////////////////// + +HardwareSerial::HardwareSerial( + volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, + volatile uint8_t *ucsra, volatile uint8_t *ucsrb, + volatile uint8_t *ucsrc, volatile uint8_t *udr) : + _ubrrh(ubrrh), _ubrrl(ubrrl), + _ucsra(ucsra), _ucsrb(ucsrb), _ucsrc(ucsrc), + _udr(udr), + _rx_buffer_head(0), _rx_buffer_tail(0), + _tx_buffer_head(0), _tx_buffer_tail(0) +{ +} + +// Actual interrupt handlers ////////////////////////////////////////////////////////////// + +void HardwareSerial::_rx_complete_irq(void) +{ + if (bit_is_clear(*_ucsra, UPE0)) { + // No Parity error, read byte and store it in the buffer if there is + // room + unsigned char c = *_udr; + rx_buffer_index_t i = (unsigned int)(_rx_buffer_head + 1) % SERIAL_RX_BUFFER_SIZE; + + // if we should be storing the received character into the location + // just before the tail (meaning that the head would advance to the + // current location of the tail), we're about to overflow the buffer + // and so we don't write the character or advance the head. + if (i != _rx_buffer_tail) { + _rx_buffer[_rx_buffer_head] = c; + _rx_buffer_head = i; + } + } else { + // Parity error, read byte but discard it + *_udr; + }; +} + +#endif // whole file diff --git a/hardware/keyboardio/avr/cores/keyboardio/IPAddress.cpp b/hardware/keyboardio/avr/cores/keyboardio/IPAddress.cpp new file mode 100644 index 00000000..899cbd4e --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/IPAddress.cpp @@ -0,0 +1,74 @@ +/* + IPAddress.cpp - Base class that provides IPAddress + Copyright (c) 2011 Adrian McEwen. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +IPAddress::IPAddress() +{ + _address.dword = 0; +} + +IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) +{ + _address.bytes[0] = first_octet; + _address.bytes[1] = second_octet; + _address.bytes[2] = third_octet; + _address.bytes[3] = fourth_octet; +} + +IPAddress::IPAddress(uint32_t address) +{ + _address.dword = address; +} + +IPAddress::IPAddress(const uint8_t *address) +{ + memcpy(_address.bytes, address, sizeof(_address.bytes)); +} + +IPAddress& IPAddress::operator=(const uint8_t *address) +{ + memcpy(_address.bytes, address, sizeof(_address.bytes)); + return *this; +} + +IPAddress& IPAddress::operator=(uint32_t address) +{ + _address.dword = address; + return *this; +} + +bool IPAddress::operator==(const uint8_t* addr) const +{ + return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; +} + +size_t IPAddress::printTo(Print& p) const +{ + size_t n = 0; + for (int i =0; i < 3; i++) + { + n += p.print(_address.bytes[i], DEC); + n += p.print('.'); + } + n += p.print(_address.bytes[3], DEC); + return n; +} + diff --git a/hardware/keyboardio/avr/cores/keyboardio/IPAddress.h b/hardware/keyboardio/avr/cores/keyboardio/IPAddress.h new file mode 100644 index 00000000..94acdc45 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/IPAddress.h @@ -0,0 +1,75 @@ +/* + IPAddress.h - Base class that provides IPAddress + Copyright (c) 2011 Adrian McEwen. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef IPAddress_h +#define IPAddress_h + +#include +#include + +// A class to make it easier to handle and pass around IP addresses + +class IPAddress : public Printable { +private: + union { + uint8_t bytes[4]; // IPv4 address + uint32_t dword; + } _address; + + // Access the raw byte array containing the address. Because this returns a pointer + // to the internal structure rather than a copy of the address this function should only + // be used when you know that the usage of the returned uint8_t* will be transient and not + // stored. + uint8_t* raw_address() { return _address.bytes; }; + +public: + // Constructors + IPAddress(); + IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); + IPAddress(uint32_t address); + IPAddress(const uint8_t *address); + + // Overloaded cast operator to allow IPAddress objects to be used where a pointer + // to a four-byte uint8_t array is expected + operator uint32_t() const { return _address.dword; }; + bool operator==(const IPAddress& addr) const { return _address.dword == addr._address.dword; }; + bool operator==(const uint8_t* addr) const; + + // Overloaded index operator to allow getting and setting individual octets of the address + uint8_t operator[](int index) const { return _address.bytes[index]; }; + uint8_t& operator[](int index) { return _address.bytes[index]; }; + + // Overloaded copy operators to allow initialisation of IPAddress objects from other types + IPAddress& operator=(const uint8_t *address); + IPAddress& operator=(uint32_t address); + + virtual size_t printTo(Print& p) const; + + friend class EthernetClass; + friend class UDP; + friend class Client; + friend class Server; + friend class DhcpClass; + friend class DNSClient; +}; + +const IPAddress INADDR_NONE(0,0,0,0); + + +#endif diff --git a/hardware/keyboardio/cores/keyboardio/Print.cpp b/hardware/keyboardio/avr/cores/keyboardio/Print.cpp old mode 100755 new mode 100644 similarity index 97% rename from hardware/keyboardio/cores/keyboardio/Print.cpp rename to hardware/keyboardio/avr/cores/keyboardio/Print.cpp index 53961ec4..5df56306 --- a/hardware/keyboardio/cores/keyboardio/Print.cpp +++ b/hardware/keyboardio/avr/cores/keyboardio/Print.cpp @@ -41,7 +41,7 @@ size_t Print::write(const uint8_t *buffer, size_t size) size_t Print::print(const __FlashStringHelper *ifsh) { - const char PROGMEM *p = (const char PROGMEM *)ifsh; + PGM_P p = reinterpret_cast(ifsh); size_t n = 0; while (1) { unsigned char c = pgm_read_byte(p++); @@ -53,11 +53,7 @@ size_t Print::print(const __FlashStringHelper *ifsh) size_t Print::print(const String &s) { - size_t n = 0; - for (uint16_t i = 0; i < s.length(); i++) { - n += write(s[i]); - } - return n; + return write(s.c_str(), s.length()); } size_t Print::print(const char str[]) diff --git a/hardware/keyboardio/cores/keyboardio/Print.h b/hardware/keyboardio/avr/cores/keyboardio/Print.h old mode 100755 new mode 100644 similarity index 95% rename from hardware/keyboardio/cores/keyboardio/Print.h rename to hardware/keyboardio/avr/cores/keyboardio/Print.h index dc761508..7b53aa4d --- a/hardware/keyboardio/cores/keyboardio/Print.h +++ b/hardware/keyboardio/avr/cores/keyboardio/Print.h @@ -51,6 +51,9 @@ class Print return write((const uint8_t *)str, strlen(str)); } virtual size_t write(const uint8_t *buffer, size_t size); + size_t write(const char *buffer, size_t size) { + return write((const uint8_t *)buffer, size); + } size_t print(const __FlashStringHelper *); size_t print(const String &); diff --git a/hardware/keyboardio/cores/keyboardio/Printable.h b/hardware/keyboardio/avr/cores/keyboardio/Printable.h similarity index 98% rename from hardware/keyboardio/cores/keyboardio/Printable.h rename to hardware/keyboardio/avr/cores/keyboardio/Printable.h index d03c9af6..2a1b2e9f 100644 --- a/hardware/keyboardio/cores/keyboardio/Printable.h +++ b/hardware/keyboardio/avr/cores/keyboardio/Printable.h @@ -20,7 +20,7 @@ #ifndef Printable_h #define Printable_h -#include +#include class Print; diff --git a/hardware/keyboardio/avr/cores/keyboardio/Server.h b/hardware/keyboardio/avr/cores/keyboardio/Server.h new file mode 100644 index 00000000..69e3e39f --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/Server.h @@ -0,0 +1,30 @@ +/* + Server.h - Base class that provides Server + Copyright (c) 2011 Adrian McEwen. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef server_h +#define server_h + +#include "Print.h" + +class Server : public Print { +public: + virtual void begin() =0; +}; + +#endif diff --git a/hardware/keyboardio/cores/keyboardio/Stream.cpp b/hardware/keyboardio/avr/cores/keyboardio/Stream.cpp similarity index 99% rename from hardware/keyboardio/cores/keyboardio/Stream.cpp rename to hardware/keyboardio/avr/cores/keyboardio/Stream.cpp index aafb7fcf..9c581bee 100644 --- a/hardware/keyboardio/cores/keyboardio/Stream.cpp +++ b/hardware/keyboardio/avr/cores/keyboardio/Stream.cpp @@ -75,7 +75,7 @@ void Stream::setTimeout(unsigned long timeout) // sets the maximum number of mi // find returns true if the target string is found bool Stream::find(char *target) { - return findUntil(target, NULL); + return findUntil(target, (char*)""); } // reads data from the stream until the target string of given length is found @@ -176,7 +176,7 @@ float Stream::parseFloat(char skipChar){ boolean isNegative = false; boolean isFraction = false; long value = 0; - char c; + int c; float fraction = 1.0; c = peekNextDigit(); diff --git a/hardware/keyboardio/cores/keyboardio/Stream.h b/hardware/keyboardio/avr/cores/keyboardio/Stream.h similarity index 86% rename from hardware/keyboardio/cores/keyboardio/Stream.h rename to hardware/keyboardio/avr/cores/keyboardio/Stream.h index 007b4bc6..5cf5ddf0 100644 --- a/hardware/keyboardio/cores/keyboardio/Stream.h +++ b/hardware/keyboardio/avr/cores/keyboardio/Stream.h @@ -57,14 +57,18 @@ class Stream : public Print void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second bool find(char *target); // reads data from the stream until the target string is found + bool find(uint8_t *target) { return find ((char *)target); } // returns true if target string is found, false if timed out (see setTimeout) bool find(char *target, size_t length); // reads data from the stream until the target string of given length is found + bool find(uint8_t *target, size_t length) { return find ((char *)target, length); } // returns true if target string is found, false if timed out bool findUntil(char *target, char *terminator); // as find but search ends if the terminator string is found + bool findUntil(uint8_t *target, char *terminator) { return findUntil((char *)target, terminator); } bool findUntil(char *target, size_t targetLen, char *terminate, size_t termLen); // as above but search ends if the terminate string is found + bool findUntil(uint8_t *target, size_t targetLen, char *terminate, size_t termLen) {return findUntil((char *)target, targetLen, terminate, termLen); } long parseInt(); // returns the first valid (long) integer value from the current position. @@ -74,10 +78,12 @@ class Stream : public Print float parseFloat(); // float version of parseInt size_t readBytes( char *buffer, size_t length); // read chars from stream into buffer + size_t readBytes( uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); } // terminates if length characters have been read or timeout (see setTimeout) // returns the number of characters placed in the buffer (0 means no valid data found) size_t readBytesUntil( char terminator, char *buffer, size_t length); // as readBytes with terminator character + size_t readBytesUntil( char terminator, uint8_t *buffer, size_t length) { return readBytesUntil(terminator, (char *)buffer, length); } // terminates if length characters have been read, timeout, or if the terminator character detected // returns the number of characters placed in the buffer (0 means no valid data found) diff --git a/hardware/keyboardio/cores/keyboardio/Tone.cpp b/hardware/keyboardio/avr/cores/keyboardio/Tone.cpp old mode 100755 new mode 100644 similarity index 100% rename from hardware/keyboardio/cores/keyboardio/Tone.cpp rename to hardware/keyboardio/avr/cores/keyboardio/Tone.cpp diff --git a/hardware/keyboardio/cores/keyboardio/USBAPI.h b/hardware/keyboardio/avr/cores/keyboardio/USBAPI.h similarity index 79% rename from hardware/keyboardio/cores/keyboardio/USBAPI.h rename to hardware/keyboardio/avr/cores/keyboardio/USBAPI.h index 637fa9c2..1121e4af 100644 --- a/hardware/keyboardio/cores/keyboardio/USBAPI.h +++ b/hardware/keyboardio/avr/cores/keyboardio/USBAPI.h @@ -1,10 +1,41 @@ +/* + USBAPI.h + Copyright (c) 2005-2014 Arduino. All right reserved. + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #ifndef __USBAPI__ #define __USBAPI__ +#include +#include +#include +#include +#include + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned long u32; + +#include "Arduino.h" + #if defined(USBCON) -//#define MOUSE_ABS_ENABLED + +#include "USBDesc.h" +#include "USBCore.h" //================================================================================ //================================================================================ @@ -27,26 +58,41 @@ extern USBDevice_ USBDevice; //================================================================================ // Serial over CDC (Serial1 is the physical port) +struct ring_buffer; + +#if (RAMEND < 1000) +#define SERIAL_BUFFER_SIZE 16 +#else +#define SERIAL_BUFFER_SIZE 64 +#endif + class Serial_ : public Stream { private: - ring_buffer *_cdc_rx_buffer; + int peek_buffer; public: + Serial_() { peek_buffer = -1; }; void begin(unsigned long); void begin(unsigned long, uint8_t); void end(void); virtual int available(void); - virtual void accept(void); virtual int peek(void); virtual int read(void); virtual void flush(void); virtual size_t write(uint8_t); + virtual size_t write(const uint8_t*, size_t); using Print::write; // pull in write(str) and write(buf, size) from Print operator bool(); + + volatile uint8_t _rx_buffer_head; + volatile uint8_t _rx_buffer_tail; + unsigned char _rx_buffer[SERIAL_BUFFER_SIZE]; }; extern Serial_ Serial; +#define HAVE_CDCSERIAL + //================================================================================ //================================================================================ // Mouse @@ -67,9 +113,7 @@ public: void end(void); void click(uint8_t b = MOUSE_LEFT); void move(signed char x, signed char y, signed char wheel = 0); -#ifdef MOUSE_ABS_ENABLED - void moveAbs(int16_t x, int16_t y, int16_t wheel); // all parameters have the range of -32768 to 32767 and must be scaled to screen pixels -#endif + void moveAbsolute(uint16_t x, uint16_t y); void press(uint8_t b = MOUSE_LEFT); // press LEFT by default void release(uint8_t b = MOUSE_LEFT); // release LEFT by default bool isPressed(uint8_t b = MOUSE_LEFT); // check LEFT by default @@ -80,6 +124,7 @@ extern Mouse_ Mouse; //================================================================================ // Keyboard +// Legacy keycodes. These are what you use with 'press()' and 'release()' #define KEY_LEFT_CTRL 0x80 #define KEY_LEFT_SHIFT 0x81 #define KEY_LEFT_ALT 0x82 @@ -142,6 +187,7 @@ extern Mouse_ Mouse; #define SYSTEM_CONTROL_DISPLAY_SWAP 16 + // Consumer Control values for Keyboard_::systemControl() // these defines come from the HID usage table "Consumer Device Page (0x0c)" // in the USB standard document "HID Usage Tables" (HUT1_12v2.pdf) @@ -156,22 +202,15 @@ extern Mouse_ Mouse; #define CONSUMER_CONTROL_STOP 5 #define CONSUMER_CONTROL_PREV_TRACK 6 #define CONSUMER_CONTROL_NEXT_TRACK 7 -#define CONSUMER_CONTROL_MAIL 8 -#define CONSUMER_CONTROL_CALCULATOR 9 -#define CONSUMER_CONTROL_WWW_SEARCH 10 -#define CONSUMER_CONTROL_WWW_HOME 11 -#define CONSUMER_CONTROL_WWW_FAVORITES 12 -#define CONSUMER_CONTROL_WWW_REFRESH 13 -#define CONSUMER_CONTROL_WWW_STOP 14 -#define CONSUMER_CONTROL_WWW_FORWARD 15 -#define CONSUMER_CONTROL_WWW_BACK 16 +#define CONSUMER_CONTROL_EJECT 8 // Low level key report: up to 6 keys and shift, ctrl etc at once +#define KEYREPORT_KEYCOUNT 0x06 typedef struct { uint8_t modifiers; uint8_t reserved; - uint8_t keys[6]; + uint8_t keys[KEYREPORT_KEYCOUNT]; } KeyReport; class Keyboard_ : public Print @@ -186,9 +225,14 @@ public: virtual size_t write(uint8_t k); virtual size_t press(uint8_t k); virtual size_t release(uint8_t k); + virtual size_t writeKeycode(uint8_t k); + virtual size_t pressKeycode(uint8_t k); + virtual size_t releaseKeycode(uint8_t k); + virtual size_t addKeycodeToReport(uint8_t k); + virtual size_t removeKeycodeFromReport(uint8_t k); virtual void releaseAll(void); virtual size_t systemControl(uint8_t k); - virtual size_t consumerControl(uint8_t k); + virtual size_t consumerControl(uint8_t k); }; extern Keyboard_ Keyboard; @@ -248,6 +292,7 @@ int USB_Recv(uint8_t ep, void* data, int len); // non-blocking int USB_Recv(uint8_t ep); // non-blocking void USB_Flush(uint8_t ep); -#endif #endif /* if defined(USBCON) */ + +#endif diff --git a/hardware/keyboardio/cores/keyboardio/USBCore.cpp b/hardware/keyboardio/avr/cores/keyboardio/USBCore.cpp similarity index 89% rename from hardware/keyboardio/cores/keyboardio/USBCore.cpp rename to hardware/keyboardio/avr/cores/keyboardio/USBCore.cpp index 71ec13c6..26fe00f5 100644 --- a/hardware/keyboardio/cores/keyboardio/USBCore.cpp +++ b/hardware/keyboardio/avr/cores/keyboardio/USBCore.cpp @@ -18,9 +18,7 @@ ** SOFTWARE. */ -#include "Platform.h" #include "USBAPI.h" -#include "USBDesc.h" #if defined(USBCON) @@ -41,42 +39,40 @@ volatile u8 RxLEDPulse; /**< Milliseconds remaining for data Rx LED pulse */ //================================================================== extern const u16 STRING_LANGUAGE[] PROGMEM; -extern const u16 STRING_IPRODUCT[] PROGMEM; -extern const u16 STRING_IMANUFACTURER[] PROGMEM; +extern const u8 STRING_PRODUCT[] PROGMEM; +extern const u8 STRING_MANUFACTURER[] PROGMEM; extern const DeviceDescriptor USB_DeviceDescriptor PROGMEM; extern const DeviceDescriptor USB_DeviceDescriptorA PROGMEM; -int usbMaxPower = 500; const u16 STRING_LANGUAGE[2] = { (3<<8) | (2+2), 0x0409 // English }; -const u16 STRING_IPRODUCT[17] = { - (3<<8) | (2+2*16), -#if USB_PID == 0x8036 - 'A','r','d','u','i','n','o',' ','L','e','o','n','a','r','d','o' -#elif USB_PID == 0x8037 - 'A','r','d','u','i','n','o',' ','M','i','c','r','o',' ',' ',' ' -#elif USB_PID == 0x803C - 'A','r','d','u','i','n','o',' ','E','s','p','l','o','r','a',' ' -#elif USB_PID == 0x9208 - 'L','i','l','y','P','a','d','U','S','B',' ',' ',' ',' ',' ',' ' -#else - 'U','S','B',' ','I','O',' ','B','o','a','r','d',' ',' ',' ',' ' +#ifndef USB_PRODUCT +// If no product is provided, use USB IO Board +#define USB_PRODUCT "USB IO Board" #endif -}; -const u16 STRING_IMANUFACTURER[12] = { - (3<<8) | (2+2*11), +const u8 STRING_PRODUCT[] PROGMEM = USB_PRODUCT; + #if USB_VID == 0x2341 - 'A','r','d','u','i','n','o',' ','L','L','C' +# if defined(USB_MANUFACTURER) +# undef USB_MANUFACTURER +# endif +# define USB_MANUFACTURER "Arduino LLC" #elif USB_VID == 0x1b4f - 'S','p','a','r','k','F','u','n',' ',' ',' ' -#else - 'U','n','k','n','o','w','n',' ',' ',' ',' ' +# if defined(USB_MANUFACTURER) +# undef USB_MANUFACTURER +# endif +# define USB_MANUFACTURER "SparkFun" +#elif !defined(USB_MANUFACTURER) +// Fall through to unknown if no manufacturer name was provided in a macro +# define USB_MANUFACTURER "Unknown" #endif -}; + +const u8 STRING_MANUFACTURER[] PROGMEM = USB_MANUFACTURER; + #ifdef CDC_ENABLED #define DEVICE_CLASS 0x02 @@ -100,7 +96,8 @@ volatile u8 _usbSuspendState = 0; // copy of UDINT to check SUSPI and WAKEUPI bi static inline void WaitIN(void) { - while (!(UEINTX & (1< len) n = len; - len -= n; { LockEP lock(ep); + // Frame may have been released by the SOF interrupt handler + if (!ReadWriteAllowed()) + continue; + len -= n; if (ep & TRANSFER_ZERO) { while (n--) @@ -421,6 +420,22 @@ int USB_SendControl(u8 flags, const void* d, int len) return sent; } +// Send a USB descriptor string. The string is stored in PROGMEM as a +// plain ASCII string but is sent out as UTF-16 with the correct 2-byte +// prefix +static bool USB_SendStringDescriptor(const u8*string_P, u8 string_len) { + SendControl(2 + string_len * 2); + SendControl(3); + for(u8 i = 0; i < string_len; i++) { + bool r = SendControl(pgm_read_byte(&string_P[i])); + r &= SendControl(0); // high byte + if(!r) { + return false; + } + } + return true; +} + // Does not timeout or cross fifo boundaries // Will only work for transfers <= 64 bytes // TODO @@ -481,7 +496,6 @@ bool SendDescriptor(Setup& setup) return HID_GetDescriptor(t); #endif - u8 desc_length = 0; const u8* desc_addr = 0; if (USB_DEVICE_DESCRIPTOR_TYPE == t) { @@ -491,20 +505,22 @@ bool SendDescriptor(Setup& setup) } else if (USB_STRING_DESCRIPTOR_TYPE == t) { - if (setup.wValueL == 0) + if (setup.wValueL == 0) { desc_addr = (const u8*)&STRING_LANGUAGE; - else if (setup.wValueL == IPRODUCT) - desc_addr = (const u8*)&STRING_IPRODUCT; - else if (setup.wValueL == IMANUFACTURER) - desc_addr = (const u8*)&STRING_IMANUFACTURER; + } + else if (setup.wValueL == IPRODUCT) { + return USB_SendStringDescriptor(STRING_PRODUCT, strlen(USB_PRODUCT)); + } + else if (setup.wValueL == IMANUFACTURER) { + return USB_SendStringDescriptor(STRING_MANUFACTURER, strlen(USB_MANUFACTURER)); + } else return false; } if (desc_addr == 0) return false; - if (desc_length == 0) - desc_length = pgm_read_byte(desc_addr); + u8 desc_length = pgm_read_byte(desc_addr); USB_SendControl(TRANSFER_PGM,desc_addr,desc_length); return true; @@ -639,7 +655,7 @@ static inline void USB_ClockEnable() #error "Clock rate of F_CPU not supported" #endif -// AT90USB646, AT90USB647, AT90USB1286, AT90USB1287 +// AT90USB646, AT90USB647, AT90USB1286, AT90USB1287 #elif defined(PLLP2) #if F_CPU == 16000000UL #if defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) @@ -667,8 +683,8 @@ static inline void USB_ClockEnable() } // Some tests on specific versions of macosx (10.7.3), reported some - // strange behaviuors when the board is reset using the serial - // port touch at 1200 bps. This delay fixes this behaviour. + // strange behaviors when the board is reset using the serial + // port touch at 1200 bps. This delay fixes this behavior. delay(1); USBCON = (USBCON & ~(1<(lhs); + if (!a.concat(rhs)) a.invalidate(); + return a; +} + /*********************************************/ /* Comparison */ /*********************************************/ @@ -567,11 +611,6 @@ int String::lastIndexOf(const String &s2, unsigned int fromIndex) const return found; } -String String::substring( unsigned int left ) const -{ - return substring(left, len); -} - String String::substring(unsigned int left, unsigned int right) const { if (left > right) { @@ -580,7 +619,7 @@ String String::substring(unsigned int left, unsigned int right) const left = temp; } String out; - if (left > len) return out; + if (left >= len) return out; if (right > len) right = len; char temp = buffer[right]; // save the replaced character buffer[right] = '\0'; @@ -645,15 +684,16 @@ void String::replace(const String& find, const String& replace) } void String::remove(unsigned int index){ - if (index >= len) { return; } - int count = len - index; - remove(index, count); + // Pass the biggest integer as the count. The remove method + // below will take care of truncating it at the end of the + // string. + remove(index, (unsigned int)-1); } void String::remove(unsigned int index, unsigned int count){ if (index >= len) { return; } if (count <= 0) { return; } - if (index + count > len) { count = len - index; } + if (count > len - index) { count = len - index; } char *writeTo = buffer + index; len = len - count; strncpy(writeTo, buffer + index + count,len - index); @@ -698,7 +738,6 @@ long String::toInt(void) const return 0; } - float String::toFloat(void) const { if (buffer) return float(atof(buffer)); diff --git a/hardware/keyboardio/cores/keyboardio/WString.h b/hardware/keyboardio/avr/cores/keyboardio/WString.h similarity index 91% rename from hardware/keyboardio/cores/keyboardio/WString.h rename to hardware/keyboardio/avr/cores/keyboardio/WString.h index 2d372c5a..74024309 100644 --- a/hardware/keyboardio/cores/keyboardio/WString.h +++ b/hardware/keyboardio/avr/cores/keyboardio/WString.h @@ -58,6 +58,7 @@ public: // be false). String(const char *cstr = ""); String(const String &str); + String(const __FlashStringHelper *str); #ifdef __GXX_EXPERIMENTAL_CXX0X__ String(String &&rval); String(StringSumHelper &&rval); @@ -68,8 +69,8 @@ public: explicit String(unsigned int, unsigned char base=10); explicit String(long, unsigned char base=10); explicit String(unsigned long, unsigned char base=10); - explicit String(float, int decimalPlaces=6); - explicit String(double, int decimalPlaces=6); + explicit String(float, unsigned char decimalPlaces=2); + explicit String(double, unsigned char decimalPlaces=2); ~String(void); // memory management @@ -84,6 +85,7 @@ public: // marked as invalid ("if (s)" will be false). String & operator = (const String &rhs); String & operator = (const char *cstr); + String & operator = (const __FlashStringHelper *str); #ifdef __GXX_EXPERIMENTAL_CXX0X__ String & operator = (String &&rval); String & operator = (StringSumHelper &&rval); @@ -104,6 +106,7 @@ public: unsigned char concat(unsigned long num); unsigned char concat(float num); unsigned char concat(double num); + unsigned char concat(const __FlashStringHelper * str); // if there's not enough memory for the concatenated value, the string // will be left unchanged (but this isn't signalled in any way) @@ -115,6 +118,9 @@ public: String & operator += (unsigned int num) {concat(num); return (*this);} String & operator += (long num) {concat(num); return (*this);} String & operator += (unsigned long num) {concat(num); return (*this);} + String & operator += (float num) {concat(num); return (*this);} + String & operator += (double num) {concat(num); return (*this);} + String & operator += (const __FlashStringHelper *str){concat(str); return (*this);} friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs); friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr); @@ -126,6 +132,7 @@ public: friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num); friend StringSumHelper & operator + (const StringSumHelper &lhs, float num); friend StringSumHelper & operator + (const StringSumHelper &lhs, double num); + friend StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs); // comparison (only works w/ Strings and "strings") operator StringIfHelperType() const { return buffer ? &String::StringIfHelper : 0; } @@ -164,7 +171,7 @@ public: int lastIndexOf( char ch, unsigned int fromIndex ) const; int lastIndexOf( const String &str ) const; int lastIndexOf( const String &str, unsigned int fromIndex ) const; - String substring( unsigned int beginIndex ) const; + String substring( unsigned int beginIndex ) const { return substring(beginIndex, len); }; String substring( unsigned int beginIndex, unsigned int endIndex ) const; // modification @@ -184,7 +191,6 @@ protected: char *buffer; // the actual char array unsigned int capacity; // the array length minus one (for the '\0') unsigned int len; // the String length (not counting the '\0') - unsigned char flags; // unused, for future features protected: void init(void); void invalidate(void); @@ -193,6 +199,7 @@ protected: // copy and move String & copy(const char *cstr, unsigned int length); + String & copy(const __FlashStringHelper *pstr, unsigned int length); #ifdef __GXX_EXPERIMENTAL_CXX0X__ void move(String &rhs); #endif @@ -209,6 +216,8 @@ public: StringSumHelper(unsigned int num) : String(num) {} StringSumHelper(long num) : String(num) {} StringSumHelper(unsigned long num) : String(num) {} + StringSumHelper(float num) : String(num) {} + StringSumHelper(double num) : String(num) {} }; #endif // __cplusplus diff --git a/hardware/keyboardio/avr/cores/keyboardio/abi.cpp b/hardware/keyboardio/avr/cores/keyboardio/abi.cpp new file mode 100644 index 00000000..8d719b8e --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/abi.cpp @@ -0,0 +1,35 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); +extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); + +void __cxa_pure_virtual(void) { + // We might want to write some diagnostics to uart in this case + //std::terminate(); + abort(); +} + +void __cxa_deleted_virtual(void) { + // We might want to write some diagnostics to uart in this case + //std::terminate(); + abort(); +} + diff --git a/hardware/keyboardio/cores/keyboardio/binary.h b/hardware/keyboardio/avr/cores/keyboardio/binary.h similarity index 92% rename from hardware/keyboardio/cores/keyboardio/binary.h rename to hardware/keyboardio/avr/cores/keyboardio/binary.h index af149803..aec4c733 100644 --- a/hardware/keyboardio/cores/keyboardio/binary.h +++ b/hardware/keyboardio/avr/cores/keyboardio/binary.h @@ -1,3 +1,22 @@ +/* + binary.h - Definitions for binary constants + Copyright (c) 2006 David A. Mellis. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + #ifndef Binary_h #define Binary_h diff --git a/hardware/keyboardio/avr/cores/keyboardio/hooks.c b/hardware/keyboardio/avr/cores/keyboardio/hooks.c new file mode 100644 index 00000000..641eabc7 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/hooks.c @@ -0,0 +1,31 @@ +/* + Copyright (c) 2012 Arduino. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/** + * Empty yield() hook. + * + * This function is intended to be used by library writers to build + * libraries or sketches that supports cooperative threads. + * + * Its defined as a weak symbol and it can be redefined to implement a + * real cooperative scheduler. + */ +static void __empty() { + // Empty +} +void yield(void) __attribute__ ((weak, alias("__empty"))); diff --git a/hardware/keyboardio/avr/cores/keyboardio/main.cpp b/hardware/keyboardio/avr/cores/keyboardio/main.cpp new file mode 100644 index 00000000..a60980da --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/main.cpp @@ -0,0 +1,49 @@ +/* + main.cpp - Main loop for Arduino sketches + Copyright (c) 2005-2013 Arduino Team. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +//Declared weak in Arduino.h to allow user redefinitions. +int atexit(void (*func)()) { return 0; } + +// Weak empty variant initialization function. +// May be redefined by variant files. +void initVariant() __attribute__((weak)); +void initVariant() { } + +int main(void) +{ + init(); + + initVariant(); + +#if defined(USBCON) + USBDevice.attach(); +#endif + + setup(); + + for (;;) { + loop(); + if (serialEventRun) serialEventRun(); + } + + return 0; +} + diff --git a/hardware/keyboardio/avr/cores/keyboardio/new.cpp b/hardware/keyboardio/avr/cores/keyboardio/new.cpp new file mode 100644 index 00000000..cf6f89c1 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/new.cpp @@ -0,0 +1,36 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +void *operator new(size_t size) { + return malloc(size); +} + +void *operator new[](size_t size) { + return malloc(size); +} + +void operator delete(void * ptr) { + free(ptr); +} + +void operator delete[](void * ptr) { + free(ptr); +} + diff --git a/hardware/keyboardio/avr/cores/keyboardio/new.h b/hardware/keyboardio/avr/cores/keyboardio/new.h new file mode 100644 index 00000000..6e1b68f0 --- /dev/null +++ b/hardware/keyboardio/avr/cores/keyboardio/new.h @@ -0,0 +1,30 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef NEW_H +#define NEW_H + +#include + +void * operator new(size_t size); +void * operator new[](size_t size); +void operator delete(void * ptr); +void operator delete[](void * ptr); + +#endif + diff --git a/hardware/keyboardio/cores/keyboardio/wiring.c b/hardware/keyboardio/avr/cores/keyboardio/wiring.c similarity index 99% rename from hardware/keyboardio/cores/keyboardio/wiring.c rename to hardware/keyboardio/avr/cores/keyboardio/wiring.c index a3c4390e..5cbe2419 100644 --- a/hardware/keyboardio/cores/keyboardio/wiring.c +++ b/hardware/keyboardio/avr/cores/keyboardio/wiring.c @@ -111,6 +111,7 @@ void delay(unsigned long ms) uint16_t start = (uint16_t)micros(); while (ms > 0) { + yield(); if (((uint16_t)micros() - start) >= 1000) { ms--; start += 1000; diff --git a/hardware/keyboardio/cores/keyboardio/wiring_analog.c b/hardware/keyboardio/avr/cores/keyboardio/wiring_analog.c similarity index 97% rename from hardware/keyboardio/cores/keyboardio/wiring_analog.c rename to hardware/keyboardio/avr/cores/keyboardio/wiring_analog.c index 8feead95..48a9ef52 100644 --- a/hardware/keyboardio/cores/keyboardio/wiring_analog.c +++ b/hardware/keyboardio/avr/cores/keyboardio/wiring_analog.c @@ -160,6 +160,14 @@ void analogWrite(uint8_t pin, int val) break; #endif + #if defined(TCCR1A) && defined(COM1C1) + case TIMER1C: + // connect pwm to pin on timer 1, channel B + sbi(TCCR1A, COM1C1); + OCR1C = val; // set pwm duty + break; + #endif + #if defined(TCCR2) && defined(COM21) case TIMER2: // connect pwm to pin on timer 2 diff --git a/hardware/keyboardio/cores/keyboardio/wiring_digital.c b/hardware/keyboardio/avr/cores/keyboardio/wiring_digital.c similarity index 98% rename from hardware/keyboardio/cores/keyboardio/wiring_digital.c rename to hardware/keyboardio/avr/cores/keyboardio/wiring_digital.c index be323b1d..df94cc1c 100644 --- a/hardware/keyboardio/cores/keyboardio/wiring_digital.c +++ b/hardware/keyboardio/avr/cores/keyboardio/wiring_digital.c @@ -84,6 +84,9 @@ static void turnOffPWM(uint8_t timer) #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: cbi(TCCR1A, COM1B1); break; #endif + #if defined(TCCR1A) && defined(COM1C1) + case TIMER1C: cbi(TCCR1A, COM1C1); break; + #endif #if defined(TCCR2) && defined(COM21) case TIMER2: cbi(TCCR2, COM21); break; diff --git a/hardware/keyboardio/cores/keyboardio/wiring_private.h b/hardware/keyboardio/avr/cores/keyboardio/wiring_private.h old mode 100755 new mode 100644 similarity index 93% rename from hardware/keyboardio/cores/keyboardio/wiring_private.h rename to hardware/keyboardio/avr/cores/keyboardio/wiring_private.h index c366005c..5dc7d4be --- a/hardware/keyboardio/cores/keyboardio/wiring_private.h +++ b/hardware/keyboardio/avr/cores/keyboardio/wiring_private.h @@ -52,7 +52,7 @@ extern "C"{ #define EXTERNAL_INT_6 6 #define EXTERNAL_INT_7 7 -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega128RFA1__) || defined(__AVR_ATmega256RFR2__) #define EXTERNAL_NUM_INTERRUPTS 8 #elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega644A__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) #define EXTERNAL_NUM_INTERRUPTS 3 diff --git a/hardware/keyboardio/cores/keyboardio/wiring_pulse.c b/hardware/keyboardio/avr/cores/keyboardio/wiring_pulse.c old mode 100755 new mode 100644 similarity index 100% rename from hardware/keyboardio/cores/keyboardio/wiring_pulse.c rename to hardware/keyboardio/avr/cores/keyboardio/wiring_pulse.c diff --git a/hardware/keyboardio/cores/keyboardio/wiring_shift.c b/hardware/keyboardio/avr/cores/keyboardio/wiring_shift.c old mode 100755 new mode 100644 similarity index 100% rename from hardware/keyboardio/cores/keyboardio/wiring_shift.c rename to hardware/keyboardio/avr/cores/keyboardio/wiring_shift.c diff --git a/hardware/keyboardio/avr/platform.txt b/hardware/keyboardio/avr/platform.txt new file mode 100644 index 00000000..a9928005 --- /dev/null +++ b/hardware/keyboardio/avr/platform.txt @@ -0,0 +1 @@ +name=Keyboardio Keyboards \ No newline at end of file diff --git a/hardware/keyboardio/variants/model00/pins_arduino.h b/hardware/keyboardio/avr/variants/model00/pins_arduino.h similarity index 100% rename from hardware/keyboardio/variants/model00/pins_arduino.h rename to hardware/keyboardio/avr/variants/model00/pins_arduino.h diff --git a/hardware/keyboardio/avr/variants/symmetric60/pins_arduino.h b/hardware/keyboardio/avr/variants/symmetric60/pins_arduino.h new file mode 100644 index 00000000..215d3498 --- /dev/null +++ b/hardware/keyboardio/avr/variants/symmetric60/pins_arduino.h @@ -0,0 +1,359 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + + 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 + + $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +// Workaround for wrong definitions in "iom32u4.h". +// This should be fixed in the AVR toolchain. +#undef UHCON +#undef UHINT +#undef UHIEN +#undef UHADDR +#undef UHFNUM +#undef UHFNUML +#undef UHFNUMH +#undef UHFLEN +#undef UPINRQX +#undef UPINTX +#undef UPNUM +#undef UPRST +#undef UPCONX +#undef UPCFG0X +#undef UPCFG1X +#undef UPSTAX +#undef UPCFG2X +#undef UPIENX +#undef UPDATX +#undef TCCR2A +#undef WGM20 +#undef WGM21 +#undef COM2B0 +#undef COM2B1 +#undef COM2A0 +#undef COM2A1 +#undef TCCR2B +#undef CS20 +#undef CS21 +#undef CS22 +#undef WGM22 +#undef FOC2B +#undef FOC2A +#undef TCNT2 +#undef TCNT2_0 +#undef TCNT2_1 +#undef TCNT2_2 +#undef TCNT2_3 +#undef TCNT2_4 +#undef TCNT2_5 +#undef TCNT2_6 +#undef TCNT2_7 +#undef OCR2A +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 +#undef OCR2B +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 + +#define NUM_DIGITAL_PINS 30 +#define NUM_ANALOG_INPUTS 12 + +#define TXLED0 PORTD &= ~(1<<5) +#define TXLED1 PORTD |= (1<<5) +#define RXLED0 PORTB &= ~(1<<0) +#define RXLED1 PORTB |= (1<<0) +#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0), TXLED0, RXLED0 + +#define SDA 2 +#define SCL 3 +#define LED_BUILTIN 13 + +// Map SPI port to 'new' pins D14..D17 +#define SS 17 +#define MOSI 16 +#define MISO 14 +#define SCK 15 + +// Mapping of analog pins as digital I/O +// A6-A11 share with digital pins +#define A0 18 +#define A1 19 +#define A2 20 +#define A3 21 +#define A4 22 +#define A5 23 +#define A6 24 // D4 +#define A7 25 // D6 +#define A8 26 // D8 +#define A9 27 // D9 +#define A10 28 // D10 +#define A11 29 // D12 + +#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) 0 +#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) +#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) + +// __AVR_ATmega32U4__ has an unusual mapping of pins to channels +extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; +#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) + +#ifdef ARDUINO_MAIN + +// On the Arduino board, digital pins are also used +// for the analog output (software PWM). Analog input +// pins are a separate set. + +// ATMEL ATMEGA32U4 / ARDUINO LEONARDO +// +// D0 PD2 RXD1/INT2 +// D1 PD3 TXD1/INT3 +// D2 PD1 SDA SDA/INT1 +// D3# PD0 PWM8/SCL OC0B/SCL/INT0 +// D4 A6 PD4 ADC8 +// D5# PC6 ??? OC3A/#OC4A +// D6# A7 PD7 FastPWM #OC4D/ADC10 +// D7 PE6 INT6/AIN0 +// +// D8 A8 PB4 ADC11/PCINT4 +// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 +// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 +// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 +// D12 A11 PD6 T1/#OC4D/ADC9 +// D13# PC7 PWM10 CLK0/OC4A +// +// A0 D18 PF7 ADC7 +// A1 D19 PF6 ADC6 +// A2 D20 PF5 ADC5 +// A3 D21 PF4 ADC4 +// A4 D22 PF1 ADC1 +// A5 D23 PF0 ADC0 +// +// New pins D14..D17 to map SPI port to digital pins +// +// MISO D14 PB3 MISO,PCINT3 +// SCK D15 PB1 SCK,PCINT1 +// MOSI D16 PB2 MOSI,PCINT2 +// SS D17 PB0 RXLED,SS/PCINT0 +// +// TXLED PD5 +// RXLED PB0 +// HWB PE2 HWB + +// these arrays map port names (e.g. port B) to the +// appropriate addresses for various functions (e.g. reading +// and writing) +const uint16_t PROGMEM port_to_mode_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &DDRB, + (uint16_t) &DDRC, + (uint16_t) &DDRD, + (uint16_t) &DDRE, + (uint16_t) &DDRF, +}; + +const uint16_t PROGMEM port_to_output_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PORTB, + (uint16_t) &PORTC, + (uint16_t) &PORTD, + (uint16_t) &PORTE, + (uint16_t) &PORTF, +}; + +const uint16_t PROGMEM port_to_input_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PINB, + (uint16_t) &PINC, + (uint16_t) &PIND, + (uint16_t) &PINE, + (uint16_t) &PINF, +}; + +const uint8_t PROGMEM digital_pin_to_port_PGM[] = { + PD, // D0 - PD2 + PD, // D1 - PD3 + PD, // D2 - PD1 + PD, // D3 - PD0 + PD, // D4 - PD4 + PC, // D5 - PC6 + PD, // D6 - PD7 + PE, // D7 - PE6 + + PB, // D8 - PB4 + PB, // D9 - PB5 + PB, // D10 - PB6 + PB, // D11 - PB7 + PD, // D12 - PD6 + PC, // D13 - PC7 + + PB, // D14 - MISO - PB3 + PB, // D15 - SCK - PB1 + PB, // D16 - MOSI - PB2 + PB, // D17 - SS - PB0 + + PF, // D18 - A0 - PF7 + PF, // D19 - A1 - PF6 + PF, // D20 - A2 - PF5 + PF, // D21 - A3 - PF4 + PF, // D22 - A4 - PF1 + PF, // D23 - A5 - PF0 + + PD, // D24 / D4 - A6 - PD4 + PD, // D25 / D6 - A7 - PD7 + PB, // D26 / D8 - A8 - PB4 + PB, // D27 / D9 - A9 - PB5 + PB, // D28 / D10 - A10 - PB6 + PD, // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { + _BV(2), // D0 - PD2 + _BV(3), // D1 - PD3 + _BV(1), // D2 - PD1 + _BV(0), // D3 - PD0 + _BV(4), // D4 - PD4 + _BV(6), // D5 - PC6 + _BV(7), // D6 - PD7 + _BV(6), // D7 - PE6 + + _BV(4), // D8 - PB4 + _BV(5), // D9 - PB5 + _BV(6), // D10 - PB6 + _BV(7), // D11 - PB7 + _BV(6), // D12 - PD6 + _BV(7), // D13 - PC7 + + _BV(3), // D14 - MISO - PB3 + _BV(1), // D15 - SCK - PB1 + _BV(2), // D16 - MOSI - PB2 + _BV(0), // D17 - SS - PB0 + + _BV(7), // D18 - A0 - PF7 + _BV(6), // D19 - A1 - PF6 + _BV(5), // D20 - A2 - PF5 + _BV(4), // D21 - A3 - PF4 + _BV(1), // D22 - A4 - PF1 + _BV(0), // D23 - A5 - PF0 + + _BV(4), // D24 / D4 - A6 - PD4 + _BV(7), // D25 / D6 - A7 - PD7 + _BV(4), // D26 / D8 - A8 - PB4 + _BV(5), // D27 / D9 - A9 - PB5 + _BV(6), // D28 / D10 - A10 - PB6 + _BV(6), // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + TIMER0B, /* 3 */ + NOT_ON_TIMER, + TIMER3A, /* 5 */ + TIMER4D, /* 6 */ + NOT_ON_TIMER, + + NOT_ON_TIMER, + TIMER1A, /* 9 */ + TIMER1B, /* 10 */ + TIMER0A, /* 11 */ + + NOT_ON_TIMER, + TIMER4A, /* 13 */ + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, +}; + +const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { + 7, // A0 PF7 ADC7 + 6, // A1 PF6 ADC6 + 5, // A2 PF5 ADC5 + 4, // A3 PF4 ADC4 + 1, // A4 PF1 ADC1 + 0, // A5 PF0 ADC0 + 8, // A6 D4 PD4 ADC8 + 10, // A7 D6 PD7 ADC10 + 11, // A8 D8 PB4 ADC11 + 12, // A9 D9 PB5 ADC12 + 13, // A10 D10 PB6 ADC13 + 9 // A11 D12 PD6 ADC9 +}; + +#endif /* ARDUINO_MAIN */ + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_USBVIRTUAL Serial +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* Pins_Arduino_h */ diff --git a/hardware/keyboardio/boards.txt b/hardware/keyboardio/boards.txt deleted file mode 100644 index 7db009c1..00000000 --- a/hardware/keyboardio/boards.txt +++ /dev/null @@ -1,18 +0,0 @@ -keyboardio.name=Keyboard.IO Model 00 -keyboardio.upload.protocol=avr109 -keyboardio.upload.maximum_size=28672 -keyboardio.upload.speed=57600 -keyboardio.upload.disable_flushing=true -keyboardio.bootloader.low_fuses=0xff -keyboardio.bootloader.high_fuses=0xd8 -keyboardio.bootloader.extended_fuses=0xcb -keyboardio.bootloader.path=caterina -keyboardio.bootloader.file=Caterina-keyboardio.hex -keyboardio.bootloader.unlock_bits=0x3F -keyboardio.bootloader.lock_bits=0x2F -keyboardio.build.mcu=atmega32u4 -keyboardio.build.f_cpu=16000000L -keyboardio.build.vid=0x2341 -keyboardio.build.pid=0x8037 -keyboardio.build.core=keyboardio -keyboardio.build.variant=model00 diff --git a/hardware/keyboardio/cores/keyboardio/Client.h b/hardware/keyboardio/cores/keyboardio/Client.h deleted file mode 100644 index ea134838..00000000 --- a/hardware/keyboardio/cores/keyboardio/Client.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef client_h -#define client_h -#include "Print.h" -#include "Stream.h" -#include "IPAddress.h" - -class Client : public Stream { - -public: - virtual int connect(IPAddress ip, uint16_t port) =0; - virtual int connect(const char *host, uint16_t port) =0; - virtual size_t write(uint8_t) =0; - virtual size_t write(const uint8_t *buf, size_t size) =0; - virtual int available() = 0; - virtual int read() = 0; - virtual int read(uint8_t *buf, size_t size) = 0; - virtual int peek() = 0; - virtual void flush() = 0; - virtual void stop() = 0; - virtual uint8_t connected() = 0; - virtual operator bool() = 0; -protected: - uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; -}; - -#endif diff --git a/hardware/keyboardio/cores/keyboardio/HID.cpp b/hardware/keyboardio/cores/keyboardio/HID.cpp deleted file mode 100644 index e96a5689..00000000 --- a/hardware/keyboardio/cores/keyboardio/HID.cpp +++ /dev/null @@ -1,708 +0,0 @@ - - -/* Copyright (c) 2011, Peter Barrett -** -** Sleep/Wakeup/SystemControl support added by Michael Dreher -** -** Permission to use, copy, modify, and/or distribute this software for -** any purpose with or without fee is hereby granted, provided that the -** above copyright notice and this permission notice appear in all copies. -** -** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL -** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR -** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES -** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -** SOFTWARE. -*/ - -#include "Platform.h" -#include "USBAPI.h" -#include "USBDesc.h" - -#if defined(USBCON) -#ifdef HID_ENABLED - -//#define RAWHID_ENABLED - -// Singletons for mouse and keyboard - -Mouse_ Mouse; -Keyboard_ Keyboard; - -//================================================================================ -//================================================================================ - -// HID report descriptor - -#define LSB(_x) ((_x) & 0xFF) -#define MSB(_x) ((_x) >> 8) - -#define RAWHID_USAGE_PAGE 0xFFC0 -#define RAWHID_USAGE 0x0C00 -#define RAWHID_TX_SIZE 64 -#define RAWHID_RX_SIZE 64 - -#define HID_REPORTID_MOUSE (1) -#define HID_REPORTID_KEYBOARD (2) -#define HID_REPORTID_RAWHID (3) -#define HID_REPORTID_SYSTEMCONTROL (4) -#define HID_REPORTID_MOUSE_ABS (5) -#define HID_REPORTID_CONSUMERCONTROL (6) - -extern const u8 _hidReportDescriptor[] PROGMEM; -const u8 _hidReportDescriptor[] = { - - // Mouse relative - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) // 54 - 0x09, 0x02, // USAGE (Mouse) - 0xa1, 0x01, // COLLECTION (Application) - 0x09, 0x01, // USAGE (Pointer) - 0xa1, 0x00, // COLLECTION (Physical) - 0x85, HID_REPORTID_MOUSE, // REPORT_ID (1) - 0x05, 0x09, // USAGE_PAGE (Button) - 0x19, 0x01, // USAGE_MINIMUM (Button 1) - 0x29, 0x03, // USAGE_MAXIMUM (Button 3) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x75, 0x01, // REPORT_SIZE (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x05, // REPORT_SIZE (5) - 0x81, 0x03, // INPUT (Cnst,Var,Abs) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x30, // USAGE (X) - 0x09, 0x31, // USAGE (Y) - 0x09, 0x38, // USAGE (Wheel) - 0x15, 0x81, // LOGICAL_MINIMUM (-127) - 0x25, 0x7f, // LOGICAL_MAXIMUM (127) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x03, // REPORT_COUNT (3) - 0x81, 0x06, // INPUT (Data,Var,Rel) - 0xc0, // END_COLLECTION - 0xc0, // END_COLLECTION -#ifdef MOUSE_ABS_ENABLED - // Mouse absolute - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x02, // USAGE (Mouse) - 0xa1, 0x01, // COLLECTION (Application) - 0x09, 0x01, // USAGE (Pointer) - 0xa1, 0x00, // COLLECTION (Physical) - 0x85, HID_REPORTID_MOUSE_ABS, // REPORT_ID (5) - 0x05, 0x09, // USAGE_PAGE (Button) - 0x19, 0x01, // USAGE_MINIMUM (Button 1) - 0x29, 0x03, // USAGE_MAXIMUM (Button 3) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x75, 0x01, // REPORT_SIZE (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x05, // REPORT_SIZE (5) - 0x81, 0x03, // INPUT (Cnst,Var,Abs) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x30, // USAGE (X) - 0x09, 0x31, // USAGE (Y) - 0x09, 0x38, // USAGE (Wheel) - 0x16, 0x00, 0x80, // LOGICAL_MINIMUM (-32768) - 0x26, 0xff, 0x7f, // LOGICAL_MAXIMUM (32767) - 0x75, 0x10, // REPORT_SIZE (16) - 0x95, 0x03, // REPORT_COUNT (3) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xc0, // END_COLLECTION - 0xc0, // END_COLLECTION -#endif - - // Keyboard - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) // 47 - 0x09, 0x06, // USAGE (Keyboard) - 0xa1, 0x01, // COLLECTION (Application) - 0x85, HID_REPORTID_KEYBOARD, // REPORT_ID (2) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - - // Keyboard Modifiers (shift, alt, ...) - 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x08, // REPORT_SIZE (8) - 0x81, 0x03, // INPUT (Cnst,Var,Abs) - - // Keyboard keys - 0x95, 0x06, // REPORT_COUNT (6) - 0x75, 0x08, // REPORT_SIZE (8) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x26, 0xDF, 0x00, // LOGICAL_MAXIMUM (239) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated)) - 0x29, 0xDF, // USAGE_MAXIMUM (Left Control - 1) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xc0, // END_COLLECTION - - // System Control (Power Down, Sleep, Wakeup, ...) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x80, // USAGE (System Control) - 0xa1, 0x01, // COLLECTION (Application) - 0x85, HID_REPORTID_SYSTEMCONTROL,// REPORT_ID (4) - 0x09, 0x81, // USAGE (System Power Down) - 0x09, 0x82, // USAGE (System Sleep) - 0x09, 0x83, // USAGE (System Wakeup) - 0x09, 0x8E, // USAGE (System Cold Restart) - 0x09, 0x8F, // USAGE (System Warm Restart) - 0x09, 0xA0, // USAGE (System Dock) - 0x09, 0xA1, // USAGE (System Undock) - 0x09, 0xA7, // USAGE (System Speaker Mute) - 0x09, 0xA8, // USAGE (System Hibernate) - // although these display usages are not that important, they don't cost much more than declaring - // the otherwise necessary constant fill bits - 0x09, 0xB0, // USAGE (System Display Invert) - 0x09, 0xB1, // USAGE (System Display Internal) - 0x09, 0xB2, // USAGE (System Display External) - 0x09, 0xB3, // USAGE (System Display Both) - 0x09, 0xB4, // USAGE (System Display Dual) - 0x09, 0xB5, // USAGE (System Display Toggle Intern/Extern) - 0x09, 0xB6, // USAGE (System Display Swap) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x10, // REPORT_COUNT (16) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xc0, // END_COLLECTION - -#if RAWHID_ENABLED - // RAW HID - 0x06, LSB(RAWHID_USAGE_PAGE), MSB(RAWHID_USAGE_PAGE), // 30 - 0x0A, LSB(RAWHID_USAGE), MSB(RAWHID_USAGE), - - 0xA1, 0x01, // Collection 0x01 - 0x85, HID_REPORTID_RAWHID, // REPORT_ID (3) - 0x75, 0x08, // report size = 8 bits - 0x15, 0x00, // logical minimum = 0 - 0x26, 0xFF, 0x00, // logical maximum = 255 - - 0x95, 64, // report count TX - 0x09, 0x01, // usage - 0x81, 0x02, // Input (array) - - 0x95, 64, // report count RX - 0x09, 0x02, // usage - 0x91, 0x02, // Output (array) - 0xC0 // end collection -#endif - - 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xa1, 0x01, // COLLECTION (Application) - 0x85, HID_REPORTID_CONSUMERCONTROL, // REPORT_ID (4) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x10, // REPORT_COUNT (16) - 0x09, 0xe2, // USAGE (Mute) 0x01 - 0x09, 0xe9, // USAGE (Volume Up) 0x02 - 0x09, 0xea, // USAGE (Volume Down) 0x03 - 0x09, 0xcd, // USAGE (Play/Pause) 0x04 - 0x09, 0xb7, // USAGE (Stop) 0x05 - 0x09, 0xb6, // USAGE (Scan Previous Track) 0x06 - 0x09, 0xb5, // USAGE (Scan Next Track) 0x07 - 0x0a, 0x8a, 0x01, // USAGE (Mail) 0x08 - 0x0a, 0x92, 0x01, // USAGE (Calculator) 0x09 - 0x0a, 0x21, 0x02, // USAGE (www search) 0x0a - 0x0a, 0x23, 0x02, // USAGE (www home) 0x0b - 0x0a, 0x2a, 0x02, // USAGE (www favorites) 0x0c - 0x0a, 0x27, 0x02, // USAGE (www refresh) 0x0d - 0x0a, 0x26, 0x02, // USAGE (www stop) 0x0e - 0x0a, 0x25, 0x02, // USAGE (www forward) 0x0f - 0x0a, 0x24, 0x02, // USAGE (www back) 0x10 - 0x81, 0x62, // INPUT (Data,Var,Abs,NPrf,Null) - 0xc0, -}; - -extern const HIDDescriptor _hidInterface PROGMEM; -const HIDDescriptor _hidInterface = -{ - D_INTERFACE(HID_INTERFACE,1,3,0,0), - D_HIDREPORT(sizeof(_hidReportDescriptor)), - D_ENDPOINT(USB_ENDPOINT_IN (HID_ENDPOINT_INT),USB_ENDPOINT_TYPE_INTERRUPT,0x40,0x01) -}; - -//================================================================================ -//================================================================================ -// Driver - -u8 _hid_protocol = 1; -u8 _hid_idle = 1; - -#define WEAK __attribute__ ((weak)) - -int WEAK HID_GetInterface(u8* interfaceNum) -{ - interfaceNum[0] += 1; // uses 1 - return USB_SendControl(TRANSFER_PGM,&_hidInterface,sizeof(_hidInterface)); -} - -int WEAK HID_GetDescriptor(int i) -{ - return USB_SendControl(TRANSFER_PGM,_hidReportDescriptor,sizeof(_hidReportDescriptor)); -} - -void WEAK HID_SendReport(u8 id, const void* data, int len) -{ - USB_Send(HID_TX, &id, 1); - USB_Send(HID_TX | TRANSFER_RELEASE,data,len); -} - -bool WEAK HID_Setup(Setup& setup) -{ - u8 r = setup.bRequest; - u8 requestType = setup.bmRequestType; - if (REQUEST_DEVICETOHOST_CLASS_INTERFACE == requestType) - { - if (HID_GET_REPORT == r) - { - //HID_GetReport(); - return true; - } - if (HID_GET_PROTOCOL == r) - { - //Send8(_hid_protocol); // TODO - return true; - } - } - - if (REQUEST_HOSTTODEVICE_CLASS_INTERFACE == requestType) - { - if (HID_SET_PROTOCOL == r) - { - _hid_protocol = setup.wValueL; - return true; - } - - if (HID_SET_IDLE == r) - { - _hid_idle = setup.wValueL; - return true; - } - } - return false; -} - -//================================================================================ -//================================================================================ -// Mouse - -Mouse_::Mouse_(void) : _buttons(0) -{ -} - -void Mouse_::begin(void) -{ -} - -void Mouse_::end(void) -{ -} - -void Mouse_::click(uint8_t b) -{ - _buttons = b; - move(0,0,0); - _buttons = 0; - move(0,0,0); -} - -void Mouse_::move(signed char x, signed char y, signed char wheel) -{ - u8 m[4]; - m[0] = _buttons; - m[1] = x; - m[2] = y; - m[3] = wheel; - HID_SendReport(HID_REPORTID_MOUSE,m,sizeof(m)); -} - -#ifdef MOUSE_ABS_ENABLED -// all parameters have the range of -32768 to 32767 and must be scaled to screen pixels -// some examples: -// x=0,y=0 is the middle of the screen -// x=-32768,y=-32768 is the top left corner -// x=32767,y=-32768 is the top right corner -// x=32767,y=32767 is the bottom right corner -// x=-32768,y=32767 is the bottom left corner -void Mouse_::moveAbs(int16_t x, int16_t y, int16_t wheel) -{ - u8 m[7]; - m[0] = _buttons; // TODO: is it a good idea to take over the _buttons from relative report here or should it be left out? - m[1] = LSB(x); - m[2] = MSB(x); - m[3] = LSB(y); - m[4] = MSB(y); - m[5] = LSB(wheel); - m[6] = MSB(wheel); - HID_SendReport(HID_REPORTID_MOUSE_ABS,m,sizeof(m)); -} -#endif - -void Mouse_::buttons(uint8_t b) -{ - if (b != _buttons) - { - _buttons = b; - move(0,0,0); - } -} - -void Mouse_::press(uint8_t b) -{ - buttons(_buttons | b); -} - -void Mouse_::release(uint8_t b) -{ - buttons(_buttons & ~b); -} - -bool Mouse_::isPressed(uint8_t b) -{ - if ((b & _buttons) > 0) - return true; - return false; -} - - - - -//================================================================================ -//================================================================================ -// Keyboard - -Keyboard_::Keyboard_(void) -{ -} - -void Keyboard_::begin(void) -{ -} - -void Keyboard_::end(void) -{ -} - -void Keyboard_::sendReport(KeyReport* keys) -{ - HID_SendReport(HID_REPORTID_KEYBOARD,keys,sizeof(*keys)); -} - -extern -const uint8_t _asciimap[128] PROGMEM; - -#define SHIFT 0x80 -const uint8_t _asciimap[128] = -{ - 0x00, // NUL - 0x00, // SOH - 0x00, // STX - 0x00, // ETX - 0x00, // EOT - 0x00, // ENQ - 0x00, // ACK - 0x00, // BEL - 0x2a, // BS Backspace - 0x2b, // TAB Tab - 0x28, // LF Enter - 0x00, // VT - 0x00, // FF - 0x00, // CR - 0x00, // SO - 0x00, // SI - 0x00, // DEL - 0x00, // DC1 - 0x00, // DC2 - 0x00, // DC3 - 0x00, // DC4 - 0x00, // NAK - 0x00, // SYN - 0x00, // ETB - 0x00, // CAN - 0x00, // EM - 0x00, // SUB - 0x00, // ESC - 0x00, // FS - 0x00, // GS - 0x00, // RS - 0x00, // US - - 0x2c, // ' ' - 0x1e|SHIFT, // ! - 0x34|SHIFT, // " - 0x20|SHIFT, // # - 0x21|SHIFT, // $ - 0x22|SHIFT, // % - 0x24|SHIFT, // & - 0x34, // ' - 0x26|SHIFT, // ( - 0x27|SHIFT, // ) - 0x25|SHIFT, // * - 0x2e|SHIFT, // + - 0x36, // , - 0x2d, // - - 0x37, // . - 0x38, // / - 0x27, // 0 - 0x1e, // 1 - 0x1f, // 2 - 0x20, // 3 - 0x21, // 4 - 0x22, // 5 - 0x23, // 6 - 0x24, // 7 - 0x25, // 8 - 0x26, // 9 - 0x33|SHIFT, // : - 0x33, // ; - 0x36|SHIFT, // < - 0x2e, // = - 0x37|SHIFT, // > - 0x38|SHIFT, // ? - 0x1f|SHIFT, // @ - 0x04|SHIFT, // A - 0x05|SHIFT, // B - 0x06|SHIFT, // C - 0x07|SHIFT, // D - 0x08|SHIFT, // E - 0x09|SHIFT, // F - 0x0a|SHIFT, // G - 0x0b|SHIFT, // H - 0x0c|SHIFT, // I - 0x0d|SHIFT, // J - 0x0e|SHIFT, // K - 0x0f|SHIFT, // L - 0x10|SHIFT, // M - 0x11|SHIFT, // N - 0x12|SHIFT, // O - 0x13|SHIFT, // P - 0x14|SHIFT, // Q - 0x15|SHIFT, // R - 0x16|SHIFT, // S - 0x17|SHIFT, // T - 0x18|SHIFT, // U - 0x19|SHIFT, // V - 0x1a|SHIFT, // W - 0x1b|SHIFT, // X - 0x1c|SHIFT, // Y - 0x1d|SHIFT, // Z - 0x2f, // [ - 0x31, // bslash - 0x30, // ] - 0x23|SHIFT, // ^ - 0x2d|SHIFT, // _ - 0x35, // ` - 0x04, // a - 0x05, // b - 0x06, // c - 0x07, // d - 0x08, // e - 0x09, // f - 0x0a, // g - 0x0b, // h - 0x0c, // i - 0x0d, // j - 0x0e, // k - 0x0f, // l - 0x10, // m - 0x11, // n - 0x12, // o - 0x13, // p - 0x14, // q - 0x15, // r - 0x16, // s - 0x17, // t - 0x18, // u - 0x19, // v - 0x1a, // w - 0x1b, // x - 0x1c, // y - 0x1d, // z - 0x2f|SHIFT, // - 0x31|SHIFT, // | - 0x30|SHIFT, // } - 0x35|SHIFT, // ~ - 0 // DEL -}; - -uint8_t USBPutChar(uint8_t c); - -// press() adds the specified key (printing, non-printing, or modifier) -// to the persistent key report and sends the report. Because of the way -// USB HID works, the host acts like the key remains pressed until we -// call release(), releaseAll(), or otherwise clear the report and resend. -size_t Keyboard_::press(uint8_t k) -{ - uint8_t i; - if (k >= 136) { // it's a non-printing key (not a modifier) - k = k - 136; - } else if (k >= 128) { // it's a modifier key - _keyReport.modifiers |= (1<<(k-128)); - k = 0; - } else { // it's a printing key - k = pgm_read_byte(_asciimap + k); - if (!k) { - setWriteError(); - return 0; - } - if (k & 0x80) { // it's a capital letter or other character reached with shift - _keyReport.modifiers |= 0x02; // the left shift modifier - k &= 0x7F; - } - } - - // Add k to the key report only if it's not already present - // and if there is an empty slot. - if (_keyReport.keys[0] != k && _keyReport.keys[1] != k && - _keyReport.keys[2] != k && _keyReport.keys[3] != k && - _keyReport.keys[4] != k && _keyReport.keys[5] != k) { - - for (i=0; i<6; i++) { - if (_keyReport.keys[i] == 0x00) { - _keyReport.keys[i] = k; - break; - } - } - if (i == 6) { - setWriteError(); - return 0; - } - } - sendReport(&_keyReport); - return 1; -} - -// System Control -// k is one of the SYSTEM_CONTROL defines which come from the HID usage table "Generic Desktop Page (0x01)" -// in "HID Usage Tables" (HUT1_12v2.pdf) -size_t Keyboard_::systemControl(uint8_t k) -{ - if(k <= 16) - { - u16 mask = 0; - u8 m[2]; - - if(k > 0) - { - mask = 1 << (k - 1); - } - - m[0] = LSB(mask); - m[1] = MSB(mask); - HID_SendReport(HID_REPORTID_SYSTEMCONTROL,m,sizeof(m)); - - // these are all OSCs, so send a clear to make it possible to send it again later - m[0] = 0; - m[1] = 0; - HID_SendReport(HID_REPORTID_SYSTEMCONTROL,m,sizeof(m)); - return 1; - } - else - { - setWriteError(); - return 0; - } -} - -// Consumer Control -// k is one of the CONSUMER_CONTROL defines which come from the HID usage table "Consumer Devices Page (0x0c)" -// in "HID Usage Tables" (HUT1_12v2.pdf) -size_t Keyboard_::consumerControl(uint8_t k) -{ - if(k <= 16) - { - u16 mask = 0; - u8 m[2]; - - if(k > 0) - { - mask = 1 << (k - 1); - } - - m[0] = LSB(mask); - m[1] = MSB(mask); - HID_SendReport(HID_REPORTID_CONSUMERCONTROL,m,sizeof(m)); - - // these are all OSCs, so send a clear to make it possible to send it again later - m[0] = 0; - m[1] = 0; - HID_SendReport(HID_REPORTID_CONSUMERCONTROL,m,sizeof(m)); - return 1; - } - else - { - setWriteError(); - return 0; - } -} - - -// release() takes the specified key out of the persistent key report and -// sends the report. This tells the OS the key is no longer pressed and that -// it shouldn't be repeated any more. -size_t Keyboard_::release(uint8_t k) -{ - uint8_t i; - if (k >= 136) { // it's a non-printing key (not a modifier) - k = k - 136; - } else if (k >= 128) { // it's a modifier key - _keyReport.modifiers &= ~(1<<(k-128)); - k = 0; - } else { // it's a printing key - k = pgm_read_byte(_asciimap + k); - if (!k) { - return 0; - } - if (k & 0x80) { // it's a capital letter or other character reached with shift - _keyReport.modifiers &= ~(0x02); // the left shift modifier - k &= 0x7F; - } - } - - // Test the key report to see if k is present. Clear it if it exists. - // Check all positions in case the key is present more than once (which it shouldn't be) - for (i=0; i<6; i++) { - if (0 != k && _keyReport.keys[i] == k) { - _keyReport.keys[i] = 0x00; - } - } - - sendReport(&_keyReport); - return 1; -} - -void Keyboard_::releaseAll(void) -{ - _keyReport.keys[0] = 0; - _keyReport.keys[1] = 0; - _keyReport.keys[2] = 0; - _keyReport.keys[3] = 0; - _keyReport.keys[4] = 0; - _keyReport.keys[5] = 0; - _keyReport.modifiers = 0; - sendReport(&_keyReport); -} - -size_t Keyboard_::write(uint8_t c) -{ - uint8_t p = press(c); // Keydown - uint8_t r = release(c); // Keyup - return (p); // just return the result of press() since release() almost always returns 1 -} - -#endif - -#endif /* if defined(USBCON) */ diff --git a/hardware/keyboardio/cores/keyboardio/HardwareSerial.cpp b/hardware/keyboardio/cores/keyboardio/HardwareSerial.cpp deleted file mode 100644 index eb2365f3..00000000 --- a/hardware/keyboardio/cores/keyboardio/HardwareSerial.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/* - HardwareSerial.cpp - Hardware serial library for Wiring - Copyright (c) 2006 Nicholas Zambetti. All right reserved. - - 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 23 November 2006 by David A. Mellis - Modified 28 September 2010 by Mark Sproul - Modified 14 August 2012 by Alarus -*/ - -#include -#include -#include -#include -#include "Arduino.h" -#include "wiring_private.h" - -// this next line disables the entire HardwareSerial.cpp, -// this is so I can support Attiny series and any other chip without a uart -#if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H) - -#include "HardwareSerial.h" - -/* - * on ATmega8, the uart and its bits are not numbered, so there is no "TXC0" - * definition. - */ -#if !defined(TXC0) -#if defined(TXC) -#define TXC0 TXC -#elif defined(TXC1) -// Some devices have uart1 but no uart0 -#define TXC0 TXC1 -#else -#error TXC0 not definable in HardwareSerial.h -#endif -#endif - -// Define constants and variables for buffering incoming serial data. We're -// using a ring buffer (I think), in which head is the index of the location -// to which to write the next incoming character and tail is the index of the -// location from which to read. -#if (RAMEND < 1000) - #define SERIAL_BUFFER_SIZE 16 -#else - #define SERIAL_BUFFER_SIZE 64 -#endif - -struct ring_buffer -{ - unsigned char buffer[SERIAL_BUFFER_SIZE]; - volatile unsigned int head; - volatile unsigned int tail; -}; - -#if defined(USBCON) - ring_buffer rx_buffer = { { 0 }, 0, 0}; - ring_buffer tx_buffer = { { 0 }, 0, 0}; -#endif -#if defined(UBRRH) || defined(UBRR0H) - ring_buffer rx_buffer = { { 0 }, 0, 0 }; - ring_buffer tx_buffer = { { 0 }, 0, 0 }; -#endif -#if defined(UBRR1H) - ring_buffer rx_buffer1 = { { 0 }, 0, 0 }; - ring_buffer tx_buffer1 = { { 0 }, 0, 0 }; -#endif -#if defined(UBRR2H) - ring_buffer rx_buffer2 = { { 0 }, 0, 0 }; - ring_buffer tx_buffer2 = { { 0 }, 0, 0 }; -#endif -#if defined(UBRR3H) - ring_buffer rx_buffer3 = { { 0 }, 0, 0 }; - ring_buffer tx_buffer3 = { { 0 }, 0, 0 }; -#endif - -inline void store_char(unsigned char c, ring_buffer *buffer) -{ - int i = (unsigned int)(buffer->head + 1) % SERIAL_BUFFER_SIZE; - - // if we should be storing the received character into the location - // just before the tail (meaning that the head would advance to the - // current location of the tail), we're about to overflow the buffer - // and so we don't write the character or advance the head. - if (i != buffer->tail) { - buffer->buffer[buffer->head] = c; - buffer->head = i; - } -} - -#if !defined(USART0_RX_vect) && defined(USART1_RX_vect) -// do nothing - on the 32u4 the first USART is USART1 -#else -#if !defined(USART_RX_vect) && !defined(USART0_RX_vect) && \ - !defined(USART_RXC_vect) - #error "Don't know what the Data Received vector is called for the first UART" -#else - void serialEvent() __attribute__((weak)); - void serialEvent() {} - #define serialEvent_implemented -#if defined(USART_RX_vect) - ISR(USART_RX_vect) -#elif defined(USART0_RX_vect) - ISR(USART0_RX_vect) -#elif defined(USART_RXC_vect) - ISR(USART_RXC_vect) // ATmega8 -#endif - { - #if defined(UDR0) - if (bit_is_clear(UCSR0A, UPE0)) { - unsigned char c = UDR0; - store_char(c, &rx_buffer); - } else { - unsigned char c = UDR0; - }; - #elif defined(UDR) - if (bit_is_clear(UCSRA, PE)) { - unsigned char c = UDR; - store_char(c, &rx_buffer); - } else { - unsigned char c = UDR; - }; - #else - #error UDR not defined - #endif - } -#endif -#endif - -#if defined(USART1_RX_vect) - void serialEvent1() __attribute__((weak)); - void serialEvent1() {} - #define serialEvent1_implemented - ISR(USART1_RX_vect) - { - if (bit_is_clear(UCSR1A, UPE1)) { - unsigned char c = UDR1; - store_char(c, &rx_buffer1); - } else { - unsigned char c = UDR1; - }; - } -#endif - -#if defined(USART2_RX_vect) && defined(UDR2) - void serialEvent2() __attribute__((weak)); - void serialEvent2() {} - #define serialEvent2_implemented - ISR(USART2_RX_vect) - { - if (bit_is_clear(UCSR2A, UPE2)) { - unsigned char c = UDR2; - store_char(c, &rx_buffer2); - } else { - unsigned char c = UDR2; - }; - } -#endif - -#if defined(USART3_RX_vect) && defined(UDR3) - void serialEvent3() __attribute__((weak)); - void serialEvent3() {} - #define serialEvent3_implemented - ISR(USART3_RX_vect) - { - if (bit_is_clear(UCSR3A, UPE3)) { - unsigned char c = UDR3; - store_char(c, &rx_buffer3); - } else { - unsigned char c = UDR3; - }; - } -#endif - -void serialEventRun(void) -{ -#ifdef serialEvent_implemented - if (Serial.available()) serialEvent(); -#endif -#ifdef serialEvent1_implemented - if (Serial1.available()) serialEvent1(); -#endif -#ifdef serialEvent2_implemented - if (Serial2.available()) serialEvent2(); -#endif -#ifdef serialEvent3_implemented - if (Serial3.available()) serialEvent3(); -#endif -} - - -#if !defined(USART0_UDRE_vect) && defined(USART1_UDRE_vect) -// do nothing - on the 32u4 the first USART is USART1 -#else -#if !defined(UART0_UDRE_vect) && !defined(UART_UDRE_vect) && !defined(USART0_UDRE_vect) && !defined(USART_UDRE_vect) - #error "Don't know what the Data Register Empty vector is called for the first UART" -#else -#if defined(UART0_UDRE_vect) -ISR(UART0_UDRE_vect) -#elif defined(UART_UDRE_vect) -ISR(UART_UDRE_vect) -#elif defined(USART0_UDRE_vect) -ISR(USART0_UDRE_vect) -#elif defined(USART_UDRE_vect) -ISR(USART_UDRE_vect) -#endif -{ - if (tx_buffer.head == tx_buffer.tail) { - // Buffer empty, so disable interrupts -#if defined(UCSR0B) - cbi(UCSR0B, UDRIE0); -#else - cbi(UCSRB, UDRIE); -#endif - } - else { - // There is more data in the output buffer. Send the next byte - unsigned char c = tx_buffer.buffer[tx_buffer.tail]; - tx_buffer.tail = (tx_buffer.tail + 1) % SERIAL_BUFFER_SIZE; - - #if defined(UDR0) - UDR0 = c; - #elif defined(UDR) - UDR = c; - #else - #error UDR not defined - #endif - } -} -#endif -#endif - -#ifdef USART1_UDRE_vect -ISR(USART1_UDRE_vect) -{ - if (tx_buffer1.head == tx_buffer1.tail) { - // Buffer empty, so disable interrupts - cbi(UCSR1B, UDRIE1); - } - else { - // There is more data in the output buffer. Send the next byte - unsigned char c = tx_buffer1.buffer[tx_buffer1.tail]; - tx_buffer1.tail = (tx_buffer1.tail + 1) % SERIAL_BUFFER_SIZE; - - UDR1 = c; - } -} -#endif - -#ifdef USART2_UDRE_vect -ISR(USART2_UDRE_vect) -{ - if (tx_buffer2.head == tx_buffer2.tail) { - // Buffer empty, so disable interrupts - cbi(UCSR2B, UDRIE2); - } - else { - // There is more data in the output buffer. Send the next byte - unsigned char c = tx_buffer2.buffer[tx_buffer2.tail]; - tx_buffer2.tail = (tx_buffer2.tail + 1) % SERIAL_BUFFER_SIZE; - - UDR2 = c; - } -} -#endif - -#ifdef USART3_UDRE_vect -ISR(USART3_UDRE_vect) -{ - if (tx_buffer3.head == tx_buffer3.tail) { - // Buffer empty, so disable interrupts - cbi(UCSR3B, UDRIE3); - } - else { - // There is more data in the output buffer. Send the next byte - unsigned char c = tx_buffer3.buffer[tx_buffer3.tail]; - tx_buffer3.tail = (tx_buffer3.tail + 1) % SERIAL_BUFFER_SIZE; - - UDR3 = c; - } -} -#endif - - -// Constructors //////////////////////////////////////////////////////////////// - -HardwareSerial::HardwareSerial(ring_buffer *rx_buffer, ring_buffer *tx_buffer, - volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, - volatile uint8_t *ucsra, volatile uint8_t *ucsrb, - volatile uint8_t *ucsrc, volatile uint8_t *udr, - uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udrie, uint8_t u2x) -{ - _rx_buffer = rx_buffer; - _tx_buffer = tx_buffer; - _ubrrh = ubrrh; - _ubrrl = ubrrl; - _ucsra = ucsra; - _ucsrb = ucsrb; - _ucsrc = ucsrc; - _udr = udr; - _rxen = rxen; - _txen = txen; - _rxcie = rxcie; - _udrie = udrie; - _u2x = u2x; -} - -// Public Methods ////////////////////////////////////////////////////////////// - -void HardwareSerial::begin(unsigned long baud) -{ - uint16_t baud_setting; - bool use_u2x = true; - -#if F_CPU == 16000000UL - // hardcoded exception for compatibility with the bootloader shipped - // with the Duemilanove and previous boards and the firmware on the 8U2 - // on the Uno and Mega 2560. - if (baud == 57600) { - use_u2x = false; - } -#endif - -try_again: - - if (use_u2x) { - *_ucsra = 1 << _u2x; - baud_setting = (F_CPU / 4 / baud - 1) / 2; - } else { - *_ucsra = 0; - baud_setting = (F_CPU / 8 / baud - 1) / 2; - } - - if ((baud_setting > 4095) && use_u2x) - { - use_u2x = false; - goto try_again; - } - - // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) - *_ubrrh = baud_setting >> 8; - *_ubrrl = baud_setting; - - transmitting = false; - - sbi(*_ucsrb, _rxen); - sbi(*_ucsrb, _txen); - sbi(*_ucsrb, _rxcie); - cbi(*_ucsrb, _udrie); -} - -void HardwareSerial::begin(unsigned long baud, byte config) -{ - uint16_t baud_setting; - uint8_t current_config; - bool use_u2x = true; - -#if F_CPU == 16000000UL - // hardcoded exception for compatibility with the bootloader shipped - // with the Duemilanove and previous boards and the firmware on the 8U2 - // on the Uno and Mega 2560. - if (baud == 57600) { - use_u2x = false; - } -#endif - -try_again: - - if (use_u2x) { - *_ucsra = 1 << _u2x; - baud_setting = (F_CPU / 4 / baud - 1) / 2; - } else { - *_ucsra = 0; - baud_setting = (F_CPU / 8 / baud - 1) / 2; - } - - if ((baud_setting > 4095) && use_u2x) - { - use_u2x = false; - goto try_again; - } - - // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) - *_ubrrh = baud_setting >> 8; - *_ubrrl = baud_setting; - - //set the data bits, parity, and stop bits -#if defined(__AVR_ATmega8__) - config |= 0x80; // select UCSRC register (shared with UBRRH) -#endif - *_ucsrc = config; - - sbi(*_ucsrb, _rxen); - sbi(*_ucsrb, _txen); - sbi(*_ucsrb, _rxcie); - cbi(*_ucsrb, _udrie); -} - -void HardwareSerial::end() -{ - // wait for transmission of outgoing data - while (_tx_buffer->head != _tx_buffer->tail) - ; - - cbi(*_ucsrb, _rxen); - cbi(*_ucsrb, _txen); - cbi(*_ucsrb, _rxcie); - cbi(*_ucsrb, _udrie); - - // clear any received data - _rx_buffer->head = _rx_buffer->tail; -} - -int HardwareSerial::available(void) -{ - return (unsigned int)(SERIAL_BUFFER_SIZE + _rx_buffer->head - _rx_buffer->tail) % SERIAL_BUFFER_SIZE; -} - -int HardwareSerial::peek(void) -{ - if (_rx_buffer->head == _rx_buffer->tail) { - return -1; - } else { - return _rx_buffer->buffer[_rx_buffer->tail]; - } -} - -int HardwareSerial::read(void) -{ - // if the head isn't ahead of the tail, we don't have any characters - if (_rx_buffer->head == _rx_buffer->tail) { - return -1; - } else { - unsigned char c = _rx_buffer->buffer[_rx_buffer->tail]; - _rx_buffer->tail = (unsigned int)(_rx_buffer->tail + 1) % SERIAL_BUFFER_SIZE; - return c; - } -} - -void HardwareSerial::flush() -{ - // UDR is kept full while the buffer is not empty, so TXC triggers when EMPTY && SENT - while (transmitting && ! (*_ucsra & _BV(TXC0))); - transmitting = false; -} - -size_t HardwareSerial::write(uint8_t c) -{ - int i = (_tx_buffer->head + 1) % SERIAL_BUFFER_SIZE; - - // If the output buffer is full, there's nothing for it other than to - // wait for the interrupt handler to empty it a bit - // ???: return 0 here instead? - while (i == _tx_buffer->tail) - ; - - _tx_buffer->buffer[_tx_buffer->head] = c; - _tx_buffer->head = i; - - sbi(*_ucsrb, _udrie); - // clear the TXC bit -- "can be cleared by writing a one to its bit location" - transmitting = true; - sbi(*_ucsra, TXC0); - - return 1; -} - -HardwareSerial::operator bool() { - return true; -} - -// Preinstantiate Objects ////////////////////////////////////////////////////// - -#if defined(UBRRH) && defined(UBRRL) - HardwareSerial Serial(&rx_buffer, &tx_buffer, &UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR, RXEN, TXEN, RXCIE, UDRIE, U2X); -#elif defined(UBRR0H) && defined(UBRR0L) - HardwareSerial Serial(&rx_buffer, &tx_buffer, &UBRR0H, &UBRR0L, &UCSR0A, &UCSR0B, &UCSR0C, &UDR0, RXEN0, TXEN0, RXCIE0, UDRIE0, U2X0); -#elif defined(USBCON) - // do nothing - Serial object and buffers are initialized in CDC code -#else - #error no serial port defined (port 0) -#endif - -#if defined(UBRR1H) - HardwareSerial Serial1(&rx_buffer1, &tx_buffer1, &UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UCSR1C, &UDR1, RXEN1, TXEN1, RXCIE1, UDRIE1, U2X1); -#endif -#if defined(UBRR2H) - HardwareSerial Serial2(&rx_buffer2, &tx_buffer2, &UBRR2H, &UBRR2L, &UCSR2A, &UCSR2B, &UCSR2C, &UDR2, RXEN2, TXEN2, RXCIE2, UDRIE2, U2X2); -#endif -#if defined(UBRR3H) - HardwareSerial Serial3(&rx_buffer3, &tx_buffer3, &UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UCSR3C, &UDR3, RXEN3, TXEN3, RXCIE3, UDRIE3, U2X3); -#endif - -#endif // whole file - diff --git a/hardware/keyboardio/cores/keyboardio/IPAddress.cpp b/hardware/keyboardio/cores/keyboardio/IPAddress.cpp deleted file mode 100644 index fe3deb77..00000000 --- a/hardware/keyboardio/cores/keyboardio/IPAddress.cpp +++ /dev/null @@ -1,56 +0,0 @@ - -#include -#include - -IPAddress::IPAddress() -{ - memset(_address, 0, sizeof(_address)); -} - -IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) -{ - _address[0] = first_octet; - _address[1] = second_octet; - _address[2] = third_octet; - _address[3] = fourth_octet; -} - -IPAddress::IPAddress(uint32_t address) -{ - memcpy(_address, &address, sizeof(_address)); -} - -IPAddress::IPAddress(const uint8_t *address) -{ - memcpy(_address, address, sizeof(_address)); -} - -IPAddress& IPAddress::operator=(const uint8_t *address) -{ - memcpy(_address, address, sizeof(_address)); - return *this; -} - -IPAddress& IPAddress::operator=(uint32_t address) -{ - memcpy(_address, (const uint8_t *)&address, sizeof(_address)); - return *this; -} - -bool IPAddress::operator==(const uint8_t* addr) -{ - return memcmp(addr, _address, sizeof(_address)) == 0; -} - -size_t IPAddress::printTo(Print& p) const -{ - size_t n = 0; - for (int i =0; i < 3; i++) - { - n += p.print(_address[i], DEC); - n += p.print('.'); - } - n += p.print(_address[3], DEC); - return n; -} - diff --git a/hardware/keyboardio/cores/keyboardio/IPAddress.h b/hardware/keyboardio/cores/keyboardio/IPAddress.h deleted file mode 100644 index 2585aec0..00000000 --- a/hardware/keyboardio/cores/keyboardio/IPAddress.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * MIT License: - * Copyright (c) 2011 Adrian McEwen - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * adrianm@mcqn.com 1/1/2011 - */ - -#ifndef IPAddress_h -#define IPAddress_h - -#include - -// A class to make it easier to handle and pass around IP addresses - -class IPAddress : public Printable { -private: - uint8_t _address[4]; // IPv4 address - // Access the raw byte array containing the address. Because this returns a pointer - // to the internal structure rather than a copy of the address this function should only - // be used when you know that the usage of the returned uint8_t* will be transient and not - // stored. - uint8_t* raw_address() { return _address; }; - -public: - // Constructors - IPAddress(); - IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); - IPAddress(uint32_t address); - IPAddress(const uint8_t *address); - - // Overloaded cast operator to allow IPAddress objects to be used where a pointer - // to a four-byte uint8_t array is expected - operator uint32_t() { return *((uint32_t*)_address); }; - bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); }; - bool operator==(const uint8_t* addr); - - // Overloaded index operator to allow getting and setting individual octets of the address - uint8_t operator[](int index) const { return _address[index]; }; - uint8_t& operator[](int index) { return _address[index]; }; - - // Overloaded copy operators to allow initialisation of IPAddress objects from other types - IPAddress& operator=(const uint8_t *address); - IPAddress& operator=(uint32_t address); - - virtual size_t printTo(Print& p) const; - - friend class EthernetClass; - friend class UDP; - friend class Client; - friend class Server; - friend class DhcpClass; - friend class DNSClient; -}; - -const IPAddress INADDR_NONE(0,0,0,0); - - -#endif diff --git a/hardware/keyboardio/cores/keyboardio/Platform.h b/hardware/keyboardio/cores/keyboardio/Platform.h deleted file mode 100644 index 8b8f7427..00000000 --- a/hardware/keyboardio/cores/keyboardio/Platform.h +++ /dev/null @@ -1,23 +0,0 @@ - -#ifndef __PLATFORM_H__ -#define __PLATFORM_H__ - -#include -#include -#include -#include -#include - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned long u32; - -#include "Arduino.h" - -#if defined(USBCON) - #include "USBDesc.h" - #include "USBCore.h" - #include "USBAPI.h" -#endif /* if defined(USBCON) */ - -#endif diff --git a/hardware/keyboardio/cores/keyboardio/Server.h b/hardware/keyboardio/cores/keyboardio/Server.h deleted file mode 100644 index 9674c762..00000000 --- a/hardware/keyboardio/cores/keyboardio/Server.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef server_h -#define server_h - -class Server : public Print { -public: - virtual void begin() =0; -}; - -#endif diff --git a/hardware/keyboardio/cores/keyboardio/avr-libc/malloc.c b/hardware/keyboardio/cores/keyboardio/avr-libc/malloc.c deleted file mode 100644 index 9dcfe216..00000000 --- a/hardware/keyboardio/cores/keyboardio/avr-libc/malloc.c +++ /dev/null @@ -1,267 +0,0 @@ -/* Copyright (c) 2002, 2004, 2010 Joerg Wunsch - Copyright (c) 2010 Gerben van den Broeke - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - - -/* $Id: malloc.c 2149 2010-06-09 20:45:37Z joerg_wunsch $ */ - -#include -#include "sectionname.h" -#include "stdlib_private.h" - -#include - -/* - * Exported interface: - * - * When extending the data segment, the allocator will not try to go - * beyond the current stack limit, decreased by __malloc_margin bytes. - * Thus, all possible stack frames of interrupt routines that could - * interrupt the current function, plus all further nested function - * calls must not require more stack space, or they'll risk to collide - * with the data segment. - */ - -/* May be changed by the user only before the first malloc() call. */ - -size_t __malloc_margin = 128; -char *__malloc_heap_start = &__heap_start; -char *__malloc_heap_end = &__heap_end; - -char *__brkval; -struct __freelist *__flp; - -ATTRIBUTE_CLIB_SECTION -void * -malloc(size_t len) -{ - struct __freelist *fp1, *fp2, *sfp1, *sfp2; - char *cp; - size_t s, avail; - - /* - * Our minimum chunk size is the size of a pointer (plus the - * size of the "sz" field, but we don't need to account for - * this), otherwise we could not possibly fit a freelist entry - * into the chunk later. - */ - if (len < sizeof(struct __freelist) - sizeof(size_t)) - len = sizeof(struct __freelist) - sizeof(size_t); - - /* - * First, walk the free list and try finding a chunk that - * would match exactly. If we found one, we are done. While - * walking, note down the smallest chunk we found that would - * still fit the request -- we need it for step 2. - * - */ - for (s = 0, fp1 = __flp, fp2 = 0; - fp1; - fp2 = fp1, fp1 = fp1->nx) { - if (fp1->sz < len) - continue; - if (fp1->sz == len) { - /* - * Found it. Disconnect the chunk from the - * freelist, and return it. - */ - if (fp2) - fp2->nx = fp1->nx; - else - __flp = fp1->nx; - return &(fp1->nx); - } - else { - if (s == 0 || fp1->sz < s) { - /* this is the smallest chunk found so far */ - s = fp1->sz; - sfp1 = fp1; - sfp2 = fp2; - } - } - } - /* - * Step 2: If we found a chunk on the freelist that would fit - * (but was too large), look it up again and use it, since it - * is our closest match now. Since the freelist entry needs - * to be split into two entries then, watch out that the - * difference between the requested size and the size of the - * chunk found is large enough for another freelist entry; if - * not, just enlarge the request size to what we have found, - * and use the entire chunk. - */ - if (s) { - if (s - len < sizeof(struct __freelist)) { - /* Disconnect it from freelist and return it. */ - if (sfp2) - sfp2->nx = sfp1->nx; - else - __flp = sfp1->nx; - return &(sfp1->nx); - } - /* - * Split them up. Note that we leave the first part - * as the new (smaller) freelist entry, and return the - * upper portion to the caller. This saves us the - * work to fix up the freelist chain; we just need to - * fixup the size of the current entry, and note down - * the size of the new chunk before returning it to - * the caller. - */ - cp = (char *)sfp1; - s -= len; - cp += s; - sfp2 = (struct __freelist *)cp; - sfp2->sz = len; - sfp1->sz = s - sizeof(size_t); - return &(sfp2->nx); - } - /* - * Step 3: If the request could not be satisfied from a - * freelist entry, just prepare a new chunk. This means we - * need to obtain more memory first. The largest address just - * not allocated so far is remembered in the brkval variable. - * Under Unix, the "break value" was the end of the data - * segment as dynamically requested from the operating system. - * Since we don't have an operating system, just make sure - * that we don't collide with the stack. - */ - if (__brkval == 0) - __brkval = __malloc_heap_start; - cp = __malloc_heap_end; - if (cp == 0) - cp = STACK_POINTER() - __malloc_margin; - if (cp <= __brkval) - /* - * Memory exhausted. - */ - return 0; - avail = cp - __brkval; - /* - * Both tests below are needed to catch the case len >= 0xfffe. - */ - if (avail >= len && avail >= len + sizeof(size_t)) { - fp1 = (struct __freelist *)__brkval; - __brkval += len + sizeof(size_t); - fp1->sz = len; - return &(fp1->nx); - } - /* - * Step 4: There's no help, just fail. :-/ - */ - return 0; -} - - -ATTRIBUTE_CLIB_SECTION -void -free(void *p) -{ - struct __freelist *fp1, *fp2, *fpnew; - char *cp1, *cp2, *cpnew; - - /* ISO C says free(NULL) must be a no-op */ - if (p == 0) - return; - - cpnew = p; - cpnew -= sizeof(size_t); - fpnew = (struct __freelist *)cpnew; - fpnew->nx = 0; - - /* - * Trivial case first: if there's no freelist yet, our entry - * will be the only one on it. If this is the last entry, we - * can reduce __brkval instead. - */ - if (__flp == 0) { - if ((char *)p + fpnew->sz == __brkval) - __brkval = cpnew; - else - __flp = fpnew; - return; - } - - /* - * Now, find the position where our new entry belongs onto the - * freelist. Try to aggregate the chunk with adjacent chunks - * if possible. - */ - for (fp1 = __flp, fp2 = 0; - fp1; - fp2 = fp1, fp1 = fp1->nx) { - if (fp1 < fpnew) - continue; - cp1 = (char *)fp1; - fpnew->nx = fp1; - if ((char *)&(fpnew->nx) + fpnew->sz == cp1) { - /* upper chunk adjacent, assimilate it */ - fpnew->sz += fp1->sz + sizeof(size_t); - fpnew->nx = fp1->nx; - } - if (fp2 == 0) { - /* new head of freelist */ - __flp = fpnew; - return; - } - break; - } - /* - * Note that we get here either if we hit the "break" above, - * or if we fell off the end of the loop. The latter means - * we've got a new topmost chunk. Either way, try aggregating - * with the lower chunk if possible. - */ - fp2->nx = fpnew; - cp2 = (char *)&(fp2->nx); - if (cp2 + fp2->sz == cpnew) { - /* lower junk adjacent, merge */ - fp2->sz += fpnew->sz + sizeof(size_t); - fp2->nx = fpnew->nx; - } - /* - * If there's a new topmost chunk, lower __brkval instead. - */ - for (fp1 = __flp, fp2 = 0; - fp1->nx != 0; - fp2 = fp1, fp1 = fp1->nx) - /* advance to entry just before end of list */; - cp2 = (char *)&(fp1->nx); - if (cp2 + fp1->sz == __brkval) { - if (fp2 == NULL) - /* Freelist is empty now. */ - __flp = NULL; - else - fp2->nx = NULL; - __brkval = cp2 - sizeof(size_t); - } -} - diff --git a/hardware/keyboardio/cores/keyboardio/avr-libc/realloc.c b/hardware/keyboardio/cores/keyboardio/avr-libc/realloc.c deleted file mode 100644 index b76ce561..00000000 --- a/hardware/keyboardio/cores/keyboardio/avr-libc/realloc.c +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (c) 2004, 2010 Joerg Wunsch - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ -/* $Id: realloc.c 2127 2010-06-07 14:49:37Z joerg_wunsch $ */ - -#include -#include -#include "sectionname.h" -#include "stdlib_private.h" - -#include - -ATTRIBUTE_CLIB_SECTION -void * -realloc(void *ptr, size_t len) -{ - struct __freelist *fp1, *fp2, *fp3, *ofp3; - char *cp, *cp1; - void *memp; - size_t s, incr; - - /* Trivial case, required by C standard. */ - if (ptr == 0) - return malloc(len); - - cp1 = (char *)ptr; - cp1 -= sizeof(size_t); - fp1 = (struct __freelist *)cp1; - - cp = (char *)ptr + len; /* new next pointer */ - if (cp < cp1) - /* Pointer wrapped across top of RAM, fail. */ - return 0; - - /* - * See whether we are growing or shrinking. When shrinking, - * we split off a chunk for the released portion, and call - * free() on it. Therefore, we can only shrink if the new - * size is at least sizeof(struct __freelist) smaller than the - * previous size. - */ - if (len <= fp1->sz) { - /* The first test catches a possible unsigned int - * rollover condition. */ - if (fp1->sz <= sizeof(struct __freelist) || - len > fp1->sz - sizeof(struct __freelist)) - return ptr; - fp2 = (struct __freelist *)cp; - fp2->sz = fp1->sz - len - sizeof(size_t); - fp1->sz = len; - free(&(fp2->nx)); - return ptr; - } - - /* - * If we get here, we are growing. First, see whether there - * is space in the free list on top of our current chunk. - */ - incr = len - fp1->sz; - cp = (char *)ptr + fp1->sz; - fp2 = (struct __freelist *)cp; - for (s = 0, ofp3 = 0, fp3 = __flp; - fp3; - ofp3 = fp3, fp3 = fp3->nx) { - if (fp3 == fp2 && fp3->sz + sizeof(size_t) >= incr) { - /* found something that fits */ - if (fp3->sz + sizeof(size_t) - incr > sizeof(struct __freelist)) { - /* split off a new freelist entry */ - cp = (char *)ptr + len; - fp2 = (struct __freelist *)cp; - fp2->nx = fp3->nx; - fp2->sz = fp3->sz - incr; - fp1->sz = len; - } else { - /* it just fits, so use it entirely */ - fp1->sz += fp3->sz + sizeof(size_t); - fp2 = fp3->nx; - } - if (ofp3) - ofp3->nx = fp2; - else - __flp = fp2; - return ptr; - } - /* - * Find the largest chunk on the freelist while - * walking it. - */ - if (fp3->sz > s) - s = fp3->sz; - } - /* - * If we are the topmost chunk in memory, and there was no - * large enough chunk on the freelist that could be re-used - * (by a call to malloc() below), quickly extend the - * allocation area if possible, without need to copy the old - * data. - */ - if (__brkval == (char *)ptr + fp1->sz && len > s) { - cp1 = __malloc_heap_end; - cp = (char *)ptr + len; - if (cp1 == 0) - cp1 = STACK_POINTER() - __malloc_margin; - if (cp < cp1) { - __brkval = cp; - fp1->sz = len; - return ptr; - } - /* If that failed, we are out of luck. */ - return 0; - } - - /* - * Call malloc() for a new chunk, then copy over the data, and - * release the old region. - */ - if ((memp = malloc(len)) == 0) - return 0; - memcpy(memp, ptr, fp1->sz); - free(ptr); - return memp; -} - diff --git a/hardware/keyboardio/cores/keyboardio/avr-libc/sectionname.h b/hardware/keyboardio/cores/keyboardio/avr-libc/sectionname.h deleted file mode 100644 index 8e0f448b..00000000 --- a/hardware/keyboardio/cores/keyboardio/avr-libc/sectionname.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (c) 2009 Atmel Corporation - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef __SECTIONNAME_H__ -#define __SECTIONNAME_H__ - -/* Put all avr-libc functions in a common, unique sub-section name under .text. */ - -#define CLIB_SECTION .text.avr-libc -#define MLIB_SECTION .text.avr-libc.fplib - -#define STR(x) _STR(x) -#define _STR(x) #x - -#define ATTRIBUTE_CLIB_SECTION __attribute__ ((section (STR(CLIB_SECTION)))) -#define ATTRIBUTE_MLIB_SECTION __attribute__ ((section (STR(MLIB_SECTION)))) - -#define ASSEMBLY_CLIB_SECTION .section CLIB_SECTION, "ax", @progbits -#define ASSEMBLY_MLIB_SECTION .section MLIB_SECTION, "ax", @progbits - -#endif diff --git a/hardware/keyboardio/cores/keyboardio/avr-libc/stdlib_private.h b/hardware/keyboardio/cores/keyboardio/avr-libc/stdlib_private.h deleted file mode 100644 index 65c34273..00000000 --- a/hardware/keyboardio/cores/keyboardio/avr-libc/stdlib_private.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2004, Joerg Wunsch - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -/* $Id: stdlib_private.h 1657 2008-03-24 17:11:08Z arcanum $ */ - -#include -#include -#include - -#if !defined(__DOXYGEN__) - -struct __freelist { - size_t sz; - struct __freelist *nx; -}; - -#endif - -extern char *__brkval; /* first location not yet allocated */ -extern struct __freelist *__flp; /* freelist pointer (head of freelist) */ -extern size_t __malloc_margin; /* user-changeable before the first malloc() */ -extern char *__malloc_heap_start; -extern char *__malloc_heap_end; - -extern char __heap_start; -extern char __heap_end; - -/* Needed for definition of AVR_STACK_POINTER_REG. */ -#include - -#define STACK_POINTER() ((char *)AVR_STACK_POINTER_REG) - diff --git a/hardware/keyboardio/cores/keyboardio/license.txt b/hardware/keyboardio/cores/keyboardio/license.txt deleted file mode 100644 index fe2dac07..00000000 --- a/hardware/keyboardio/cores/keyboardio/license.txt +++ /dev/null @@ -1,753 +0,0 @@ -this file includes licensing information for parts of arduino. - -first, the gnu general public license, which covers the main body -of the processing/arduino code (in general, all the stuff inside the 'app' -and 'core' subfolders). - -next, the gnu lesser general public license that covers the arduino core -and libraries. - - -..................................................................... - - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - - -..................................................................... - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - diff --git a/hardware/keyboardio/cores/keyboardio/main.cpp b/hardware/keyboardio/cores/keyboardio/main.cpp deleted file mode 100644 index 3d4e079d..00000000 --- a/hardware/keyboardio/cores/keyboardio/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include - -int main(void) -{ - init(); - -#if defined(USBCON) - USBDevice.attach(); -#endif - - setup(); - - for (;;) { - loop(); - if (serialEventRun) serialEventRun(); - } - - return 0; -} - diff --git a/hardware/keyboardio/cores/keyboardio/new.cpp b/hardware/keyboardio/cores/keyboardio/new.cpp deleted file mode 100644 index b81031e9..00000000 --- a/hardware/keyboardio/cores/keyboardio/new.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -void * operator new(size_t size) -{ - return malloc(size); -} - -void * operator new[](size_t size) -{ - return malloc(size); -} - -void operator delete(void * ptr) -{ - free(ptr); -} - -void operator delete[](void * ptr) -{ - free(ptr); -} - -int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);}; -void __cxa_guard_release (__guard *g) {*(char *)g = 1;}; -void __cxa_guard_abort (__guard *) {}; - -void __cxa_pure_virtual(void) {}; - diff --git a/hardware/keyboardio/cores/keyboardio/new.h b/hardware/keyboardio/cores/keyboardio/new.h deleted file mode 100644 index 991c86c7..00000000 --- a/hardware/keyboardio/cores/keyboardio/new.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Header to define new/delete operators as they aren't provided by avr-gcc by default - Taken from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453 - */ - -#ifndef NEW_H -#define NEW_H - -#include - -void * operator new(size_t size); -void * operator new[](size_t size); -void operator delete(void * ptr); -void operator delete[](void * ptr); - -__extension__ typedef int __guard __attribute__((mode (__DI__))); - -extern "C" int __cxa_guard_acquire(__guard *); -extern "C" void __cxa_guard_release (__guard *); -extern "C" void __cxa_guard_abort (__guard *); - -extern "C" void __cxa_pure_virtual(void); - -#endif - diff --git a/hardware/keyboardio/cores/keyboardio/todo.txt b/hardware/keyboardio/cores/keyboardio/todo.txt deleted file mode 100644 index 7d5f164e..00000000 --- a/hardware/keyboardio/cores/keyboardio/todo.txt +++ /dev/null @@ -1,201 +0,0 @@ -0105 arduino - -Fix Linux make.sh, etc. scripts -Test on Linux. - -AVR - -Ethernet library: - - integrate DHCP support - - client.connect() returns 0 when connection is successful? http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238295170 - - call Server.begin() from Ethernet.begin() instead of in user's sketch? - - add method for receiving notification of new client connections to a server - - add method for receiving notification of data written to a client - - add method for receiving notification of client disconnections -Incorporate mikalhart's new SoftwareSerial library. -Consider making abs() not a macro. See: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234908504 -Improve shiftOut() performance: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1216659239/0 -Add String library. -Add Encoder library. -Bootloader: - - disable watch dog timer - - fix eeprom writing: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1202157667/15 -Support pin change interrupts. -Switch pwm output on pins 5 and 6 to phase-correct mode, if possible. -Add parameter to shiftOut() for specifying a number of bits. -Add parameter to Serial.print[ln](x, BIN) for specifying number of bits. -Support PROGMEM strings in Serial.print(): http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227919972 -Should Serial.print(b) send the ASCII digits of the byte? -Add weak attribute to signal handlers: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1203798214 -Floating point support in the map() function. -Fix delayMicroseconds(0). -Add sleep function(s). -Add SPI library. -Add OneWire library. -Add pulseOut(), etc. functions from Wiring. -Switch to ServoTimer2 library? http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1222201226/0#5 -Add ContinuousServo class that inherits from Servo? -LiquidCrystal library: - - support going to the next line with println(). -Supporting EEMEM directive by changing compiler command line: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1202157667 -Include Arduino as AVR-ISP sketch in hardware/firmwares. -Move type definitions into WConstants.h. -Change core and libraries to use Arduino types (e.g. byte, boolean). - -COMPUTER - -Clear serial monitor button when the serial monitor opens. -Disable checking for updates. -Test the upload.using parameter to upload with a programmer. -Add keyboard shortcut for opening the serial monitor. -Escape characters with copy as html. -Support libraries in the SKETCH/code folder? -Test bootloader burning w/ an AVRISP. -Enable verbose output if shift (or alt?) is held down when pressing run or upload. -Add support for third-party boards in the user's sketchbook folder. -Add support for third-party cores in the user's sketchbook folder. -Re-enable (and fix) the Commander. -Move selection of Linux look and feel from Base.java to arduino.sh script. -Check RAM usage of sketches: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1224729260/0#0 -Improve preprocessing of sketches: - - Better determine which header files are included (not commented out). - - Remember the original locations of function prototypes to highlight the correct line on error. -Multiple sketch windows. -Avoid library conflicts by only linking in the library whose name matches that of the #included header file. -Easier library discovery and installation ("Add library..." menu item). -Easier board installation ("Add board..." menu item) -Comprehensive board management: - - Enabled and disabled boards. - - Dialog for enabling, disabling, adding, deleting, and possibly editing boards. - - Board descriptions (e.g. explaining differences between boards). -Allow for libraries in /libraries. -Allow for boards in /boards. -Divide boards.txt into multiple text files. -Allow for core in /cores. -Clean up Library and LibraryManager. -Compile libraries dynamically (with compilation of sketch and core files). -Library builds should respect build.verbose. -Detect dependencies between libraries. -Byte-based serial monitor. -Line termination options in the serial monitor. -Clear character should clear serial monitor. -Incorporate serial-net proxy. -Changing font size should change serial monitor font size. -Deal with shorter screens (e.g. ASUS EEPC). -Investigate method for auto-detecting serial port on Windows (javax.usb?) - - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225226642 -Guess serial port on the Mac and Linux. -Automatic detection of baud rate for serial monitor (based on the call to Serial.begin() in the current sketch). -Improve, generally, the upload experience (e.g. faster program start after upload, keep-alive messages to bootloader from IDE, shorter bootloader timeout if possible, progress bar) -Allow uploading of .hex files. -Allow for arbitrary compilation command line arguments. -Find in reference should give same message for missing page as for missing page association. -Test find in reference on libraries. -Change background color while using external editor: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1229567785 - -Compiler.java - - Eliminate the need to pass a Target into the compiler by having the Compiler determine the current target (by checking the preferences directly)? - - Delete the unneeded static functions (for classpath translation, etc.) from the bottom of the file. - -Sketch.java - - add system-wide include path in preprocess()? - - should find libraries in the code/ sub-folder of the sketch folder - - do sketches really need to get built in the applet/ sub-folder when uploading? - -PreProcessor.java - - split write() into writeHeader() and write() as in Processing? - - add getExtraImports() function instead of having Sketch grab them directly. - -Base.java - - add keywords from libraries to the syntax coloring - -Editor.java - - allow the Board and Serial port to differ across editor windows. This will require creating a separate instance of the menu for each window, and passing the selections into the sketch when compiling or uploading. - - send the current board and serial port selections to the sketch (which will forward them to the compiler) when compiling or uploading (this should eliminate the need for the Target class, since the compiler will be able to find the target path and its source files itself) - - remove references to the Runner and runtime - -DEVELOPMENT - -Revise the icon. -Don't recompile the Processing core if the work/ directory exists. -RXTX version patched to not hang with bluetooth serial ports: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1237179908 -Add licenses for included open source libraries: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234595391 -Make run.bat not open a command line window: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1223883872 -Update version of the FTDI drivers (Windows). -Remove AVR ISP and giveio drivers (Windows). -Include the executable installer for the FTDI drivers (Windows). -Revise fetch.sh to look for version specific pages (names suffixed with, e.g., "-0007") -Move to ant for build process. - -DOCUMENTATION / SITE CONFIGURATION - -Multi-language plugin. -Work on opening up website to public editing. -Create form for submitting workshops. -Create form for submitting projects. - -DOCUMENTATION / META - -Create community section of site. -List of examples we'd like to have. -Style guide for examples, references, and foundations. -Add a Nordic board to the forum. -Add a German board to the forum. - -DOCUMENTATION / NAVIGATION - -Create About section. -Remove Board page. -Move Environment into the Reference section (which should be renamed Programming). - -DOCUMENTATION / FOUNDATIONS - -Better documentation of the Arduino BT. -Tutorial about serial communication. - -DOCUMENTATION / REFERENCE - -Remove parameters from the function links on the reference page. -Document Matrix and Sprite libraries on the Arduino site. -Document Wire.endTransmission() return values: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1228240199 - -DOCUMENTATION / EXAMPLES - -Photos: - - Loop - - Analog Input (potentiometer and LDR on analog input 0) -Consistency: - - ledpin vs. ledPin - - value vs. val -Add a Brightness example where an analog input controls the analog output. -Graph example should use an intermediate variable. -Button example says pin 7 but uses pin 2. -Split Loop example in two (one that does loops, another that does arrays). -Add LiquidCrystal library examples. -Add Ethernet library examples. -Add Wire library examples. -Add examples using specific hardware (simple analog sensors, optocouplers, etc.) -Examples should demonstrate use of functions. -Add I2C EEPROM example using Wire library. -Update pictures to use Arduino Diecimila. -Create diagrams and schematics for the examples. - -DOCUMENTATION / GETTING STARTED - -Arduino feature list (in Getting Started > Introduction). -Main "getting started" link should automatically load page for the user's operating system. -Consider deleting many of the pictures in the howto's as they just make it harder to see the instructions without adding much (e.g. the pictures of files in folders). -Tell people not to put the board on a Powerbook. -People don't know what a jumper is. -Add picture of the RX/TX LEDs flashing. -Show a picture of the LED flashing. - -DOCUMENTATION / TROUBLESHOOTING - -Add explanation of how to work around auto-reset. - -DOCUMENTATION / HACKING - -Burning bootloader without an AVRISP: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html -Documentation for moving from Arduino to custom PCBs. -Write advanced library tutorial.