├── .gitignore ├── server ├── constants.js ├── firmware │ └── tmk_keyboard │ │ ├── tmk_core │ │ ├── common │ │ │ ├── mbed │ │ │ │ ├── bootloader.c │ │ │ │ ├── suspend.c │ │ │ │ ├── xprintf.h │ │ │ │ ├── timer.c │ │ │ │ └── xprintf.cpp │ │ │ ├── uart.h │ │ │ ├── suspend.h │ │ │ ├── progmem.h │ │ │ ├── sleep_led.h │ │ │ ├── chibios │ │ │ │ ├── timer.c │ │ │ │ ├── bootloader.c │ │ │ │ └── suspend.c │ │ │ ├── wait.h │ │ │ ├── debug.c │ │ │ ├── avr │ │ │ │ ├── suspend_avr.h │ │ │ │ ├── timer_avr.h │ │ │ │ └── eeconfig.c │ │ │ ├── sendchar_null.c │ │ │ ├── sendchar_uart.c │ │ │ ├── nodebug.h │ │ │ ├── bootloader.h │ │ │ ├── sendchar.h │ │ │ ├── host_driver.h │ │ │ ├── action_tapping.h │ │ │ ├── led.h │ │ │ ├── command.h │ │ │ ├── backlight.h │ │ │ ├── actionmap.c │ │ │ ├── util.h │ │ │ ├── hook.c │ │ │ ├── timer.h │ │ │ ├── host.h │ │ │ ├── action_util.h │ │ │ ├── print.c │ │ │ ├── keymap.h │ │ │ ├── mousekey.h │ │ │ ├── matrix.h │ │ │ ├── action_layer.h │ │ │ ├── action.h │ │ │ ├── keyboard.h │ │ │ └── host.c │ │ ├── protocol │ │ │ ├── lufa │ │ │ │ └── LUFA-git │ │ │ │ │ ├── LUFA │ │ │ │ │ ├── DoxygenPages │ │ │ │ │ │ ├── Images │ │ │ │ │ │ │ ├── LUFA.png │ │ │ │ │ │ │ ├── Author.jpg │ │ │ │ │ │ │ ├── LUFA_thumb.png │ │ │ │ │ │ │ └── AS5_AS6_Import │ │ │ │ │ │ │ │ ├── AS5_AS6_Import_Step1.png │ │ │ │ │ │ │ │ ├── AS5_AS6_Import_Step2.png │ │ │ │ │ │ │ │ ├── AS5_AS6_Import_Step3.png │ │ │ │ │ │ │ │ ├── AS5_AS6_Import_Step4.png │ │ │ │ │ │ │ │ ├── AS5_AS6_Import_Step5_1.png │ │ │ │ │ │ │ │ ├── AS5_AS6_Import_Step5_2.png │ │ │ │ │ │ │ │ └── AS5_AS6_Import_Step5_3.png │ │ │ │ │ │ ├── DevelopingWithLUFA.txt │ │ │ │ │ │ ├── Donating.txt │ │ │ │ │ │ ├── Groups.txt │ │ │ │ │ │ ├── BuildingLinkableLibraries.txt │ │ │ │ │ │ ├── LibraryResources.txt │ │ │ │ │ │ ├── Style │ │ │ │ │ │ │ ├── Footer.htm │ │ │ │ │ │ │ └── Style.css │ │ │ │ │ │ ├── LicenseInfo.txt │ │ │ │ │ │ ├── ProgrammingApps.txt │ │ │ │ │ │ └── GettingStarted.txt │ │ │ │ │ ├── StudioIntegration │ │ │ │ │ │ ├── VSIX │ │ │ │ │ │ │ ├── LUFA.dll │ │ │ │ │ │ │ ├── LUFA.pkgdef │ │ │ │ │ │ │ ├── asf-manifest.xml │ │ │ │ │ │ │ ├── [Content_Types].xml │ │ │ │ │ │ │ ├── generate_caches.py │ │ │ │ │ │ │ ├── lufa_vsmanifest_transform.xslt │ │ │ │ │ │ │ ├── lufa_asfmanifest_transform.xslt │ │ │ │ │ │ │ └── extension.vsixmanifest │ │ │ │ │ │ ├── lufa_platform_xmega.xml │ │ │ │ │ │ ├── HV1 │ │ │ │ │ │ │ ├── helpcontentsetup.msha │ │ │ │ │ │ │ ├── lufa_studio_help_styling.css │ │ │ │ │ │ │ ├── lufa_helpcontentsetup_transform.xslt │ │ │ │ │ │ │ └── lufa_hv1_transform.xslt │ │ │ │ │ │ ├── XDK │ │ │ │ │ │ │ ├── lufa_indent_transform.xslt │ │ │ │ │ │ │ └── lufa_filelist_transform.xslt │ │ │ │ │ │ ├── lufa_platform_uc3.xml │ │ │ │ │ │ ├── lufa_drivers_usb.xml │ │ │ │ │ │ ├── lufa_drivers_usb_class.xml │ │ │ │ │ │ ├── lufa_common.xml │ │ │ │ │ │ ├── lufa_drivers_usb_core_xmega.xml │ │ │ │ │ │ ├── lufa_platform.xml │ │ │ │ │ │ ├── lufa_drivers_misc.xml │ │ │ │ │ │ ├── lufa_drivers_usb_core_uc3.xml │ │ │ │ │ │ ├── lufa_drivers_usb_class_si.xml │ │ │ │ │ │ ├── lufa_drivers_usb_core_avr8.xml │ │ │ │ │ │ └── lufa_drivers_usb_class_android.xml │ │ │ │ │ ├── Platform │ │ │ │ │ │ ├── UC3 │ │ │ │ │ │ │ ├── UC3ExperimentalInfo.txt │ │ │ │ │ │ │ └── InterruptManagement.c │ │ │ │ │ │ └── XMEGA │ │ │ │ │ │ │ └── XMEGAExperimentalInfo.txt │ │ │ │ │ ├── License.txt │ │ │ │ │ ├── CodeTemplates │ │ │ │ │ │ ├── makefile_template │ │ │ │ │ │ ├── HostTemplate │ │ │ │ │ │ │ ├── asf.xml │ │ │ │ │ │ │ └── HostApplication.h │ │ │ │ │ │ ├── DeviceTemplate │ │ │ │ │ │ │ ├── DeviceApplication.h │ │ │ │ │ │ │ ├── asf.xml │ │ │ │ │ │ │ └── Descriptors.h │ │ │ │ │ │ └── WindowsINF │ │ │ │ │ │ │ ├── LUFA RNDIS.inf │ │ │ │ │ │ │ └── LUFA CDC-ACM.inf │ │ │ │ │ ├── Drivers │ │ │ │ │ │ └── USB │ │ │ │ │ │ │ └── Core │ │ │ │ │ │ │ ├── XMEGA │ │ │ │ │ │ │ ├── Pipe_XMEGA.c │ │ │ │ │ │ │ ├── Host_XMEGA.c │ │ │ │ │ │ │ ├── PipeStream_XMEGA.c │ │ │ │ │ │ │ └── Device_XMEGA.c │ │ │ │ │ │ │ ├── Events.c │ │ │ │ │ │ │ ├── UC3 │ │ │ │ │ │ │ └── Device_UC3.c │ │ │ │ │ │ │ └── AVR8 │ │ │ │ │ │ │ └── Device_AVR8.c │ │ │ │ │ ├── Build │ │ │ │ │ │ └── HID_EEPROM_Loader │ │ │ │ │ │ │ ├── makefile │ │ │ │ │ │ │ └── HID_EEPROM_Loader.c │ │ │ │ │ ├── makefile │ │ │ │ │ └── Version.h │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── Bootloaders │ │ │ │ │ ├── HID │ │ │ │ │ │ ├── HostLoaderApp │ │ │ │ │ │ │ ├── Makefile.bsd │ │ │ │ │ │ │ └── Makefile │ │ │ │ │ │ ├── makefile │ │ │ │ │ │ └── BootloaderHID.h │ │ │ │ │ ├── makefile │ │ │ │ │ ├── MassStorage │ │ │ │ │ │ ├── Config │ │ │ │ │ │ │ └── AppConfig.h │ │ │ │ │ │ ├── BootloaderAPI.h │ │ │ │ │ │ └── BootloaderAPI.c │ │ │ │ │ ├── DFU │ │ │ │ │ │ ├── Config │ │ │ │ │ │ │ └── AppConfig.h │ │ │ │ │ │ ├── BootloaderAPI.h │ │ │ │ │ │ ├── BootloaderAPI.c │ │ │ │ │ │ └── makefile │ │ │ │ │ ├── CDC │ │ │ │ │ │ ├── Config │ │ │ │ │ │ │ └── AppConfig.h │ │ │ │ │ │ ├── BootloaderAPI.h │ │ │ │ │ │ ├── BootloaderAPI.c │ │ │ │ │ │ ├── LUFA CDC Bootloader.inf │ │ │ │ │ │ └── makefile │ │ │ │ │ └── Printer │ │ │ │ │ │ ├── BootloaderAPI.h │ │ │ │ │ │ └── BootloaderAPI.c │ │ │ │ │ └── Maintenance │ │ │ │ │ └── lufa_functionlist_transform.xslt │ │ │ └── lufa.mk │ │ ├── ring_buffer.h │ │ ├── protocol.mk │ │ └── common.mk │ │ ├── README.md │ │ └── keyboard │ │ └── keymap_common.c └── package.json ├── www ├── images │ ├── dropdown.png │ └── favicon.png ├── firmware │ └── firmware.zip ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 └── js │ ├── presets │ └── presets.js │ ├── ui │ ├── global.js │ └── init.js │ ├── firmware │ ├── led.js │ └── macro.js │ ├── ui-elements.js │ └── filesaver.min.js ├── .editorconfig └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | 3 | node_modules 4 | 5 | deploy 6 | -------------------------------------------------------------------------------- /server/constants.js: -------------------------------------------------------------------------------- 1 | // Listening port. 2 | exports.PORT = 5001; 3 | -------------------------------------------------------------------------------- /www/images/dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/www/images/dropdown.png -------------------------------------------------------------------------------- /www/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/www/images/favicon.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | indent_style = tab 6 | indent_size = 4 7 | -------------------------------------------------------------------------------- /www/firmware/firmware.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/www/firmware/firmware.zip -------------------------------------------------------------------------------- /www/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/www/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /www/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/www/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /www/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/www/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /www/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/www/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /www/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/www/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/mbed/bootloader.c: -------------------------------------------------------------------------------- 1 | #include "bootloader.h" 2 | 3 | 4 | void bootloader_jump(void) {} 5 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/mbed/suspend.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void suspend_power_down(void) {} 5 | bool suspend_wakeup_condition(void) { return true; } 6 | void suspend_wakeup_init(void) {} 7 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/LUFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/LUFA.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/Author.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/Author.jpg -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/LUFA.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/LUFA.dll -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/LUFA_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/LUFA_thumb.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/LUFA.pkgdef: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/LUFA.pkgdef -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Platform/UC3/UC3ExperimentalInfo.txt: -------------------------------------------------------------------------------- 1 | Please note that the UC3 architecture support is EXPERIMENTAL at this time, and may be non-functional/incomplete in some areas. Please refer to the Known Issues section of the LUFA manual. -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.d 3 | *.elf 4 | *.hex 5 | *.eep 6 | *.sym 7 | *.bin 8 | *.lss 9 | *.map 10 | *.bak 11 | *.class 12 | Documentation/ 13 | LUFA/StudioIntegration/ProjectGenerator/* 14 | LUFA/StudioIntegration/DocBook/* 15 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Platform/XMEGA/XMEGAExperimentalInfo.txt: -------------------------------------------------------------------------------- 1 | Please note that the XMEGA architecture support is EXPERIMENTAL at this time, and may be non-functional/incomplete in some areas. Please refer to the Known Issues section of the LUFA manual. -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/uart.h: -------------------------------------------------------------------------------- 1 | #ifndef _uart_included_h_ 2 | #define _uart_included_h_ 3 | 4 | #include 5 | 6 | void uart_init(uint32_t baud); 7 | void uart_putchar(uint8_t c); 8 | uint8_t uart_getchar(void); 9 | uint8_t uart_available(void); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step1.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step2.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step3.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step4.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step5_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step5_1.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step5_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step5_2.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step5_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruiqimao/tmkbuilder/HEAD/server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Images/AS5_AS6_Import/AS5_AS6_Import_Step5_3.png -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/suspend.h: -------------------------------------------------------------------------------- 1 | #ifndef SUSPEND_H 2 | #define SUSPEND_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | void suspend_idle(uint8_t timeout); 9 | void suspend_power_down(void); 10 | bool suspend_wakeup_condition(void); 11 | void suspend_wakeup_init(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/progmem.h: -------------------------------------------------------------------------------- 1 | #ifndef PROGMEM_H 2 | #define PROGMEM_H 1 3 | 4 | #if defined(__AVR__) 5 | # include 6 | #elif defined(__arm__) 7 | # define PROGMEM 8 | # define pgm_read_byte(p) *((unsigned char*)p) 9 | # define pgm_read_word(p) *((uint16_t*)p) 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/README.md: -------------------------------------------------------------------------------- 1 | # Source Files 2 | 3 | ### Compilation 4 | To compile the source files, enter the `keyboard` directory and run `make`, which will generate a `firmware.hex` file. 5 | 6 | ### Notes 7 | This contains a slightly modified version of the TMK keyboard firmware. Most official instructions will apply, but there will be some differences. 8 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/mbed/xprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef XPRINTF_H 2 | #define XPRINTF_H 3 | 4 | //#define xprintf(format, ...) __xprintf(format, ##__VA_ARGS__) 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | int xprintf(const char *format, ...); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "tmk builder server", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Ruiqi Mao", 10 | "license": "ISC", 11 | "dependencies": { 12 | "async": "^2.0.0-rc.6", 13 | "body-parser": "^1.15.2", 14 | "crypto": "0.0.3", 15 | "express": "^4.14.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/sleep_led.h: -------------------------------------------------------------------------------- 1 | #ifndef SLEEP_LED_H 2 | #define SLEEP_LED_H 3 | 4 | 5 | #ifdef SLEEP_LED_ENABLE 6 | 7 | void sleep_led_init(void); 8 | void sleep_led_enable(void); 9 | void sleep_led_disable(void); 10 | void sleep_led_toggle(void); 11 | 12 | #else 13 | 14 | #define sleep_led_init() 15 | #define sleep_led_enable() 16 | #define sleep_led_disable() 17 | #define sleep_led_toggle() 18 | 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /www/js/presets/presets.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Loads a preset. 3 | * 4 | * @param id The preset id. 5 | */ 6 | function loadPreset(id) { 7 | // Get the preset json. 8 | $.get('/js/presets/' + id + '.json', function(data) { 9 | // Set the keyboard. 10 | _keyboard = data; 11 | 12 | // Initialize. 13 | init(); 14 | 15 | // Set the default screen to firmware mode. 16 | setConfigMode(MODE_FIRMWARE); 17 | $('#config-wire').removeClass('active'); 18 | $('#config-firmware').addClass('active'); 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/HostLoaderApp/Makefile.bsd: -------------------------------------------------------------------------------- 1 | OS ?= FreeBSD 2 | #OS ?= NetBSD 3 | #OS ?= OpenBSD 4 | 5 | CFLAGS ?= -O2 -Wall 6 | CC ?= gcc 7 | 8 | .if $(OS) == "FreeBSD" 9 | CFLAGS += -DUSE_LIBUSB 10 | LIBS = -lusb 11 | .elif $(OS) == "NetBSD" || $(OS) == "OpenBSD" 12 | CFLAGS += -DUSE_UHID 13 | LIBS = 14 | .endif 15 | 16 | 17 | hid_bootloader_cli: hid_bootloader_cli.c 18 | $(CC) $(CFLAGS) -s -o hid_bootloader_cli hid_bootloader_cli.c $(LIBS) 19 | 20 | clean: 21 | rm -f hid_bootloader_cli 22 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/chibios/timer.c: -------------------------------------------------------------------------------- 1 | #include "ch.h" 2 | 3 | #include "timer.h" 4 | 5 | void timer_init(void) {} 6 | 7 | void timer_clear(void) {} 8 | 9 | uint16_t timer_read(void) 10 | { 11 | return (uint16_t)ST2MS(chVTGetSystemTime()); 12 | } 13 | 14 | uint32_t timer_read32(void) 15 | { 16 | return ST2MS(chVTGetSystemTime()); 17 | } 18 | 19 | uint16_t timer_elapsed(uint16_t last) 20 | { 21 | return (uint16_t)(ST2MS(chVTTimeElapsedSinceX(MS2ST(last)))); 22 | } 23 | 24 | uint32_t timer_elapsed32(uint32_t last) 25 | { 26 | return ST2MS(chVTTimeElapsedSinceX(MS2ST(last))); 27 | } 28 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/wait.h: -------------------------------------------------------------------------------- 1 | #ifndef WAIT_H 2 | #define WAIT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #if defined(__AVR__) 9 | # include 10 | # define wait_ms(ms) _delay_ms(ms) 11 | # define wait_us(us) _delay_us(us) 12 | #elif defined(PROTOCOL_CHIBIOS) /* __AVR__ */ 13 | # include "ch.h" 14 | # define wait_ms(ms) chThdSleepMilliseconds(ms) 15 | # define wait_us(us) chThdSleepMicroseconds(us) 16 | #elif defined(__arm__) /* __AVR__ */ 17 | # include "wait_api.h" 18 | #endif /* __AVR__ */ 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FourWalledCubicle 4 | LUFA 5 | Dean Camera 6 | 7 | True 8 | 9 | 10 | 11 | 0 12 | 13 | 14 | content.xml.cache 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/debug.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "debug.h" 3 | 4 | #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 5 | 6 | debug_config_t debug_config = { 7 | /* GCC Bug 10676 - Using unnamed fields in initializers 8 | * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 */ 9 | #if GCC_VERSION >= 40600 10 | .enable = false, 11 | .matrix = false, 12 | .keyboard = false, 13 | .mouse = false, 14 | .reserved = 0 15 | #else 16 | { 17 | false, // .enable 18 | false, // .matrix 19 | false, // .keyboard 20 | false, // .mouse 21 | 0 // .reserved 22 | } 23 | #endif 24 | }; 25 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Maintenance/lufa_functionlist_transform.xslt: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ; 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/avr/suspend_avr.h: -------------------------------------------------------------------------------- 1 | #ifndef SUSPEND_AVR_H 2 | #define SUSPEND_AVR_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | #define wdt_intr_enable(value) \ 12 | __asm__ __volatile__ ( \ 13 | "in __tmp_reg__,__SREG__" "\n\t" \ 14 | "cli" "\n\t" \ 15 | "wdr" "\n\t" \ 16 | "sts %0,%1" "\n\t" \ 17 | "out __SREG__,__tmp_reg__" "\n\t" \ 18 | "sts %0,%2" "\n\t" \ 19 | : /* no outputs */ \ 20 | : "M" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), \ 21 | "r" (_BV(_WD_CHANGE_BIT) | _BV(WDE)), \ 22 | "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | \ 23 | _BV(WDIE) | (value & 0x07)) ) \ 24 | : "r0" \ 25 | ) 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/sendchar_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #include "sendchar.h" 18 | 19 | 20 | int8_t sendchar(uint8_t c) 21 | { 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/helpcontentsetup.msha: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | LUFA Help 12 | 13 | 14 |
15 | FourWalledCubicle 16 | LUFA 17 | LUFA Help 18 | en-us 19 |
20 |
21 |
22 | LUFA 23 | lufa_studio_help.mshc 24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/mbed/timer.c: -------------------------------------------------------------------------------- 1 | #include "cmsis.h" 2 | #include "timer.h" 3 | 4 | /* Mill second tick count */ 5 | volatile uint32_t timer_count = 0; 6 | 7 | /* Timer interrupt handler */ 8 | void SysTick_Handler(void) { 9 | timer_count++; 10 | } 11 | 12 | void timer_init(void) 13 | { 14 | timer_count = 0; 15 | SysTick_Config(SystemCoreClock / 1000); /* 1ms tick */ 16 | } 17 | 18 | void timer_clear(void) 19 | { 20 | timer_count = 0; 21 | } 22 | 23 | uint16_t timer_read(void) 24 | { 25 | return (uint16_t)(timer_count & 0xFFFF); 26 | } 27 | 28 | uint32_t timer_read32(void) 29 | { 30 | return timer_count; 31 | } 32 | 33 | uint16_t timer_elapsed(uint16_t last) 34 | { 35 | return TIMER_DIFF_16(timer_read(), last); 36 | } 37 | 38 | uint32_t timer_elapsed32(uint32_t last) 39 | { 40 | return TIMER_DIFF_32(timer_read32(), last); 41 | } 42 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/sendchar_uart.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #include "uart.h" 18 | #include "sendchar.h" 19 | 20 | 21 | int8_t sendchar(uint8_t c) 22 | { 23 | uart_putchar(c); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/XDK/lufa_indent_transform.xslt: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/nodebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef NODEBUG_H 19 | #define NODEBUG_H 1 20 | 21 | #if !defined(NO_DEBUG) 22 | #define NO_DEBUG 23 | #endif 24 | #include "debug.h" 25 | #undef NO_DEBUG 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/bootloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef BOOTLOADER_H 19 | #define BOOTLOADER_H 20 | 21 | 22 | /* give code for your bootloader to come up if needed */ 23 | void bootloader_jump(void); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /www/js/ui/global.js: -------------------------------------------------------------------------------- 1 | /*** GLOBAL VARIABLES ***/ 2 | 3 | var _keyboard; // The current keyboard object. 4 | var _activeId; // The current active key id. 5 | var _activeLayer = 0; // The current active layer. 6 | var _activeMacro = 0; // The current active macro. 7 | var _macroMode = MACRO_DOWN; // The macro action mode. 8 | var _configMode = MODE_WIRE; // The current config mode. 9 | var _keyboardInput = false; // Whether to take keyboard input to assign keys. 10 | var _displayFlip = false; // Whether to display the keyboard flipped. 11 | var _recording = false; // Whether a macro is currently being recorded. 12 | var _recordingMacro = []; // The currently recording macro. 13 | 14 | var _keys = []; // List of key elements on the keyboard. 15 | var _rowLines = {}; // List of row line elements on the keyboard. 16 | var _colLines = {}; // List of column line elements on the keyboard. 17 | var _rowInds = []; // List of row indicators. 18 | var _colInds = []; // List of column indicators. 19 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/sendchar.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef SENDCHAR_H 19 | #define SENDCHAR_H 20 | 21 | #include 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* transmit a character. return 0 on success, -1 on error. */ 29 | int8_t sendchar(uint8_t c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py: -------------------------------------------------------------------------------- 1 | """ 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2013. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | """ 8 | 9 | import sys 10 | sys.path.append("ProjectGenerator") 11 | 12 | 13 | def show_message(message): 14 | print("[Project Generator] %s" % message) 15 | sys.stdout.flush() 16 | 17 | 18 | def main(lufa_root_path): 19 | try: 20 | from asf_avrstudio5_interface import PythonFacade 21 | except ImportError: 22 | print("Fatal Error: The ASF project generator is missing.") 23 | return 1 24 | 25 | p = PythonFacade(lufa_root_path) 26 | 27 | show_message("Checking database sanity...") 28 | p.check_extension_database_sanity(lufa_root_path) 29 | 30 | show_message("Building cache files...") 31 | p.generate_extension_cache_files(lufa_root_path) 32 | 33 | show_message("Cache files created.") 34 | return 0 35 | 36 | 37 | if __name__ == "__main__": 38 | sys.exit(main(sys.argv[1])) 39 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/host_driver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef HOST_DRIVER_H 19 | #define HOST_DRIVER_H 20 | 21 | #include 22 | #include "report.h" 23 | 24 | 25 | typedef struct { 26 | uint8_t (*keyboard_leds)(void); 27 | void (*send_keyboard)(report_keyboard_t *); 28 | void (*send_mouse)(report_mouse_t *); 29 | void (*send_system)(uint16_t); 30 | void (*send_consumer)(uint16_t); 31 | } host_driver_t; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/keyboard/keymap_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012,2013 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #include "keymap_common.h" 18 | 19 | 20 | /* translates key to keycode */ 21 | uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) 22 | { 23 | return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); 24 | } 25 | 26 | /* translates Fn keycode to action */ 27 | action_t keymap_fn_to_action(uint8_t keycode) 28 | { 29 | return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; 30 | } 31 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/License.txt: -------------------------------------------------------------------------------- 1 | LUFA Library 2 | Copyright (C) Dean Camera, 2014. 3 | 4 | dean [at] fourwalledcubicle [dot] com 5 | www.lufa-lib.org 6 | 7 | 8 | Permission to use, copy, modify, and distribute this software 9 | and its documentation for any purpose is hereby granted without 10 | fee, provided that the above copyright notice appear in all 11 | copies and that both that the copyright notice and this 12 | permission notice and warranty disclaimer appear in supporting 13 | documentation, and that the name of the author not be used in 14 | advertising or publicity pertaining to distribution of the 15 | software without specific, written prior permission. 16 | 17 | The author disclaims all warranties with regard to this 18 | software, including all implied warranties of merchantability 19 | and fitness. In no event shall the author be liable for any 20 | special, indirect or consequential damages or any damages 21 | whatsoever resulting from loss of use, data or profits, whether 22 | in an action of contract, negligence or other tortious action, 23 | arising out of or in connection with the use or performance of 24 | this software. 25 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2013. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | .programlisting { 10 | display: block; 11 | margin-left: 15px; 12 | padding: 10px; 13 | background-color: #f4f4f4; 14 | border: 1px solid #aaaaaa; 15 | font-family: "Consolas", "Courier New", sans-serif; 16 | } 17 | 18 | code { 19 | background-color: #f4f4f4; 20 | font-family: "Consolas", "Courier New", sans-serif; 21 | } 22 | 23 | .note, .warning, .tip { 24 | display: block; 25 | margin-left: 15px; 26 | padding-left: 10px; 27 | padding-bottom: 5px; 28 | background-color: #f4f4f4; 29 | border: 1px solid #aaaaaa; 30 | } 31 | 32 | table { 33 | border: 1px solid #aaaaaa; 34 | border-collapse: collapse; 35 | margin-left: 15px; 36 | font-size: 10pt; 37 | } 38 | 39 | table thead { 40 | background-color: #f4f4f4; 41 | } 42 | 43 | table thead th { 44 | padding: 5px; 45 | } 46 | 47 | table tbody td { 48 | padding: 5px; 49 | } 50 | 51 | ul { 52 | padding-left: 20px; 53 | } 54 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/action_tapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #ifndef ACTION_TAPPING_H 18 | #define ACTION_TAPPING_H 19 | 20 | 21 | 22 | /* period of tapping(ms) */ 23 | #ifndef TAPPING_TERM 24 | #define TAPPING_TERM 200 25 | #endif 26 | 27 | /* tap count needed for toggling a feature */ 28 | #ifndef TAPPING_TOGGLE 29 | #define TAPPING_TOGGLE 5 30 | #endif 31 | 32 | #define WAITING_BUFFER_SIZE 8 33 | 34 | 35 | #ifndef NO_ACTION_TAPPING 36 | void action_tapping_process(keyrecord_t record); 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /www/js/firmware/led.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Generate led_set(). 3 | * 4 | * @return The generated led_set() function. 5 | */ 6 | function generateLedSet() { 7 | // Begin the function. 8 | var func = 'void led_set(uint8_t usb_led) {\n'; 9 | 10 | // Iterate through the LED pins. 11 | for (var i in _keyboard.ledPins) { 12 | if (_keyboard.ledPins[i].length == 0) continue; 13 | 14 | var letter = _keyboard.ledPins[i][0]; 15 | var number = _keyboard.ledPins[i][1]; 16 | 17 | // Get the USB_LED variable name. 18 | var usbLed = 'USB_LED_' + ['CAPS_LOCK', 'SCROLL_LOCK', 'NUM_LOCK'][i]; 19 | 20 | // Create the if statement. 21 | func += ' if (usb_led & (1 << ' + usbLed + ')) {\n'; 22 | 23 | // Output low. 24 | func += ' DDR' + letter + ' |= (1 << ' + number + ');\n'; 25 | func += ' PORT' + letter + ' &= ~(1 << ' + number + ');\n'; 26 | 27 | // Create the else clause. 28 | func += ' } else {\n'; 29 | 30 | // Hi-Z. 31 | func += ' DDR' + letter + ' &= ~(1 << ' + number + ');\n'; 32 | func += ' PORT' + letter + ' &= ~(1 << ' + number + ');\n'; 33 | 34 | // End the statement. 35 | func += ' }\n'; 36 | } 37 | 38 | // End and return the function. 39 | func += '}'; 40 | return func; 41 | } 42 | -------------------------------------------------------------------------------- /www/js/firmware/macro.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Generate macro code. 3 | * 4 | * @return The generated macro code. 5 | */ 6 | function generateMacroCode() { 7 | // Start the code. 8 | var code = 'enum macro_id {\n'; 9 | for (var i in _keyboard.macros) { 10 | code += ' MACRO_' + i + ',\n' 11 | } 12 | code += '};\n\n'; 13 | code += 'const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {\n'; 14 | code += ' keyevent_t event = record->event;\n'; 15 | code += ' switch (id) {\n'; 16 | 17 | // Iterate through all the macros. 18 | for (var i in _keyboard.macros) { 19 | // Add the case. 20 | code += ' case MACRO_' + i + ':\n'; 21 | code += ' return (event.pressed ?\n'; 22 | code += ' MACRO( '; 23 | 24 | // Iterate through the actions. 25 | for (var j in _keyboard.macros[i]) { 26 | var action = _keyboard.macros[i][j]; 27 | 28 | // Add the action. 29 | code += action[0] + '(' + action[1] + '), '; 30 | } 31 | 32 | // Finish the action list. 33 | code += 'END ) :\n'; 34 | code += ' MACRO( END ));\n'; 35 | } 36 | 37 | // Finish and return the code. 38 | code += ' }\n'; 39 | code += ' return MACRO_NONE;\n'; 40 | code += '}'; 41 | return code; 42 | } 43 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/led.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef LED_H 19 | #define LED_H 20 | #include "stdint.h" 21 | 22 | 23 | /* keyboard LEDs */ 24 | #define USB_LED_NUM_LOCK 0 25 | #define USB_LED_CAPS_LOCK 1 26 | #define USB_LED_SCROLL_LOCK 2 27 | #define USB_LED_COMPOSE 3 28 | #define USB_LED_KANA 4 29 | 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | void led_set(uint8_t usb_led); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TMK Firmware Builder 2 | 3 | ## Running 4 | **Note**: This will ONLY work on OSX and Linux systems! It is not configured to work with Windows. 5 | 6 | Make sure you have `node`, `npm`, and `avr-gcc` installed, along with any other dependencies they may have. 7 | 8 | Edit `www/js/constants.js` and `server/constants.js` to adjust the API server location and port to meet your system's requirements. 9 | 10 | Go into the `server` directory and install dependencies and start the API server: 11 | ``` 12 | npm install 13 | node index.js 14 | ``` 15 | 16 | Then, go into the `www` directory and start a web server: 17 | 18 | *Python 3.x*: 19 | ``` 20 | python -m http.server 8080 21 | ``` 22 | 23 | *Python 2.x*: 24 | ``` 25 | python -m SimpleHTTPServer 8080 26 | ``` 27 | 28 | Then, access the GUI from `http://localhost:8080`. 29 | 30 | ## Contributing 31 | 32 | Since this is not your ordinary open source project, there is no license, which means all standard copyright laws apply. However, feel free to submit pull requests to add/change features and preset layouts! Especially preset layouts! We need lots of those. 33 | 34 | All preset layouts go in `/www/js/presets` and must be named appropriately (e.g. `phantom-iso.json`). Edit `www/index.html` to add it to the list of all presets. 35 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/command.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef COMMAND_H 19 | #define COMMAND 20 | 21 | /* TODO: Refactoring */ 22 | typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t; 23 | extern command_state_t command_state; 24 | 25 | /* This allows to extend commands. Return false when command is not processed. */ 26 | bool command_extra(uint8_t code); 27 | bool command_console_extra(uint8_t code); 28 | 29 | #ifdef COMMAND_ENABLE 30 | bool command_proc(uint8_t code); 31 | #else 32 | #define command_proc(code) false 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/HostLoaderApp/Makefile: -------------------------------------------------------------------------------- 1 | OS ?= LINUX 2 | #OS ?= WINDOWS 3 | #OS ?= MACOSX 4 | #OS ?= BSD 5 | 6 | ifeq ($(OS), LINUX) # also works on FreeBSD 7 | CC ?= gcc 8 | CFLAGS ?= -O2 -Wall 9 | hid_bootloader_cli: hid_bootloader_cli.c 10 | $(CC) $(CFLAGS) -s -DUSE_LIBUSB -o hid_bootloader_cli hid_bootloader_cli.c -lusb 11 | 12 | 13 | else ifeq ($(OS), WINDOWS) 14 | CC = i586-mingw32msvc-gcc 15 | CFLAGS ?= -O2 -Wall 16 | hid_bootloader_cli.exe: hid_bootloader_cli.c 17 | $(CC) $(CFLAGS) -s -DUSE_WIN32 -o hid_bootloader_cli.exe hid_bootloader_cli.c -lhid -lsetupapi 18 | 19 | 20 | else ifeq ($(OS), MACOSX) 21 | CC ?= gcc 22 | SDK ?= /Developer/SDKs/MacOSX10.5.sdk 23 | CFLAGS ?= -O2 -Wall 24 | hid_bootloader_cli: hid_bootloader_cli.c 25 | $(CC) $(CFLAGS) -DUSE_APPLE_IOKIT -isysroot $(SDK) -o hid_bootloader_cli hid_bootloader_cli.c -Wl,-syslibroot,$(SDK) -framework IOKit -framework CoreFoundation 26 | 27 | 28 | else ifeq ($(OS), BSD) # works on NetBSD and OpenBSD 29 | CC ?= gcct 30 | CFLAGS ?= -O2 -Wall 31 | hid_bootloader_cli: hid_bootloader_cli.c 32 | $(CC) $(CFLAGS) -s -DUSE_UHID -o hid_bootloader_cli hid_bootloader_cli.c 33 | 34 | 35 | endif 36 | 37 | 38 | clean: 39 | rm -f hid_bootloader_cli hid_bootloader_cli.exe 40 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/DevelopingWithLUFA.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_DevelopingWithLUFA Developing With LUFA 9 | * 10 | * This section of the manual contains information on LUFA development, such as Getting Started information, 11 | * information on compile-time tuning of the library and other developer-related sections. 12 | * 13 | * Subsections: 14 | * \li \subpage Page_BuildSystem - The LUFA Buildsystem 15 | * \li \subpage Page_TokenSummary - Summary of Compile Time Tokens 16 | * \li \subpage Page_Migration - Migrating from an Older LUFA Version 17 | * \li \subpage Page_VIDPID - Allocated USB VID and PID Values 18 | * \li \subpage Page_OSDrivers - Operating System Driver Information 19 | * \li \subpage Page_BuildLibrary - Building as a Linkable Library 20 | * \li \subpage Page_ExportingLibrary - Exporting LUFA for IDE Use 21 | * \li \subpage Page_WritingBoardDrivers - How to Write Custom Board Drivers 22 | * \li \subpage Page_SoftwareBootloaderStart - How to jump to the bootloader in software 23 | */ 24 | 25 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/lufa_vsmanifest_transform.xslt: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/makefile_template: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2014. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | # -------------------------------------- 9 | # LUFA Project Makefile. 10 | # -------------------------------------- 11 | 12 | # Run "make help" for target help. 13 | 14 | MCU = at90usb1287 15 | ARCH = AVR8 16 | BOARD = USBKEY 17 | F_CPU = 8000000 18 | F_USB = $(F_CPU) 19 | OPTIMIZATION = s 20 | TARGET = Target 21 | SRC = $(TARGET).c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) $(LUFA_SRC_PLATFORM) 22 | LUFA_PATH = ../../LUFA 23 | CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig 24 | LD_FLAGS = 25 | 26 | # Default target 27 | all: 28 | 29 | # Include LUFA build script makefiles 30 | include $(LUFA_PATH)/Build/lufa_core.mk 31 | include $(LUFA_PATH)/Build/lufa_sources.mk 32 | include $(LUFA_PATH)/Build/lufa_build.mk 33 | include $(LUFA_PATH)/Build/lufa_cppcheck.mk 34 | include $(LUFA_PATH)/Build/lufa_doxygen.mk 35 | include $(LUFA_PATH)/Build/lufa_dfu.mk 36 | include $(LUFA_PATH)/Build/lufa_hid.mk 37 | include $(LUFA_PATH)/Build/lufa_avrdude.mk 38 | include $(LUFA_PATH)/Build/lufa_atprogram.mk 39 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/backlight.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Mathias Andersson 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef BACKLIGHT_H 19 | #define BACKLIGHT_H 20 | 21 | #include 22 | #include 23 | 24 | typedef union { 25 | uint8_t raw; 26 | struct { 27 | bool enable :1; 28 | uint8_t level :7; 29 | }; 30 | } backlight_config_t; 31 | 32 | void backlight_init(void); 33 | void backlight_increase(void); 34 | void backlight_decrease(void); 35 | void backlight_toggle(void); 36 | void backlight_step(void); 37 | void backlight_set(uint8_t level); 38 | void backlight_level(uint8_t level); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/lufa_asfmanifest_transform.xslt: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | . 31 | 32 | . 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Donating.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_Donating Donating to Support This Project 9 | * 10 | * \image html Images/Author.jpg "Dean Camera, LUFA Developer" 11 | * 12 | * I am a 24 year old Atmel Applications Engineer, living in Trondheim, Norway and working on LUFA in my spare time. 13 | * The development and support of this library requires much effort from myself, as I am the sole developer, maintainer 14 | * and supporter. Please consider donating a small amount to support this and my future Open Source projects - All 15 | * donations are greatly appreciated. 16 | * 17 | * Note that commercial entities can remove the attribution portion of the LUFA license by a one-time fee - see 18 | * \ref Page_LicenseInfo for more details (Note: Please do NOT pay this in advance through the donation link below - 19 | * contact author for payment details.). 20 | * 21 | * \htmlonly 22 | * \image html "http://www.pledgie.com/campaigns/6927.png" 23 | * \endhtmlonly 24 | * Donate to this project via PayPal - Thanks in Advance! 25 | */ 26 | 27 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/actionmap.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #include 18 | #include "action_code.h" 19 | #include "actionmap.h" 20 | 21 | /* Converts key to action */ 22 | __attribute__ ((weak)) 23 | action_t action_for_key(uint8_t layer, keypos_t key) 24 | { 25 | return (action_t)pgm_read_word(&actionmaps[(layer)][(key.row)][(key.col)]); 26 | } 27 | 28 | /* Macro */ 29 | __attribute__ ((weak)) 30 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 31 | { 32 | return MACRO_NONE; 33 | } 34 | 35 | /* Function */ 36 | __attribute__ ((weak)) 37 | void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) 38 | { 39 | } 40 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LUFA Library 6 | Dean Camera 7 | 0 8 | http://www.lufa-lib.org 9 | LUFA, the Lightweight USB Framework for AVRs. 10 | 11 | License.txt 12 | LUFA_thumb.png 13 | LUFA.png 14 | 15 | 16 | AtmelStudio 17 | AtmelStudio 18 | 19 | 20 | 21 | 1033 22 | 23 | false 24 | 25 | 26 | 27 | 28 | 29 | LUFA.pkgdef 30 | helpcontentsetup.msha 31 | asf-manifest.xml 32 | 33 | 34 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef UTIL_H 19 | #define UTIL_H 20 | 21 | #include 22 | 23 | // convert to L string 24 | #define LSTR(s) XLSTR(s) 25 | #define XLSTR(s) L ## #s 26 | // convert to string 27 | #define STR(s) XSTR(s) 28 | #define XSTR(s) #s 29 | 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | uint8_t bitpop(uint8_t bits); 36 | uint8_t bitpop16(uint16_t bits); 37 | uint8_t bitpop32(uint32_t bits); 38 | 39 | uint8_t biton(uint8_t bits); 40 | uint8_t biton16(uint16_t bits); 41 | uint8_t biton32(uint32_t bits); 42 | 43 | uint8_t bitrev(uint8_t bits); 44 | uint16_t bitrev16(uint16_t bits); 45 | uint32_t bitrev32(uint32_t bits); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/ring_buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef RING_BUFFER_H 2 | #define RING_BUFFER_H 3 | /*-------------------------------------------------------------------- 4 | * Ring buffer to store scan codes from keyboard 5 | *------------------------------------------------------------------*/ 6 | #define RBUF_SIZE 32 7 | static uint8_t rbuf[RBUF_SIZE]; 8 | static uint8_t rbuf_head = 0; 9 | static uint8_t rbuf_tail = 0; 10 | static inline void rbuf_enqueue(uint8_t data) 11 | { 12 | uint8_t sreg = SREG; 13 | cli(); 14 | uint8_t next = (rbuf_head + 1) % RBUF_SIZE; 15 | if (next != rbuf_tail) { 16 | rbuf[rbuf_head] = data; 17 | rbuf_head = next; 18 | } else { 19 | print("rbuf: full\n"); 20 | } 21 | SREG = sreg; 22 | } 23 | static inline uint8_t rbuf_dequeue(void) 24 | { 25 | uint8_t val = 0; 26 | 27 | uint8_t sreg = SREG; 28 | cli(); 29 | if (rbuf_head != rbuf_tail) { 30 | val = rbuf[rbuf_tail]; 31 | rbuf_tail = (rbuf_tail + 1) % RBUF_SIZE; 32 | } 33 | SREG = sreg; 34 | 35 | return val; 36 | } 37 | static inline bool rbuf_has_data(void) 38 | { 39 | uint8_t sreg = SREG; 40 | cli(); 41 | bool has_data = (rbuf_head != rbuf_tail); 42 | SREG = sreg; 43 | return has_data; 44 | } 45 | static inline void rbuf_clear(void) 46 | { 47 | uint8_t sreg = SREG; 48 | cli(); 49 | rbuf_head = rbuf_tail = 0; 50 | SREG = sreg; 51 | } 52 | 53 | #endif /* RING_BUFFER_H */ 54 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/avr/timer_avr.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef TIMER_AVR_H 19 | #define TIMER_AVR_H 1 20 | 21 | #include 22 | 23 | #ifndef TIMER_PRESCALER 24 | # if F_CPU > 16000000 25 | # define TIMER_PRESCALER 256 26 | # elif F_CPU > 2000000 27 | # define TIMER_PRESCALER 64 28 | # elif F_CPU > 250000 29 | # define TIMER_PRESCALER 8 30 | # else 31 | # define TIMER_PRESCALER 1 32 | # endif 33 | #endif 34 | #define TIMER_RAW_FREQ (F_CPU/TIMER_PRESCALER) 35 | #define TIMER_RAW TCNT0 36 | #define TIMER_RAW_TOP (TIMER_RAW_FREQ/1000) 37 | 38 | #if (TIMER_RAW_TOP > 255) 39 | # error "Timer0 can't count 1ms at this clock freq. Use larger prescaler." 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Groups.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \defgroup Group_BoardDrivers Board Drivers 8 | * 9 | * \brief Functions, macros, variables, enums and types related to the control of physical board hardware. 10 | */ 11 | 12 | /** \defgroup Group_PeripheralDrivers On-chip Peripheral Drivers 13 | * 14 | * \brief Functions, macros, variables, enums and types related to the control of AVR subsystems. 15 | */ 16 | 17 | /** \defgroup Group_MiscDrivers Miscellaneous Drivers 18 | * 19 | * \brief Miscellaneous driver Functions, macros, variables, enums and types. 20 | */ 21 | 22 | /** \defgroup Group_PlatformDrivers_AVR8 AVR8 23 | * \ingroup Group_PlatformDrivers 24 | * 25 | * \brief Drivers relating to the AVR8 architecture platform, such as clock setup and interrupt management. 26 | */ 27 | 28 | /** \defgroup Group_PlatformDrivers_XMEGA XMEGA 29 | * \ingroup Group_PlatformDrivers 30 | * 31 | * \brief Drivers relating to the XMEGA architecture platform, such as clock setup and interrupt management. 32 | */ 33 | 34 | /** \defgroup Group_PlatformDrivers_UC3 UC3 35 | * \ingroup Group_PlatformDrivers 36 | * 37 | * \brief Drivers relating to the UC3 architecture platform, such as clock setup and interrupt management. 38 | */ 39 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildingLinkableLibraries.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_BuildLibrary Building as a Linkable Library 8 | * 9 | * The LUFA library can be built as a proper linkable library (with the extension .a) under AVR-GCC, so that 10 | * the library does not need to be recompiled with each revision of a user project. Instructions for creating 11 | * a library from a given source tree can be found in the AVR-GCC user manual included in the WinAVR install 12 | * /Docs/ directory. 13 | * 14 | * However, building the library is not recommended, as the static (compile-time) options will be 15 | * unable to be changed without a recompilation of the LUFA code. Therefore, if the library is to be built 16 | * from the LUFA source, it should be made to be application-specific and compiled with the static options 17 | * that are required for each project (which should be recorded along with the library). 18 | * 19 | * Normal library use has the library components compiled in at the same point as the application code, as 20 | * demonstrated in the library demos and applications. This is the preferred method, as the library is recompiled 21 | * each time to ensure that all static options for a particular application are applied. 22 | */ 23 | 24 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_USB_DRIVER 32 | #include "../USBMode.h" 33 | 34 | #if defined(USB_CAN_BE_HOST) 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/mbed/xprintf.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | //#include 3 | #include "mbed.h" 4 | #include "mbed/xprintf.h" 5 | 6 | 7 | #define STRING_STACK_LIMIT 120 8 | 9 | //TODO 10 | int xprintf(const char* format, ...) { return 0; } 11 | 12 | #if 0 13 | /* mbed Serial */ 14 | Serial ser(UART_TX, UART_RX); 15 | 16 | /* TODO: Need small implementation for embedded */ 17 | int xprintf(const char* format, ...) 18 | { 19 | /* copy from mbed/common/RawSerial.cpp */ 20 | std::va_list arg; 21 | va_start(arg, format); 22 | int len = vsnprintf(NULL, 0, format, arg); 23 | if (len < STRING_STACK_LIMIT) { 24 | char temp[STRING_STACK_LIMIT]; 25 | vsprintf(temp, format, arg); 26 | ser.puts(temp); 27 | } else { 28 | char *temp = new char[len + 1]; 29 | vsprintf(temp, format, arg); 30 | ser.puts(temp); 31 | delete[] temp; 32 | } 33 | va_end(arg); 34 | return len; 35 | 36 | /* Fail: __builtin_va_arg_pack? 37 | * https://gcc.gnu.org/onlinedocs/gcc-4.3.5/gcc/Constructing-Calls.html#Constructing-Calls 38 | void *arg = __builtin_apply_args(); 39 | void *ret = __builtin_apply((void*)(&(ser.printf)), arg, 100); 40 | __builtin_return(ret) 41 | */ 42 | /* Fail: varargs can not be passed to printf 43 | //int r = ser.printf("test %i\r\n", 123); 44 | va_list arg; 45 | va_start(arg, format); 46 | int r = ser.printf(format, arg); 47 | va_end(arg); 48 | return r; 49 | */ 50 | } 51 | #endif 52 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #define __INCLUDE_FROM_EVENTS_C 32 | #define __INCLUDE_FROM_USB_DRIVER 33 | #include "Events.h" 34 | 35 | void USB_Event_Stub(void) 36 | { 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/XDK/lufa_filelist_transform.xslt: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | Sourced from 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_helpcontentsetup_transform.xslt: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | lufa_help_ 34 | 35 | .mshc 36 | 37 | 38 | lufa_help_ 39 | 40 | .mshc 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2014. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | 9 | # Makefile to build all the LUFA USB Bootloaders. Call with "make all" to 10 | # rebuild all bootloaders. 11 | 12 | # Bootloaders are pre-cleaned before each one is built, to ensure any 13 | # custom LUFA library build options are reflected in the compiled 14 | # code. 15 | 16 | PROJECT_DIRECTORIES := $(shell ls -d */) 17 | 18 | # This makefile is potentially infinitely recursive if something really bad 19 | # happens when determining the set of project directories - hard-abort if 20 | # more than 10 levels deep to avoid angry emails. 21 | ifeq ($(MAKELEVEL), 10) 22 | $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) 23 | endif 24 | 25 | # Need to special-case building without a per-project object directory 26 | ifeq ($(OBJDIR),) 27 | # If no target specified, force "clean all" and disallow parallel build 28 | ifeq ($(MAKECMDGOALS),) 29 | MAKECMDGOALS := clean all 30 | .NOTPARALLEL: 31 | endif 32 | 33 | # If one of the targets is to build, force "clean" beforehand and disallow parallel build 34 | ifneq ($(findstring all, $(MAKECMDGOALS)),) 35 | MAKECMDGOALS := clean $(MAKECMDGOALS) 36 | .NOTPARALLEL: 37 | endif 38 | endif 39 | 40 | %: $(PROJECT_DIRECTORIES) 41 | @echo . > /dev/null 42 | 43 | $(PROJECT_DIRECTORIES): 44 | @$(MAKE) -C $@ $(MAKECMDGOALS) 45 | 46 | .PHONY: $(PROJECT_DIRECTORIES) 47 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/LibraryResources.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_Resources Library Resources 9 | * 10 | * \section Sec_UnofficialResources Unofficial Resources 11 | * Unofficial Russian LUFA documentation translation: http://microsin.ru/Download.cnt/doc/LUFA/ \n 12 | * Tutorial for LUFA USB Control Transfers: http://www.avrbeginners.net/new/tutorials/usb-control-transfers-with-lufa/ 13 | * 14 | * \section Sec_ProjectPages LUFA Related Webpages 15 | * Project Homepage: http://www.lufa-lib.org \n 16 | * Commercial Licenses: http://www.lufa-lib.org/license \n 17 | * Author's Website: http://www.fourwalledcubicle.com \n 18 | * Development Blog: http://www.fourwalledcubicle.com/blog \n 19 | * 20 | * \section Sec_ProjectHelp Assistance With LUFA 21 | * Support Mailing List: http://www.lufa-lib.org/support \n 22 | * Author's Email: dean [at] fourwalledcubicle [dot] com \n 23 | * 24 | * \section Sec_InDevelopment Latest In-Development Source Code 25 | * Issue Tracker: http://www.lufa-lib.org/tracker \n 26 | * Public GIT Repository: http://www.lufa-lib.org/git \n 27 | * Latest Repository Source Archive: http://www.lufa-lib.org/latest-archive \n 28 | * Commit RSS Feed: http://www.lufa-lib.org/rss \n 29 | * 30 | * \section Sec_USBResources USB Resources 31 | * USB-IF Website: http://www.usb.org \n 32 | */ 33 | 34 | -------------------------------------------------------------------------------- /www/js/ui-elements.js: -------------------------------------------------------------------------------- 1 | // Radio group behavior. 2 | $('.radio-group button').click(function() { 3 | // Deactivate all siblings. 4 | $(this).siblings().removeClass('active'); 5 | 6 | // Set self to active. 7 | $(this).addClass('active'); 8 | }); 9 | 10 | // Number field. 11 | $('input.number').click(function() { 12 | // Select everything when clicked. 13 | $(this).select(); 14 | }); 15 | 16 | // Number selector buttons. 17 | $('.number-sm').click(function() { 18 | // Get the element it corresponds to. 19 | var box = $('#' + $(this).data('for')); 20 | 21 | // Reduce the element's value if possible. 22 | if (parseInt(box.prop('min')) < parseInt(box.val())) { 23 | box.val(parseInt(box.val()) - 1); 24 | box.change(); 25 | } 26 | }); 27 | $('.number-lg').click(function() { 28 | // Get the element it corresponds to. 29 | var box = $('#' + $(this).data('for')); 30 | 31 | // Increase the element's value if possible. 32 | if (parseInt(box.prop('max')) > parseInt(box.val())) { 33 | box.val(parseInt(box.val()) + 1); 34 | box.change(); 35 | } 36 | }); 37 | 38 | // Tooltip. 39 | $(window).mousemove(function() { 40 | $('.tooltip').hide(); 41 | }); 42 | $('.tooltip-hover').mousemove(function(e) { 43 | // Prevent the event from propagating to the window. 44 | e.stopPropagation(); 45 | 46 | // Set the tooltip text. 47 | $('.tooltip').html($(this).data('text')); 48 | 49 | // Show the tooltip. 50 | $('.tooltip').show(); 51 | 52 | // Move the tooltip to the mouse. 53 | $('.tooltip').css({ 54 | 'top': e.pageY - $('.tooltip').outerHeight() / 2, 55 | 'left': e.pageX + 10 56 | }); 57 | }); 58 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_XMEGA) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_HOST) 38 | 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_XMEGA) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_HOST) 38 | 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/hook.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #include "keyboard.h" 19 | #include "hook.h" 20 | 21 | /* ------------------------------------------------- 22 | * Definitions of default hooks 23 | * ------------------------------------------------- */ 24 | 25 | __attribute__((weak)) 26 | void hook_keyboard_loop(void) {} 27 | 28 | __attribute__((weak)) 29 | void hook_matrix_change(keyevent_t event) { 30 | (void)event; 31 | } 32 | 33 | __attribute__((weak)) 34 | void hook_default_layer_change(uint32_t default_layer_state) { 35 | (void)default_layer_state; 36 | } 37 | 38 | __attribute__((weak)) 39 | void hook_layer_change(uint32_t layer_state) { 40 | (void)layer_state; 41 | } 42 | 43 | __attribute__((weak)) 44 | void hook_keyboard_leds_change(uint8_t led_status) { 45 | keyboard_set_leds(led_status); 46 | } 47 | 48 | __attribute__((weak)) 49 | void hook_bootmagic(void) {} 50 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Template for a LUFA USB host mode application. 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol.mk: -------------------------------------------------------------------------------- 1 | PROTOCOL_DIR = protocol 2 | 3 | 4 | ifdef PS2_MOUSE_ENABLE 5 | SRC += $(PROTOCOL_DIR)/ps2_mouse.c 6 | OPT_DEFS += -DPS2_MOUSE_ENABLE 7 | OPT_DEFS += -DMOUSE_ENABLE 8 | endif 9 | 10 | ifdef PS2_USE_BUSYWAIT 11 | SRC += protocol/ps2_busywait.c 12 | SRC += protocol/ps2_io_avr.c 13 | OPT_DEFS += -DPS2_USE_BUSYWAIT 14 | endif 15 | 16 | ifdef PS2_USE_INT 17 | SRC += protocol/ps2_interrupt.c 18 | SRC += protocol/ps2_io_avr.c 19 | OPT_DEFS += -DPS2_USE_INT 20 | endif 21 | 22 | ifdef PS2_USE_USART 23 | SRC += protocol/ps2_usart.c 24 | SRC += protocol/ps2_io_avr.c 25 | OPT_DEFS += -DPS2_USE_USART 26 | endif 27 | 28 | 29 | ifdef XT_USE_INT 30 | SRC += protocol/xt_interrupt.c 31 | SRC += protocol/xt_io_avr.c 32 | OPT_DEFS += -DXT_USE_INT 33 | endif 34 | 35 | 36 | ifdef SERIAL_MOUSE_MICROSOFT_ENABLE 37 | SRC += $(PROTOCOL_DIR)/serial_mouse_microsoft.c 38 | OPT_DEFS += -DSERIAL_MOUSE_ENABLE -DSERIAL_MOUSE_MICROSOFT \ 39 | -DMOUSE_ENABLE 40 | endif 41 | 42 | ifdef SERIAL_MOUSE_MOUSESYSTEMS_ENABLE 43 | SRC += $(PROTOCOL_DIR)/serial_mouse_mousesystems.c 44 | OPT_DEFS += -DSERIAL_MOUSE_ENABLE -DSERIAL_MOUSE_MOUSESYSTEMS \ 45 | -DMOUSE_ENABLE 46 | endif 47 | 48 | ifdef SERIAL_MOUSE_USE_SOFT 49 | SRC += $(PROTOCOL_DIR)/serial_soft.c 50 | endif 51 | 52 | ifdef SERIAL_MOUSE_USE_UART 53 | SRC += $(PROTOCOL_DIR)/serial_uart.c 54 | endif 55 | 56 | ifdef ADB_MOUSE_ENABLE 57 | OPT_DEFS += -DADB_MOUSE_ENABLE -DMOUSE_ENABLE 58 | endif 59 | 60 | # Search Path 61 | VPATH += $(TMK_DIR)/protocol 62 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef TIMER_H 19 | #define TIMER_H 1 20 | 21 | #include 22 | 23 | #if defined(__AVR__) 24 | #include "avr/timer_avr.h" 25 | #endif 26 | 27 | 28 | #define TIMER_DIFF(a, b, max) ((a) >= (b) ? (a) - (b) : (max) - (b) + (a)) 29 | #define TIMER_DIFF_8(a, b) TIMER_DIFF(a, b, UINT8_MAX) 30 | #define TIMER_DIFF_16(a, b) TIMER_DIFF(a, b, UINT16_MAX) 31 | #define TIMER_DIFF_32(a, b) TIMER_DIFF(a, b, UINT32_MAX) 32 | #define TIMER_DIFF_RAW(a, b) TIMER_DIFF_8(a, b) 33 | 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | extern volatile uint32_t timer_count; 40 | 41 | 42 | void timer_init(void); 43 | void timer_clear(void); 44 | uint16_t timer_read(void); 45 | uint32_t timer_read32(void); 46 | uint16_t timer_elapsed(uint16_t last); 47 | uint32_t timer_elapsed32(uint32_t last); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa.mk: -------------------------------------------------------------------------------- 1 | LUFA_DIR = protocol/lufa 2 | 3 | # Path to the LUFA library 4 | LUFA_PATH ?= $(LUFA_DIR)/LUFA-git 5 | 6 | 7 | # Create the LUFA source path variables by including the LUFA makefile 8 | ifneq (, $(wildcard $(TMK_DIR)/$(LUFA_PATH)/LUFA/Build/lufa_sources.mk)) 9 | # New build system from 20120730 10 | LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA 11 | include $(TMK_DIR)/$(LUFA_PATH)/LUFA/Build/lufa_sources.mk 12 | else 13 | include $(TMK_DIR)/$(LUFA_PATH)/LUFA/makefile 14 | endif 15 | 16 | LUFA_SRC = $(LUFA_DIR)/lufa.c \ 17 | $(LUFA_DIR)/descriptor.c \ 18 | $(LUFA_SRC_USB) 19 | 20 | SRC += $(LUFA_SRC) 21 | 22 | # Search Path 23 | VPATH += $(TMK_DIR)/$(LUFA_DIR) 24 | VPATH += $(TMK_DIR)/$(LUFA_PATH) 25 | 26 | # Option modules 27 | #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE) 28 | #endif 29 | 30 | #ifdef EXTRAKEY_ENABLE 31 | #endif 32 | 33 | # LUFA library compile-time options and predefined tokens 34 | LUFA_OPTS = -DUSB_DEVICE_ONLY 35 | LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS 36 | LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" 37 | #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT 38 | LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 39 | LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1 40 | # Remote wakeup fix for ATmega32U2 https://github.com/tmk/tmk_keyboard/issues/361 41 | ifeq ($(MCU),atmega32u2) 42 | LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT 43 | endif 44 | 45 | OPT_DEFS += -DF_USB=$(F_USB)UL 46 | OPT_DEFS += -DARCH=ARCH_$(ARCH) 47 | OPT_DEFS += $(LUFA_OPTS) 48 | 49 | # This indicates using LUFA stack 50 | OPT_DEFS += -DPROTOCOL_LUFA 51 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2014. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | # -------------------------------------- 9 | # LUFA Project Makefile. 10 | # -------------------------------------- 11 | 12 | # Run "make help" for target help. 13 | 14 | MCU = at90usb1287 15 | ARCH = AVR8 16 | F_CPU = 1000000 17 | F_USB = $(F_CPU) 18 | OPTIMIZATION = s 19 | TARGET = HID_EEPROM_Loader 20 | SRC = $(TARGET).c 21 | LUFA_PATH = ../../../LUFA 22 | CC_FLAGS = 23 | LD_FLAGS = 24 | OBJECT_FILES = InputEEData.o 25 | 26 | # Default target 27 | all: 28 | 29 | # Determine the AVR sub-architecture of the build main application object file 30 | FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1) 31 | 32 | # Create a linkable object file with the input binary EEPROM data stored in the FLASH section 33 | InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST) 34 | @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\" 35 | avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@ 36 | 37 | # Include LUFA build script makefiles 38 | include $(LUFA_PATH)/Build/lufa_core.mk 39 | include $(LUFA_PATH)/Build/lufa_build.mk 40 | include $(LUFA_PATH)/Build/lufa_cppcheck.mk 41 | include $(LUFA_PATH)/Build/lufa_doxygen.mk 42 | include $(LUFA_PATH)/Build/lufa_hid.mk 43 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/host.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef HOST_H 19 | #define HOST_H 20 | 21 | #include 22 | #include 23 | #include "report.h" 24 | #include "host_driver.h" 25 | 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #ifdef NKRO_ENABLE 32 | extern bool keyboard_nkro; 33 | #endif 34 | 35 | extern uint8_t keyboard_idle; 36 | extern uint8_t keyboard_protocol; 37 | 38 | 39 | /* host driver */ 40 | void host_set_driver(host_driver_t *driver); 41 | host_driver_t *host_get_driver(void); 42 | 43 | /* host driver interface */ 44 | uint8_t host_keyboard_leds(void); 45 | void host_keyboard_send(report_keyboard_t *report); 46 | void host_mouse_send(report_mouse_t *report); 47 | void host_system_send(uint16_t data); 48 | void host_consumer_send(uint16_t data); 49 | 50 | uint16_t host_last_sysytem_report(void); 51 | uint16_t host_last_consumer_report(void); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/chibios/bootloader.c: -------------------------------------------------------------------------------- 1 | #include "bootloader.h" 2 | 3 | #include "ch.h" 4 | #include "hal.h" 5 | 6 | #ifdef STM32_BOOTLOADER_ADDRESS 7 | /* STM32 */ 8 | 9 | #if defined(STM32F0XX) 10 | /* This code should be checked whether it runs correctly on platforms */ 11 | #define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) 12 | extern uint32_t __ram0_end__; 13 | 14 | void bootloader_jump(void) { 15 | *((unsigned long *)(SYMVAL(__ram0_end__) - 4)) = 0xDEADBEEF; // set magic flag => reset handler will jump into boot loader 16 | NVIC_SystemReset(); 17 | } 18 | 19 | #else /* defined(STM32F0XX) */ 20 | #error Check that the bootloader code works on your platform and add it to bootloader.c! 21 | #endif /* defined(STM32F0XX) */ 22 | 23 | #elif defined(KL2x) || defined(K20x) /* STM32_BOOTLOADER_ADDRESS */ 24 | /* Kinetis */ 25 | 26 | #if defined(KIIBOHD_BOOTLOADER) 27 | /* Kiibohd Bootloader (MCHCK and Infinity KB) */ 28 | #define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000 29 | const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff"; 30 | void bootloader_jump(void) { 31 | __builtin_memcpy((void *)VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); 32 | // request reset 33 | SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk; 34 | } 35 | 36 | #else /* defined(KIIBOHD_BOOTLOADER) */ 37 | /* Default for Kinetis - expecting an ARM Teensy */ 38 | void bootloader_jump(void) { 39 | chThdSleepMilliseconds(100); 40 | __BKPT(0); 41 | } 42 | #endif /* defined(KIIBOHD_BOOTLOADER) */ 43 | 44 | #else /* neither STM32 nor KINETIS */ 45 | __attribute__((weak)) 46 | void bootloader_jump(void) {} 47 | #endif -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/avr/eeconfig.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "eeconfig.h" 5 | 6 | void eeconfig_init(void) 7 | { 8 | eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); 9 | eeprom_write_byte(EECONFIG_DEBUG, 0); 10 | eeprom_write_byte(EECONFIG_DEFAULT_LAYER, 0); 11 | eeprom_write_byte(EECONFIG_KEYMAP, 0); 12 | eeprom_write_byte(EECONFIG_MOUSEKEY_ACCEL, 0); 13 | #ifdef BACKLIGHT_ENABLE 14 | eeprom_write_byte(EECONFIG_BACKLIGHT, 0); 15 | #endif 16 | } 17 | 18 | void eeconfig_enable(void) 19 | { 20 | eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); 21 | } 22 | 23 | void eeconfig_disable(void) 24 | { 25 | eeprom_write_word(EECONFIG_MAGIC, 0xFFFF); 26 | } 27 | 28 | bool eeconfig_is_enabled(void) 29 | { 30 | return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER); 31 | } 32 | 33 | uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); } 34 | void eeconfig_write_debug(uint8_t val) { eeprom_write_byte(EECONFIG_DEBUG, val); } 35 | 36 | uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); } 37 | void eeconfig_write_default_layer(uint8_t val) { eeprom_write_byte(EECONFIG_DEFAULT_LAYER, val); } 38 | 39 | uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); } 40 | void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val); } 41 | 42 | #ifdef BACKLIGHT_ENABLE 43 | uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); } 44 | void eeconfig_write_backlight(uint8_t val) { eeprom_write_byte(EECONFIG_BACKLIGHT, val); } 45 | #endif 46 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_XMEGA) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_DEVICE) 38 | 39 | #include "../Device.h" 40 | 41 | void USB_Device_SendRemoteWakeup(void) 42 | { 43 | USB.CTRLB |= USB_RWAKEUP_bm; 44 | } 45 | 46 | #endif 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/UC3/Device_UC3.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_UC3) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_DEVICE) 38 | 39 | #include "../Device.h" 40 | 41 | void USB_Device_SendRemoteWakeup(void) 42 | { 43 | USB_CLK_Unfreeze(); 44 | 45 | AVR32_USBB.UDCON.rmwkup = true; 46 | while (AVR32_USBB.UDCON.rmwkup); 47 | } 48 | 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Style/Footer.htm: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2014. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | # -------------------------------------- 9 | # LUFA Project Makefile. 10 | # -------------------------------------- 11 | 12 | # Run "make help" for target help. 13 | 14 | MCU = at90usb1287 15 | ARCH = AVR8 16 | BOARD = USBKEY 17 | F_CPU = 8000000 18 | F_USB = $(F_CPU) 19 | OPTIMIZATION = s 20 | TARGET = BootloaderHID 21 | SRC = $(TARGET).c Descriptors.c $(LUFA_SRC_USB) 22 | LUFA_PATH = ../../LUFA 23 | CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ 24 | LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) 25 | 26 | # Flash size and bootloader section sizes of the target, in KB. These must 27 | # match the target's total FLASH size and the bootloader size set in the 28 | # device's fuses. 29 | FLASH_SIZE_KB := 128 30 | BOOT_SECTION_SIZE_KB := 8 31 | 32 | # Bootloader address calculation formulas 33 | # Do not modify these macros, but rather modify the dependent values above. 34 | CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) 35 | BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) 36 | BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) 37 | 38 | # Default target 39 | all: 40 | 41 | # Include LUFA build script makefiles 42 | include $(LUFA_PATH)/Build/lufa_core.mk 43 | include $(LUFA_PATH)/Build/lufa_sources.mk 44 | include $(LUFA_PATH)/Build/lufa_build.mk 45 | include $(LUFA_PATH)/Build/lufa_cppcheck.mk 46 | include $(LUFA_PATH)/Build/lufa_doxygen.mk 47 | include $(LUFA_PATH)/Build/lufa_avrdude.mk 48 | include $(LUFA_PATH)/Build/lufa_atprogram.mk 49 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for DeviceApplication.c. 34 | */ 35 | 36 | #ifndef _USB_DEVICE_APPLICATION_H_ 37 | #define _USB_DEVICE_APPLICATION_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | #include 46 | 47 | #include "Descriptors.h" 48 | 49 | /* Function Prototypes: */ 50 | void SetupHardware(void); 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /www/js/ui/init.js: -------------------------------------------------------------------------------- 1 | /*** INITIAL SETUP ***/ 2 | 3 | // Safari and IE warning. 4 | var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; 5 | var isIE = false || !!document.documentMode; 6 | if (isSafari || isIE) { 7 | showError('You are using an unsupported browser. Most features will work, but some may not.'); 8 | } 9 | 10 | // Upload button. 11 | $('#tfb-upload').click(function() { 12 | // Get the file. 13 | readFile(function(json) { 14 | try { 15 | _keyboard = JSON.parse(json); 16 | if (_keyboard.isKeyboard != 'thisIsAKeyboard') throw 'invalid layout'; 17 | init(); 18 | } catch (e) { 19 | console.error(e); 20 | showError('Bad configuration file.'); 21 | } 22 | }); 23 | }); 24 | 25 | // Import button. 26 | $('#kle-import').click(function() { 27 | // Get the contents of the textarea. 28 | var json = $('#kle').val(); 29 | 30 | // Attempt to create the keyboard. 31 | try { 32 | _keyboard = fromKLE(json); 33 | init(); 34 | } catch (e) { 35 | console.error(e); 36 | showError('Invalid layout.'); 37 | } 38 | }); 39 | 40 | // Preset button. 41 | $('.preset-btn').click(function() { 42 | // Get the id. 43 | var id = $(this).data('id'); 44 | 45 | // Load the preset. 46 | loadPreset(id); 47 | }); 48 | 49 | /* 50 | * Initialize the editor. 51 | */ 52 | function init() { 53 | // Hide errors. 54 | $('#err').hide(); 55 | 56 | // Load settings. 57 | loadCompileConfig(); 58 | 59 | // Reset and show the config screen. 60 | resetConfig(); 61 | showScreen('config'); 62 | 63 | // Show the wire config. 64 | setConfigMode(MODE_WIRE); 65 | 66 | // Set the pin config. 67 | setPinConfig(); 68 | 69 | // Add a key chooser to key config. 70 | $('.config-key').append(createChooser(setKeycode)); 71 | 72 | // Add a key chooser to macro editor. 73 | $('.config-macro-selector').append(createChooser(addMacroAction)); 74 | } 75 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/Config/AppConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Application Configuration Header File 33 | * 34 | * This is a header file which is be used to configure LUFA's 35 | * compile time options, as an alternative to the compile time 36 | * constants supplied through a makefile. 37 | * 38 | * For information on what each token does, refer to the 39 | * \ref Sec_Options section of the application documentation. 40 | */ 41 | 42 | #ifndef _APP_CONFIG_H_ 43 | #define _APP_CONFIG_H_ 44 | 45 | // #define NO_APP_START_ON_EJECT 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/action_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #ifndef ACTION_UTIL_H 18 | #define ACTION_UTIL_H 19 | 20 | #include 21 | #include "report.h" 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | extern report_keyboard_t *keyboard_report; 28 | 29 | void send_keyboard_report(void); 30 | 31 | /* key */ 32 | void add_key(uint8_t key); 33 | void del_key(uint8_t key); 34 | void clear_keys(void); 35 | 36 | /* modifier */ 37 | uint8_t get_mods(void); 38 | void add_mods(uint8_t mods); 39 | void del_mods(uint8_t mods); 40 | void set_mods(uint8_t mods); 41 | void clear_mods(void); 42 | 43 | /* weak modifier */ 44 | uint8_t get_weak_mods(void); 45 | void add_weak_mods(uint8_t mods); 46 | void del_weak_mods(uint8_t mods); 47 | void set_weak_mods(uint8_t mods); 48 | void clear_weak_mods(void); 49 | 50 | /* oneshot modifier */ 51 | void set_oneshot_mods(uint8_t mods); 52 | void clear_oneshot_mods(void); 53 | void oneshot_toggle(void); 54 | void oneshot_enable(void); 55 | void oneshot_disable(void); 56 | 57 | /* inspect */ 58 | uint8_t has_anykey(void); 59 | uint8_t has_anymod(void); 60 | uint8_t get_first_key(void); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../../../Common/Common.h" 32 | #if (ARCH == ARCH_AVR8) 33 | 34 | #define __INCLUDE_FROM_USB_DRIVER 35 | #include "../USBMode.h" 36 | 37 | #if defined(USB_CAN_BE_DEVICE) 38 | 39 | #include "../Device.h" 40 | 41 | void USB_Device_SendRemoteWakeup(void) 42 | { 43 | if (!(USB_Options & USB_OPT_MANUAL_PLL)) 44 | { 45 | USB_PLL_On(); 46 | while (!(USB_PLL_IsReady())); 47 | } 48 | 49 | USB_CLK_Unfreeze(); 50 | 51 | UDCON |= (1 << RMWKUP); 52 | while (UDCON & (1 << RMWKUP)); 53 | } 54 | 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/chibios/suspend.c: -------------------------------------------------------------------------------- 1 | /* TODO */ 2 | 3 | #include "ch.h" 4 | #include "hal.h" 5 | 6 | #include "matrix.h" 7 | #include "action.h" 8 | #include "action_util.h" 9 | #include "mousekey.h" 10 | #include "host.h" 11 | #include "backlight.h" 12 | #include "suspend.h" 13 | 14 | void suspend_idle(uint8_t time) { 15 | // TODO: this is not used anywhere - what units is 'time' in? 16 | chThdSleepMilliseconds(time); 17 | } 18 | 19 | void suspend_power_down(void) { 20 | // TODO: figure out what to power down and how 21 | // shouldn't power down TPM/FTM if we want a breathing LED 22 | // also shouldn't power down USB 23 | 24 | // on AVR, this enables the watchdog for 15ms (max), and goes to 25 | // SLEEP_MODE_PWR_DOWN 26 | 27 | chThdSleepMilliseconds(17); 28 | } 29 | 30 | __attribute__ ((weak)) void matrix_power_up(void) {} 31 | __attribute__ ((weak)) void matrix_power_down(void) {} 32 | bool suspend_wakeup_condition(void) 33 | { 34 | matrix_power_up(); 35 | matrix_scan(); 36 | matrix_power_down(); 37 | for (uint8_t r = 0; r < MATRIX_ROWS; r++) { 38 | if (matrix_get_row(r)) return true; 39 | } 40 | return false; 41 | } 42 | 43 | // run immediately after wakeup 44 | void suspend_wakeup_init(void) 45 | { 46 | // clear keyboard state 47 | // need to do it manually, because we're running from ISR 48 | // and clear_keyboard() calls print 49 | // so only clear the variables in memory 50 | // the reports will be sent from main.c afterwards 51 | // or if the PC asks for GET_REPORT 52 | clear_mods(); 53 | clear_weak_mods(); 54 | clear_keys(); 55 | #ifdef MOUSEKEY_ENABLE 56 | mousekey_clear(); 57 | #endif /* MOUSEKEY_ENABLE */ 58 | #ifdef EXTRAKEY_ENABLE 59 | host_system_send(0); 60 | host_consumer_send(0); 61 | #endif /* EXTRAKEY_ENABLE */ 62 | #ifdef BACKLIGHT_ENABLE 63 | backlight_init(); 64 | #endif /* BACKLIGHT_ENABLE */ 65 | } 66 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/print.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2012,2013 Jun Wako */ 2 | /* Very basic print functions, intended to be used with usb_debug_only.c 3 | * http://www.pjrc.com/teensy/ 4 | * Copyright (c) 2008 PJRC.COM, LLC 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #include 26 | #include "print.h" 27 | 28 | 29 | #ifndef NO_PRINT 30 | 31 | #if defined(__AVR__) 32 | 33 | #define sendchar(c) xputc(c) 34 | 35 | 36 | void print_set_sendchar(int8_t (*sendchar_func)(uint8_t)) 37 | { 38 | xdev_out(sendchar_func); 39 | } 40 | 41 | #elif defined(PROTOCOL_CHIBIOS) /* __AVR__ */ 42 | 43 | // don't need anything extra 44 | 45 | #elif defined(__arm__) /* __AVR__ */ 46 | 47 | // TODO 48 | //void print_set_sendchar(int8_t (*sendchar_func)(uint8_t)) { } 49 | 50 | #endif /* __AVR__ */ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/Config/AppConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Application Configuration Header File 33 | * 34 | * This is a header file which is be used to configure some of 35 | * the application's compile time options, as an alternative to 36 | * specifying the compile time constants supplied through a 37 | * makefile or build system. 38 | * 39 | * For information on what each token does, refer to the 40 | * \ref Sec_Options section of the application documentation. 41 | */ 42 | 43 | #ifndef _APP_CONFIG_H_ 44 | #define _APP_CONFIG_H_ 45 | 46 | #define SECURE_MODE false 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/Config/AppConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * \brief Application Configuration Header File 33 | * 34 | * This is a header file which is be used to configure LUFA's 35 | * compile time options, as an alternative to the compile time 36 | * constants supplied through a makefile. 37 | * 38 | * For information on what each token does, refer to the 39 | * \ref Sec_Options section of the application documentation. 40 | */ 41 | 42 | #ifndef _APP_CONFIG_H_ 43 | #define _APP_CONFIG_H_ 44 | 45 | // #define NO_BLOCK_SUPPORT 46 | // #define NO_EEPROM_BYTE_SUPPORT 47 | // #define NO_FLASH_BYTE_SUPPORT 48 | // #define NO_LOCK_BYTE_WRITE_SUPPORT 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/HostApplication.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for HostApplication.c. 34 | */ 35 | 36 | #ifndef _USB_HOST_APPLICATION_H_ 37 | #define _USB_HOST_APPLICATION_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | /* Macros: */ 47 | #if (defined(ARCH_HAS_MULTI_ADDRESS_SPACE) && \ 48 | !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))) 49 | #define HAS_MULTIPLE_DESCRIPTOR_ADDRESS_SPACES 50 | #endif 51 | 52 | /* Function Prototypes: */ 53 | void SetupHardware(void); 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/Style/Style.css: -------------------------------------------------------------------------------- 1 | /* ============================= */ 2 | /* Page Header Formattings */ 3 | /* ============================= */ 4 | #titlearea { 5 | background-color:#E1E7F4; 6 | background-image:url('nav_f.png'); 7 | background-repeat:repeat-x; 8 | color:#20335A; 9 | font-weight:bold; 10 | text-shadow:0 1px 1px rgba(255, 255, 255, 0.9); 11 | } 12 | 13 | #projectlogo { 14 | padding-left: 10px; 15 | } 16 | 17 | /* ============================= */ 18 | /* General Text Formattings */ 19 | /* ============================= */ 20 | body,table,div,p,dl { 21 | font-family:Lucida Grande, Verdana, Geneva, Arial, sans-serif; 22 | font-size:13px; 23 | line-height:1.3; 24 | } 25 | 26 | div.header, div.contents p { 27 | padding-left:12px; 28 | } 29 | 30 | /* ============================= */ 31 | /* API Documentation Formattings */ 32 | /* ============================= */ 33 | div.contents table.memberdecls, .paramname { 34 | font-family:Consolas, Monaco, courier, sans-serif; 35 | font-size:105%; 36 | padding-right:20px; 37 | } 38 | 39 | /* ============================= */ 40 | /* HTML Heading Formattings */ 41 | /* ============================= */ 42 | h1, h2, h3, h4 { 43 | font-family:Lucida Grande, Verdana, Geneva, Arial, sans-serif; 44 | } 45 | 46 | h1 { 47 | font-size:25px; 48 | margin-bottom:10px; 49 | } 50 | 51 | h2 { 52 | color:#42657B; 53 | font-size:17px; 54 | } 55 | 56 | h3 { 57 | font-size:15px; 58 | } 59 | 60 | h4 { 61 | font-size:13px; 62 | } 63 | 64 | /* ============================= */ 65 | /* Code Snippet Formattings */ 66 | /* ============================= */ 67 | span.keyword { 68 | color:#008000; 69 | } 70 | 71 | span.keywordtype { 72 | color:#604020; 73 | } 74 | 75 | span.keywordflow { 76 | color:#e08000; 77 | } 78 | 79 | span.comment { 80 | color:#008000; 81 | } 82 | 83 | span.preprocessor { 84 | color:#806020; 85 | } 86 | 87 | span.stringliteral { 88 | color:#002080; 89 | } 90 | 91 | span.charliteral { 92 | color:#008080; 93 | } 94 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2014. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | # --------------------------------------- 9 | # Makefile for the LUFA library itself. 10 | # --------------------------------------- 11 | 12 | LUFA_VERSION_NUM = $(shell grep LUFA_VERSION_STRING $(LUFA_PATH)/Version.h | cut -d'"' -f2) 13 | EXCLUDE_FROM_EXPORT := Documentation DoxygenPages CodeTemplates Build StudioIntegration doxyfile *.tar *.o *.d *.lss *.lst *.hex *.elf *.hex *.eep *.map *.bin 14 | 15 | # Default target - no default action when attempting to build the core directly 16 | all: 17 | 18 | # Export the library core as a TAR archive for importing into an IDE 19 | export_tar: 20 | @echo Exporting LUFA library to a TAR archive... 21 | @tar -cf LUFA_$(LUFA_VERSION_NUM).tar --directory=. $(EXCLUDE_FROM_EXPORT:%=--exclude=%) * 22 | @tar -cf LUFA_$(LUFA_VERSION_NUM)_Code_Templates.tar CodeTemplates 23 | @echo Export LUFA_$(LUFA_VERSION_NUM).tar complete. 24 | 25 | # Display the LUFA version of this library copy 26 | version: 27 | @echo "LUFA $(LUFA_VERSION_NUM)" 28 | 29 | # Check if this is being included from a legacy or non LUFA build system makefile 30 | ifneq ($(LUFA_PATH),) 31 | LUFA_ROOT_PATH = $(patsubst %/,%,$(LUFA_PATH))/LUFA/ 32 | 33 | include $(patsubst %/,%,$(LUFA_PATH))/LUFA/Build/lufa_sources.mk 34 | else 35 | LUFA_BUILD_MODULES += MASTER 36 | LUFA_BUILD_TARGETS += export_tar version 37 | 38 | LUFA_PATH = . 39 | ARCH = {AVR8,UC3,XMEGA} 40 | DOXYGEN_OVERRIDE_PARAMS = QUIET=YES PROJECT_NUMBER=$(LUFA_VERSION_NUM) 41 | 42 | # Remove all object and associated files from the LUFA library core 43 | clean: 44 | rm -f $(LUFA_SRC_ALL_FILES:%.c=%.o) 45 | rm -f $(LUFA_SRC_ALL_FILES:%.c=%.d) 46 | rm -f $(LUFA_SRC_ALL_FILES:%.c=%.lst) 47 | 48 | include Build/lufa_core.mk 49 | include Build/lufa_sources.mk 50 | include Build/lufa_doxygen.mk 51 | endif 52 | 53 | .PHONY: all export_tar version clean 54 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for BootloaderAPI.c. 34 | */ 35 | 36 | #ifndef _BOOTLOADER_API_H_ 37 | #define _BOOTLOADER_API_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | /* Function Prototypes: */ 47 | void BootloaderAPI_ErasePage(const uint32_t Address); 48 | void BootloaderAPI_WritePage(const uint32_t Address); 49 | void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word); 50 | uint8_t BootloaderAPI_ReadSignature(const uint16_t Address); 51 | uint8_t BootloaderAPI_ReadFuse(const uint16_t Address); 52 | uint8_t BootloaderAPI_ReadLock(void); 53 | void BootloaderAPI_WriteLock(const uint8_t LockBits); 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Version.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * \brief LUFA library version constants. 34 | * 35 | * Version constants for informational purposes and version-specific macro creation. This header file contains the 36 | * current LUFA version number in several forms, for use in the user-application (for example, for printing out 37 | * whilst debugging, or for testing for version compatibility). 38 | */ 39 | 40 | #ifndef __LUFA_VERSION_H__ 41 | #define __LUFA_VERSION_H__ 42 | 43 | /* Public Interface - May be used in end-application: */ 44 | /* Macros: */ 45 | /** Indicates the version number of the library, as an integer. */ 46 | #define LUFA_VERSION_INTEGER 0x140928 47 | 48 | /** Indicates the version number of the library, as a string. */ 49 | #define LUFA_VERSION_STRING "140928" 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/keymap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef KEYMAP_H 19 | #define KEYMAP_H 20 | 21 | #include 22 | #include 23 | #include "action.h" 24 | 25 | 26 | #ifdef BOOTMAGIC_ENABLE 27 | /* NOTE: Not portable. Bit field order depends on implementation */ 28 | typedef union { 29 | uint8_t raw; 30 | struct { 31 | bool swap_control_capslock:1; 32 | bool capslock_to_control:1; 33 | bool swap_lalt_lgui:1; 34 | bool swap_ralt_rgui:1; 35 | bool no_gui:1; 36 | bool swap_grave_esc:1; 37 | bool swap_backslash_backspace:1; 38 | bool nkro:1; 39 | }; 40 | } keymap_config_t; 41 | #endif 42 | 43 | 44 | /* translates key to keycode */ 45 | uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key); 46 | 47 | /* translates Fn keycode to action */ 48 | action_t keymap_fn_to_action(uint8_t keycode); 49 | 50 | 51 | 52 | #ifdef USE_LEGACY_KEYMAP 53 | /* 54 | * Legacy keymap 55 | * Consider using new keymap API above instead. 56 | */ 57 | /* keycode of key */ 58 | __attribute__ ((deprecated)) 59 | uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col); 60 | 61 | /* layer to move during press Fn key */ 62 | __attribute__ ((deprecated)) 63 | uint8_t keymap_fn_layer(uint8_t fn_bits); 64 | 65 | /* keycode to send when release Fn key without using */ 66 | __attribute__ ((deprecated)) 67 | uint8_t keymap_fn_keycode(uint8_t fn_bits); 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/mousekey.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef MOUSEKEY_H 19 | #define MOUSEKEY_H 20 | 21 | #include 22 | #include "host.h" 23 | 24 | 25 | /* max value on report descriptor */ 26 | #define MOUSEKEY_MOVE_MAX 127 27 | #define MOUSEKEY_WHEEL_MAX 127 28 | 29 | #ifndef MOUSEKEY_MOVE_DELTA 30 | #define MOUSEKEY_MOVE_DELTA 5 31 | #endif 32 | #ifndef MOUSEKEY_WHEEL_DELTA 33 | #define MOUSEKEY_WHEEL_DELTA 1 34 | #endif 35 | #ifndef MOUSEKEY_DELAY 36 | #define MOUSEKEY_DELAY 300 37 | #endif 38 | #ifndef MOUSEKEY_INTERVAL 39 | #define MOUSEKEY_INTERVAL 50 40 | #endif 41 | #ifndef MOUSEKEY_MAX_SPEED 42 | #define MOUSEKEY_MAX_SPEED 10 43 | #endif 44 | #ifndef MOUSEKEY_TIME_TO_MAX 45 | #define MOUSEKEY_TIME_TO_MAX 20 46 | #endif 47 | #ifndef MOUSEKEY_WHEEL_MAX_SPEED 48 | #define MOUSEKEY_WHEEL_MAX_SPEED 8 49 | #endif 50 | #ifndef MOUSEKEY_WHEEL_TIME_TO_MAX 51 | #define MOUSEKEY_WHEEL_TIME_TO_MAX 40 52 | #endif 53 | 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | extern uint8_t mk_delay; 60 | extern uint8_t mk_interval; 61 | extern uint8_t mk_max_speed; 62 | extern uint8_t mk_time_to_max; 63 | extern uint8_t mk_wheel_max_speed; 64 | extern uint8_t mk_wheel_time_to_max; 65 | 66 | 67 | void mousekey_task(void); 68 | void mousekey_on(uint8_t code); 69 | void mousekey_off(uint8_t code); 70 | void mousekey_clear(void); 71 | void mousekey_send(void); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef MATRIX_H 19 | #define MATRIX_H 20 | 21 | #include 22 | #include 23 | 24 | 25 | #if (MATRIX_COLS <= 8) 26 | typedef uint8_t matrix_row_t; 27 | #elif (MATRIX_COLS <= 16) 28 | typedef uint16_t matrix_row_t; 29 | #elif (MATRIX_COLS <= 32) 30 | typedef uint32_t matrix_row_t; 31 | #else 32 | #error "MATRIX_COLS: invalid value" 33 | #endif 34 | 35 | #define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | #include "Config/AppConfig.h" 47 | 48 | /* Function Prototypes: */ 49 | void BootloaderAPI_ErasePage(const uint32_t Address); 50 | void BootloaderAPI_WritePage(const uint32_t Address); 51 | void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word); 52 | uint8_t BootloaderAPI_ReadSignature(const uint16_t Address); 53 | uint8_t BootloaderAPI_ReadFuse(const uint16_t Address); 54 | uint8_t BootloaderAPI_ReadLock(void); 55 | void BootloaderAPI_WriteLock(const uint8_t LockBits); 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderAPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for BootloaderAPI.c. 34 | */ 35 | 36 | #ifndef _BOOTLOADER_API_H_ 37 | #define _BOOTLOADER_API_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | #include "Config/AppConfig.h" 47 | 48 | /* Function Prototypes: */ 49 | void BootloaderAPI_ErasePage(const uint32_t Address); 50 | void BootloaderAPI_WritePage(const uint32_t Address); 51 | void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word); 52 | uint8_t BootloaderAPI_ReadSignature(const uint16_t Address); 53 | uint8_t BootloaderAPI_ReadFuse(const uint16_t Address); 54 | uint8_t BootloaderAPI_ReadLock(void); 55 | void BootloaderAPI_WriteLock(const uint8_t LockBits); 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | Template for a LUFA USB device mode application. 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/WindowsINF/LUFA RNDIS.inf: -------------------------------------------------------------------------------- 1 | ; Windows LUFA RNDIS Setup File 2 | ; Copyright (c) 2000 Microsoft Corporation 3 | 4 | [DefaultInstall] 5 | CopyINF="LUFA RNDIS.inf" 6 | 7 | [Version] 8 | Signature="$Windows NT$" 9 | Class=Net 10 | ClassGuid={4d36e972-e325-11ce-bfc1-08002be10318} 11 | Provider=%MFGNAME% 12 | DriverVer=7/1/2012,10.0.0.0 13 | 14 | [Manufacturer] 15 | %MFGNAME%=DeviceList, NTx86, NTamd64, NTia64 16 | 17 | [ControlFlags] 18 | ExcludeFromSelect=* 19 | 20 | [DriverInstall] 21 | Characteristics=0x84 ; NCF_PHYSICAL + NCF_HAS_UI 22 | BusType=15 23 | include=netrndis.inf 24 | needs=Usb_Rndis.ndi 25 | AddReg=Rndis_AddReg_Vista 26 | 27 | [DriverInstall.Services] 28 | include=netrndis.inf 29 | needs=Usb_Rndis.ndi.Services 30 | 31 | ;------------------------------------------------------------------------------ 32 | ; Vendor and Product ID Definitions 33 | ;------------------------------------------------------------------------------ 34 | ; When developing your USB device, the VID and PID used in the PC side 35 | ; application program and the firmware on the microcontroller must match. 36 | ; Modify the below line to use your VID and PID. Use the format as shown below. 37 | ; Note: One INF file can be used for multiple devices with different VID and PIDs. 38 | ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. 39 | ;------------------------------------------------------------------------------ 40 | [DeviceList] 41 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204C 42 | 43 | [DeviceList.NTx86] 44 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204C 45 | 46 | [DeviceList.NTamd64] 47 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204C 48 | 49 | [DeviceList.NTia64] 50 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204C 51 | 52 | ;------------------------------------------------------------------------------ 53 | ; String Definitions 54 | ;------------------------------------------------------------------------------ 55 | ;Modify these strings to customize your device 56 | ;------------------------------------------------------------------------------ 57 | [Strings] 58 | MFGNAME="http://www.lufa-lib.org" 59 | DESCRIPTION="LUFA RNDIS USB Ethernet Adapter" 60 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/LicenseInfo.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** 8 | * \page Page_LicenseInfo Source Code License 9 | * 10 | * The LUFA library is currently released under the MIT license, included below. 11 | * 12 | * \section Sec_LicenseForHumans License Summary for Human Beings 13 | * Everyone is free to use LUFA without payment - even in commercial applications 14 | * where the product source code is not publicly disclosed. However, use of the 15 | * library must be in accordance with the library license conditions. 16 | * 17 | * If you wish to use LUFA without payment, you must include a copy of the 18 | * full license text below with your product or project - on your website, and in 19 | * an accompanying manual or other materials for the product. As long as the entire 20 | * license text is made available and obvious to the users of your product, you 21 | * are free to incorporate the LUFA library into your product without special 22 | * additional licensing. 23 | * 24 | * \section Sec_CommercialLicenses Commercial Licensing 25 | * In some instances the small requirement for public disclosure of LUFA within a 26 | * product is unwanted; in these instances a commercial license is offered up as an 27 | * alternative to the standard LUFA license. 28 | * 29 | * Commercial entities can opt out of the public disclosure clause in this license 30 | * for a one-time US$1500 payment. This provides a non-exclusive modified MIT 31 | * licensed which allows for the free use of the LUFA library, bootloaders and 32 | * (where the sole copyright is attributed to Dean Camera) demos without public 33 | * disclosure within an organization, in addition to three free hours of consultation 34 | * with the library author, and priority support. 35 | * 36 | * Please visit the Commercial License link on \ref Page_Resources for more information on 37 | * ordering a commercial license for your company. 38 | * 39 | * \section Sec_LicenseText LUFA License Text 40 | * 41 | * \verbinclude License.txt 42 | */ 43 | 44 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/ProgrammingApps.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_ProgrammingApps Programming an Application into a USB AVR 8 | * 9 | * Once you have built an application, you will need a way to program in the resulting ".HEX" file (and, if your 10 | * application uses EEPROM variables with initial values, also a ".EEP" file) into your USB AVR. Normally, the 11 | * reprogramming of an AVR device must be performed using a special piece of programming hardware, through one of the 12 | * supported AVR programming protocols - ISP, HVSP, HVPP, JTAG, dW or PDI. This can be done through a custom programmer, 13 | * a third party programmer, or an official Atmel AVR tool - for more information, see the atmel.com website. 14 | * 15 | * Alternatively, you can use the bootloader. From the Atmel factory, each USB AVR comes preloaded with the Atmel 16 | * DFU (Device Firmware Update) class bootloader, a small piece of AVR firmware which allows the remainder of the 17 | * AVR to be programmed through a non-standard interface such as the serial USART port, SPI, or (in this case) USB. 18 | * Bootloaders have the advantage of not requiring any special hardware for programming, and cannot usually be erased 19 | * or broken without an external programming device. They have disadvantages however; they cannot change the fuses of 20 | * the AVR (special configuration settings that control the operation of the chip itself) and a small portion of the 21 | * AVR's FLASH program memory must be reserved to contain the bootloader firmware, and thus cannot be used by the 22 | * loaded application. 23 | * 24 | * If you wish to use the DFU bootloader to program in your application, refer to your DFU programmer's documentation. 25 | * Atmel provides a free utility called FLIP which is USB AVR compatible, and an open source (Linux compatible) 26 | * alternative exists called "dfu-programmer". 27 | * 28 | * \see \ref Page_BuildModule_DFU for information on the LUFA build system DFU module, for automatic DFU bootloader 29 | * programming makefile targets. 30 | */ 31 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/action_layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #ifndef ACTION_LAYER_H 18 | #define ACTION_LAYER_H 19 | 20 | #include 21 | #include "keyboard.h" 22 | #include "action.h" 23 | 24 | 25 | /* 26 | * Default Layer 27 | */ 28 | extern uint32_t default_layer_state; 29 | void default_layer_debug(void); 30 | void default_layer_set(uint32_t state); 31 | 32 | #ifndef NO_ACTION_LAYER 33 | /* bitwise operation */ 34 | void default_layer_or(uint32_t state); 35 | void default_layer_and(uint32_t state); 36 | void default_layer_xor(uint32_t state); 37 | #else 38 | #define default_layer_or(state) 39 | #define default_layer_and(state) 40 | #define default_layer_xor(state) 41 | #endif 42 | 43 | 44 | /* 45 | * Keymap Layer 46 | */ 47 | #ifndef NO_ACTION_LAYER 48 | extern uint32_t layer_state; 49 | void layer_debug(void); 50 | void layer_clear(void); 51 | void layer_move(uint8_t layer); 52 | void layer_on(uint8_t layer); 53 | void layer_off(uint8_t layer); 54 | void layer_invert(uint8_t layer); 55 | /* bitwise operation */ 56 | void layer_or(uint32_t state); 57 | void layer_and(uint32_t state); 58 | void layer_xor(uint32_t state); 59 | #else 60 | #define layer_state 0 61 | #define layer_clear() 62 | #define layer_move(layer) 63 | #define layer_on(layer) 64 | #define layer_off(layer) 65 | #define layer_invert(layer) 66 | 67 | #define layer_or(state) 68 | #define layer_and(state) 69 | #define layer_xor(state) 70 | #define layer_debug() 71 | #endif 72 | 73 | 74 | /* return action depending on current layer status */ 75 | action_t layer_switch_get_action(keypos_t key); 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for Descriptors.c. 34 | */ 35 | 36 | #ifndef _DESCRIPTORS_H_ 37 | #define _DESCRIPTORS_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | 42 | /* Macros: */ 43 | #if (defined(ARCH_HAS_MULTI_ADDRESS_SPACE) && \ 44 | !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))) 45 | #define HAS_MULTIPLE_DESCRIPTOR_ADDRESS_SPACES 46 | #endif 47 | 48 | /* Type Defines: */ 49 | /** Type define for the device configuration descriptor structure. This must be defined in the 50 | * application code, as the configuration descriptor contains several sub-descriptors which 51 | * vary between devices, and which describe the device's usage to the host. 52 | */ 53 | typedef struct 54 | { 55 | USB_Descriptor_Configuration_Header_t Config; 56 | } USB_Descriptor_Configuration_t; 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Platform/UC3/InterruptManagement.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | #include "../../Common/Common.h" 32 | #if (ARCH == ARCH_UC3) 33 | 34 | #define __INCLUDE_FROM_INTMANAGEMENT_C 35 | #include "InterruptManagement.h" 36 | 37 | /** Interrupt vector table, containing the ISR to call for each interrupt group */ 38 | InterruptHandlerPtr_t InterruptHandlers[AVR32_INTC_NUM_INT_GRPS]; 39 | 40 | /** ISR for unhandled interrupt groups */ 41 | ISR(Unhandled_Interrupt) 42 | { 43 | for (;;); 44 | } 45 | 46 | InterruptHandlerPtr_t INTC_GetInterruptHandler(const uint_reg_t InterruptLevel) 47 | { 48 | return InterruptHandlers[AVR32_INTC.icr[AVR32_INTC_INT3 - InterruptLevel]]; 49 | } 50 | 51 | void INTC_Init(void) 52 | { 53 | for (uint8_t InterruptGroup = 0; InterruptGroup < AVR32_INTC_NUM_INT_GRPS; InterruptGroup++) 54 | { 55 | InterruptHandlers[InterruptGroup] = Unhandled_Interrupt; 56 | AVR32_INTC.ipr[InterruptGroup] = Autovector_Table[AVR32_INTC_INT0]; 57 | } 58 | 59 | __builtin_mtsr(AVR32_EVBA, (uintptr_t)&EVBA_Table); 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for BootloaderAPI.c. 34 | */ 35 | 36 | #ifndef _BOOTLOADER_API_H_ 37 | #define _BOOTLOADER_API_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | /* Macros: */ 47 | #if AUX_BOOT_SECTION_SIZE > 0 48 | #define AUX_BOOT_SECTION __attribute__((section(".boot_aux"))) 49 | #else 50 | #define AUX_BOOT_SECTION 51 | #endif 52 | 53 | /* Function Prototypes: */ 54 | void BootloaderAPI_ErasePage(const uint32_t Address); 55 | void BootloaderAPI_WritePage(const uint32_t Address); 56 | void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word); 57 | uint8_t BootloaderAPI_ReadSignature(const uint16_t Address); 58 | uint8_t BootloaderAPI_ReadFuse(const uint16_t Address); 59 | uint8_t BootloaderAPI_ReadLock(void); 60 | void BootloaderAPI_WriteLock(const uint8_t LockBits); 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/GettingStarted.txt: -------------------------------------------------------------------------------- 1 | /** \file 2 | * 3 | * This file contains special DoxyGen information for the generation of the main page and other special 4 | * documentation pages. It is not a project source file. 5 | */ 6 | 7 | /** \page Page_GettingStarted Getting Started 8 | * 9 | * Getting started with LUFA is easy; read the content below to get on your way to your first LUFA powered application. 10 | * 11 | * \section Sec_DemosOverview The LUFA Demo Applications 12 | * 13 | * Out of the box, LUFA contains a large number of pre-made class demos for you to test, experiment with and 14 | * ultimately build upon for your own projects. All the demos (where possible) come pre-configured to build and 15 | * run correctly on the AT90USB1287 AVR microcontroller, mounted on the Atmel USBKEY board and running at an 8MHz 16 | * master clock. This is due to two reasons; one, it is the hardware the author possesses, and two, it is the most 17 | * popular Atmel USB demonstration board to date. To learn how to reconfigure, recompile and program the included 18 | * LUFA applications using different settings, see the subsections below. 19 | * 20 | * \section Sec_ClassOrLowLevel Class Driver and Low Level Demos 21 | * 22 | * Most of the included demos in the /Demos/ folder come in both ClassDriver and LowLevel varieties. If you are new 23 | * to LUFA, it is highly recommended that you look at the ClassDriver versions first, which use the pre-made USB 24 | * Class Drivers (\ref Group_USBClassDrivers) to simplify the use of the standard USB classes in user applications. 25 | * These demos give a basic but easy to use interface to the USB class used in the demo application, such as HID or 26 | * CDC. 27 | * 28 | * Those needing absolute control over the class implementation can look at the LowLevel demos, which implement the 29 | * required USB class directly in the demo application using the lowest level LUFA APIs. 30 | * 31 | * 32 | * Subsections: 33 | * \li \subpage Page_ConfiguringApps - How to Configure the Included Demos, Projects and Bootloaders 34 | * \li \subpage Page_CompilingApps - How to Compile the Included Demos, Projects and Bootloaders 35 | * \li \subpage Page_ProgrammingApps - How to Program an AVR with the Included Demos, Projects and Bootloaders 36 | */ 37 | 38 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /www/js/filesaver.min.js: -------------------------------------------------------------------------------- 1 | /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ 2 | var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/constructor/i.test(e.HTMLElement),f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},d="application/octet-stream",s=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,s)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(i){u(i)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,s){if(!s){t=p(t)}var v=this,w=t.type,m=w===d,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&a)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;i(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define([],function(){return saveAs})} 3 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/WindowsINF/LUFA CDC-ACM.inf: -------------------------------------------------------------------------------- 1 | ; Windows LUFA CDC ACM Setup File 2 | ; Copyright (c) 2000 Microsoft Corporation 3 | 4 | [DefaultInstall] 5 | CopyINF="LUFA CDC-ACM.inf" 6 | 7 | [Version] 8 | Signature="$Windows NT$" 9 | Class=Ports 10 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 11 | Provider=%MFGNAME% 12 | DriverVer=7/1/2012,10.0.0.0 13 | 14 | [Manufacturer] 15 | %MFGNAME%=DeviceList, NTx86, NTamd64, NTia64 16 | 17 | [SourceDisksNames] 18 | 19 | [SourceDisksFiles] 20 | 21 | [DestinationDirs] 22 | DefaultDestDir=12 23 | 24 | [DriverInstall] 25 | Include=mdmcpq.inf 26 | CopyFiles=FakeModemCopyFileSection 27 | AddReg=DriverInstall.AddReg 28 | 29 | [DriverInstall.Services] 30 | Include=mdmcpq.inf 31 | AddService=usbser, 0x00000002, LowerFilter_Service_Inst 32 | 33 | [DriverInstall.AddReg] 34 | HKR,,EnumPropPages32,,"msports.dll,SerialPortPropPageProvider" 35 | 36 | ;------------------------------------------------------------------------------ 37 | ; Vendor and Product ID Definitions 38 | ;------------------------------------------------------------------------------ 39 | ; When developing your USB device, the VID and PID used in the PC side 40 | ; application program and the firmware on the microcontroller must match. 41 | ; Modify the below line to use your VID and PID. Use the format as shown below. 42 | ; Note: One INF file can be used for multiple devices with different VID and PIDs. 43 | ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. 44 | ;------------------------------------------------------------------------------ 45 | [DeviceList] 46 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 47 | 48 | [DeviceList.NTx86] 49 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 50 | 51 | [DeviceList.NTamd64] 52 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 53 | 54 | [DeviceList.NTia64] 55 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 56 | 57 | ;------------------------------------------------------------------------------ 58 | ; String Definitions 59 | ;------------------------------------------------------------------------------ 60 | ;Modify these strings to customize your device 61 | ;------------------------------------------------------------------------------ 62 | [Strings] 63 | MFGNAME="http://www.lufa-lib.org" 64 | DESCRIPTION="LUFA CDC-ACM Virtual Serial Port" 65 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderAPI.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Bootloader user application API functions. 34 | */ 35 | 36 | #include "BootloaderAPI.h" 37 | 38 | void BootloaderAPI_ErasePage(const uint32_t Address) 39 | { 40 | boot_page_erase_safe(Address); 41 | boot_spm_busy_wait(); 42 | boot_rww_enable(); 43 | } 44 | 45 | void BootloaderAPI_WritePage(const uint32_t Address) 46 | { 47 | boot_page_write_safe(Address); 48 | boot_spm_busy_wait(); 49 | boot_rww_enable(); 50 | } 51 | 52 | void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word) 53 | { 54 | boot_page_fill_safe(Address, Word); 55 | } 56 | 57 | uint8_t BootloaderAPI_ReadSignature(const uint16_t Address) 58 | { 59 | return boot_signature_byte_get(Address); 60 | } 61 | 62 | uint8_t BootloaderAPI_ReadFuse(const uint16_t Address) 63 | { 64 | return boot_lock_fuse_bits_get(Address); 65 | } 66 | 67 | uint8_t BootloaderAPI_ReadLock(void) 68 | { 69 | return boot_lock_fuse_bits_get(GET_LOCK_BITS); 70 | } 71 | 72 | void BootloaderAPI_WriteLock(const uint8_t LockBits) 73 | { 74 | boot_lock_bits_set_safe(LockBits); 75 | } 76 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderAPI.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Bootloader user application API functions. 34 | */ 35 | 36 | #include "BootloaderAPI.h" 37 | 38 | void BootloaderAPI_ErasePage(const uint32_t Address) 39 | { 40 | boot_page_erase_safe(Address); 41 | boot_spm_busy_wait(); 42 | boot_rww_enable(); 43 | } 44 | 45 | void BootloaderAPI_WritePage(const uint32_t Address) 46 | { 47 | boot_page_write_safe(Address); 48 | boot_spm_busy_wait(); 49 | boot_rww_enable(); 50 | } 51 | 52 | void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word) 53 | { 54 | boot_page_fill_safe(Address, Word); 55 | } 56 | 57 | uint8_t BootloaderAPI_ReadSignature(const uint16_t Address) 58 | { 59 | return boot_signature_byte_get(Address); 60 | } 61 | 62 | uint8_t BootloaderAPI_ReadFuse(const uint16_t Address) 63 | { 64 | return boot_lock_fuse_bits_get(Address); 65 | } 66 | 67 | uint8_t BootloaderAPI_ReadLock(void) 68 | { 69 | return boot_lock_fuse_bits_get(GET_LOCK_BITS); 70 | } 71 | 72 | void BootloaderAPI_WriteLock(const uint8_t LockBits) 73 | { 74 | boot_lock_bits_set_safe(LockBits); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPI.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Bootloader user application API functions. 34 | */ 35 | 36 | #include "BootloaderAPI.h" 37 | 38 | void BootloaderAPI_ErasePage(const uint32_t Address) 39 | { 40 | boot_page_erase_safe(Address); 41 | boot_spm_busy_wait(); 42 | boot_rww_enable(); 43 | } 44 | 45 | void BootloaderAPI_WritePage(const uint32_t Address) 46 | { 47 | boot_page_write_safe(Address); 48 | boot_spm_busy_wait(); 49 | boot_rww_enable(); 50 | } 51 | 52 | void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word) 53 | { 54 | boot_page_fill_safe(Address, Word); 55 | } 56 | 57 | uint8_t BootloaderAPI_ReadSignature(const uint16_t Address) 58 | { 59 | return boot_signature_byte_get(Address); 60 | } 61 | 62 | uint8_t BootloaderAPI_ReadFuse(const uint16_t Address) 63 | { 64 | return boot_lock_fuse_bits_get(Address); 65 | } 66 | 67 | uint8_t BootloaderAPI_ReadLock(void) 68 | { 69 | return boot_lock_fuse_bits_get(GET_LOCK_BITS); 70 | } 71 | 72 | void BootloaderAPI_WriteLock(const uint8_t LockBits) 73 | { 74 | boot_lock_bits_set_safe(LockBits); 75 | } 76 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPI.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Bootloader user application API functions. 34 | */ 35 | 36 | #include "BootloaderAPI.h" 37 | 38 | void BootloaderAPI_ErasePage(const uint32_t Address) 39 | { 40 | boot_page_erase_safe(Address); 41 | boot_spm_busy_wait(); 42 | boot_rww_enable(); 43 | } 44 | 45 | void BootloaderAPI_WritePage(const uint32_t Address) 46 | { 47 | boot_page_write_safe(Address); 48 | boot_spm_busy_wait(); 49 | boot_rww_enable(); 50 | } 51 | 52 | void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word) 53 | { 54 | boot_page_fill_safe(Address, Word); 55 | } 56 | 57 | uint8_t BootloaderAPI_ReadSignature(const uint16_t Address) 58 | { 59 | return boot_signature_byte_get(Address); 60 | } 61 | 62 | uint8_t BootloaderAPI_ReadFuse(const uint16_t Address) 63 | { 64 | return boot_lock_fuse_bits_get(Address); 65 | } 66 | 67 | uint8_t BootloaderAPI_ReadLock(void) 68 | { 69 | return boot_lock_fuse_bits_get(GET_LOCK_BITS); 70 | } 71 | 72 | void BootloaderAPI_WriteLock(const uint8_t LockBits) 73 | { 74 | boot_lock_bits_set_safe(LockBits); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class_si.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Common definitions and Host mode implementation of the Still Image USB class. 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Common definitions only (no implementations) of the Still Image USB class. 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/action.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012,2013 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #ifndef ACTION_H 18 | #define ACTION_H 19 | 20 | #include 21 | #include 22 | #include "keyboard.h" 23 | #include "keycode.h" 24 | #include "action_code.h" 25 | #include "action_macro.h" 26 | 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /* tapping count and state */ 33 | typedef struct { 34 | bool interrupted :1; 35 | bool reserved2 :1; 36 | bool reserved1 :1; 37 | bool reserved0 :1; 38 | uint8_t count :4; 39 | } tap_t; 40 | 41 | /* Key event container for recording */ 42 | typedef struct { 43 | keyevent_t event; 44 | #ifndef NO_ACTION_TAPPING 45 | tap_t tap; 46 | #endif 47 | } keyrecord_t; 48 | 49 | /* Execute action per keyevent */ 50 | void action_exec(keyevent_t event); 51 | 52 | /* action for key */ 53 | action_t action_for_key(uint8_t layer, keypos_t key); 54 | 55 | /* macro */ 56 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); 57 | 58 | /* user defined special function */ 59 | void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); 60 | 61 | /* Utilities for actions. */ 62 | void process_action(keyrecord_t *record); 63 | void register_code(uint8_t code); 64 | void unregister_code(uint8_t code); 65 | void register_mods(uint8_t mods); 66 | void unregister_mods(uint8_t mods); 67 | //void set_mods(uint8_t mods); 68 | void clear_keyboard(void); 69 | void clear_keyboard_but_mods(void); 70 | void layer_switch(uint8_t new_layer); 71 | bool is_tap_key(keypos_t key); 72 | 73 | /* debug */ 74 | void debug_event(keyevent_t event); 75 | void debug_record(keyrecord_t record); 76 | void debug_action(action_t action); 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif /* ACTION_H */ 83 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/LUFA CDC Bootloader.inf: -------------------------------------------------------------------------------- 1 | ;************************************************************ 2 | ; Windows USB CDC ACM Setup File 3 | ; Copyright (c) 2000 Microsoft Corporation 4 | ;************************************************************ 5 | 6 | [DefaultInstall] 7 | CopyINF="LUFA CDC Bootloader.inf" 8 | 9 | [Version] 10 | Signature="$Windows NT$" 11 | Class=Ports 12 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 13 | Provider=%MFGNAME% 14 | DriverVer=7/1/2012,10.0.0.0 15 | 16 | [Manufacturer] 17 | %MFGNAME%=DeviceList, NTx86, NTamd64, NTia64 18 | 19 | [SourceDisksNames] 20 | 21 | [SourceDisksFiles] 22 | 23 | [DestinationDirs] 24 | DefaultDestDir=12 25 | 26 | [DriverInstall] 27 | Include=mdmcpq.inf 28 | CopyFiles=FakeModemCopyFileSection 29 | AddReg=DriverInstall.AddReg 30 | 31 | [DriverInstall.Services] 32 | Include=mdmcpq.inf 33 | AddService=usbser, 0x00000002, LowerFilter_Service_Inst 34 | 35 | [DriverInstall.AddReg] 36 | HKR,,EnumPropPages32,,"msports.dll,SerialPortPropPageProvider" 37 | 38 | ;------------------------------------------------------------------------------ 39 | ; Vendor and Product ID Definitions 40 | ;------------------------------------------------------------------------------ 41 | ; When developing your USB device, the VID and PID used in the PC side 42 | ; application program and the firmware on the microcontroller must match. 43 | ; Modify the below line to use your VID and PID. Use the format as shown below. 44 | ; Note: One INF file can be used for multiple devices with different VID and PIDs. 45 | ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. 46 | ;------------------------------------------------------------------------------ 47 | [DeviceList] 48 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A 49 | 50 | [DeviceList.NTx86] 51 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A 52 | 53 | [DeviceList.NTamd64] 54 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A 55 | 56 | [DeviceList.NTia64] 57 | %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A 58 | 59 | ;------------------------------------------------------------------------------ 60 | ; String Definitions 61 | ;------------------------------------------------------------------------------ 62 | ;Modify these strings to customize your device 63 | ;------------------------------------------------------------------------------ 64 | [Strings] 65 | MFGNAME="http://www.lufa-lib.org" 66 | DESCRIPTION="LUFA CDC Class Bootloader" 67 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class_android.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Common definitions and Host mode implementation of the Android Open Accessory USB class. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Common definitions only (no implementations) of the Android Open Accessory USB class. 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/keyboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011,2012,2013 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef KEYBOARD_H 19 | #define KEYBOARD_H 20 | 21 | #include 22 | #include 23 | 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* key matrix position */ 30 | typedef struct { 31 | uint8_t col; 32 | uint8_t row; 33 | } keypos_t; 34 | 35 | /* key event */ 36 | typedef struct { 37 | keypos_t key; 38 | bool pressed; 39 | uint16_t time; 40 | } keyevent_t; 41 | 42 | /* equivalent test of keypos_t */ 43 | #define KEYEQ(keya, keyb) ((keya).row == (keyb).row && (keya).col == (keyb).col) 44 | 45 | /* Rules for No Event: 46 | * 1) (time == 0) to handle (keyevent_t){} as empty event 47 | * 2) Matrix(255, 255) to make TICK event available 48 | */ 49 | static inline bool IS_NOEVENT(keyevent_t event) { return event.time == 0 || (event.key.row == 255 && event.key.col == 255); } 50 | static inline bool IS_PRESSED(keyevent_t event) { return (!IS_NOEVENT(event) && event.pressed); } 51 | static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) && !event.pressed); } 52 | 53 | /* Tick event */ 54 | #define TICK (keyevent_t){ \ 55 | .key = (keypos_t){ .row = 255, .col = 255 }, \ 56 | .pressed = false, \ 57 | .time = (timer_read() | 1) \ 58 | } 59 | 60 | 61 | /* it runs once at early stage of startup before keyboard_init. */ 62 | void keyboard_setup(void); 63 | /* it runs once after initializing host side protocol, debug and MCU peripherals. */ 64 | void keyboard_init(void); 65 | /* it runs repeatedly in main loop */ 66 | void keyboard_task(void); 67 | /* it runs when host LED status is updated */ 68 | void keyboard_set_leds(uint8_t leds); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common.mk: -------------------------------------------------------------------------------- 1 | COMMON_DIR = common 2 | SRC += $(COMMON_DIR)/host.c \ 3 | $(COMMON_DIR)/keyboard.c \ 4 | $(COMMON_DIR)/action.c \ 5 | $(COMMON_DIR)/action_tapping.c \ 6 | $(COMMON_DIR)/action_macro.c \ 7 | $(COMMON_DIR)/action_layer.c \ 8 | $(COMMON_DIR)/action_util.c \ 9 | $(COMMON_DIR)/print.c \ 10 | $(COMMON_DIR)/debug.c \ 11 | $(COMMON_DIR)/util.c \ 12 | $(COMMON_DIR)/hook.c \ 13 | $(COMMON_DIR)/avr/suspend.c \ 14 | $(COMMON_DIR)/avr/xprintf.S \ 15 | $(COMMON_DIR)/avr/timer.c \ 16 | $(COMMON_DIR)/avr/bootloader.c 17 | 18 | 19 | # Option modules 20 | ifdef ACTIONMAP_ENABLE 21 | SRC += $(COMMON_DIR)/actionmap.c 22 | OPT_DEFS += -DACTIONMAP_ENABLE 23 | else 24 | SRC += $(COMMON_DIR)/keymap.c 25 | endif 26 | 27 | ifdef BOOTMAGIC_ENABLE 28 | SRC += $(COMMON_DIR)/bootmagic.c 29 | SRC += $(COMMON_DIR)/avr/eeconfig.c 30 | OPT_DEFS += -DBOOTMAGIC_ENABLE 31 | endif 32 | 33 | ifdef MOUSEKEY_ENABLE 34 | SRC += $(COMMON_DIR)/mousekey.c 35 | OPT_DEFS += -DMOUSEKEY_ENABLE 36 | OPT_DEFS += -DMOUSE_ENABLE 37 | endif 38 | 39 | ifdef EXTRAKEY_ENABLE 40 | OPT_DEFS += -DEXTRAKEY_ENABLE 41 | endif 42 | 43 | ifdef CONSOLE_ENABLE 44 | OPT_DEFS += -DCONSOLE_ENABLE 45 | else 46 | OPT_DEFS += -DNO_PRINT 47 | OPT_DEFS += -DNO_DEBUG 48 | endif 49 | 50 | ifdef COMMAND_ENABLE 51 | SRC += $(COMMON_DIR)/command.c 52 | OPT_DEFS += -DCOMMAND_ENABLE 53 | endif 54 | 55 | ifdef NKRO_ENABLE 56 | OPT_DEFS += -DNKRO_ENABLE 57 | endif 58 | 59 | ifdef USB_6KRO_ENABLE 60 | OPT_DEFS += -DUSB_6KRO_ENABLE 61 | endif 62 | 63 | ifdef KEYBOARD_LOCK_ENABLE 64 | OPT_DEFS += -DKEYBOARD_LOCK_ENABLE 65 | endif 66 | 67 | ifdef SLEEP_LED_ENABLE 68 | SRC += $(COMMON_DIR)/avr/sleep_led.c 69 | OPT_DEFS += -DSLEEP_LED_ENABLE 70 | OPT_DEFS += -DNO_SUSPEND_POWER_DOWN 71 | endif 72 | 73 | ifdef BACKLIGHT_ENABLE 74 | SRC += $(COMMON_DIR)/backlight.c 75 | OPT_DEFS += -DBACKLIGHT_ENABLE 76 | endif 77 | 78 | ifdef KEYMAP_SECTION_ENABLE 79 | OPT_DEFS += -DKEYMAP_SECTION_ENABLE 80 | 81 | ifeq ($(strip $(MCU)),atmega32u2) 82 | EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x 83 | else ifeq ($(strip $(MCU)),atmega32u4) 84 | EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x 85 | else 86 | EXTRALDFLAGS = $(error no ldscript for keymap section) 87 | endif 88 | endif 89 | 90 | # Version string 91 | VERSION := $(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null) 92 | OPT_DEFS += -DVERSION=$(VERSION) 93 | 94 | 95 | # Search Path 96 | VPATH += $(TMK_DIR)/common 97 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2014. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | # -------------------------------------- 9 | # LUFA Project Makefile. 10 | # -------------------------------------- 11 | 12 | # Run "make help" for target help. 13 | 14 | MCU = at90usb1287 15 | ARCH = AVR8 16 | BOARD = USBKEY 17 | F_CPU = 8000000 18 | F_USB = $(F_CPU) 19 | OPTIMIZATION = s 20 | TARGET = BootloaderCDC 21 | SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) 22 | LUFA_PATH = ../../LUFA 23 | CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) 24 | LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) 25 | 26 | # Flash size and bootloader section sizes of the target, in KB. These must 27 | # match the target's total FLASH size and the bootloader size set in the 28 | # device's fuses. 29 | FLASH_SIZE_KB = 128 30 | BOOT_SECTION_SIZE_KB = 8 31 | 32 | # Bootloader address calculation formulas 33 | # Do not modify these macros, but rather modify the dependent values above. 34 | CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) 35 | BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) 36 | BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) 37 | 38 | # Bootloader linker section flags for relocating the API table sections to 39 | # known FLASH addresses - these should not normally be user-edited. 40 | BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) 41 | BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) 42 | BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) 43 | BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) 44 | 45 | # Default target 46 | all: 47 | 48 | # Include LUFA build script makefiles 49 | include $(LUFA_PATH)/Build/lufa_core.mk 50 | include $(LUFA_PATH)/Build/lufa_sources.mk 51 | include $(LUFA_PATH)/Build/lufa_build.mk 52 | include $(LUFA_PATH)/Build/lufa_cppcheck.mk 53 | include $(LUFA_PATH)/Build/lufa_doxygen.mk 54 | include $(LUFA_PATH)/Build/lufa_avrdude.mk 55 | include $(LUFA_PATH)/Build/lufa_atprogram.mk 56 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # LUFA Library 3 | # Copyright (C) Dean Camera, 2014. 4 | # 5 | # dean [at] fourwalledcubicle [dot] com 6 | # www.lufa-lib.org 7 | # 8 | # -------------------------------------- 9 | # LUFA Project Makefile. 10 | # -------------------------------------- 11 | 12 | # Run "make help" for target help. 13 | 14 | MCU = at90usb1287 15 | ARCH = AVR8 16 | BOARD = USBKEY 17 | F_CPU = 8000000 18 | F_USB = $(F_CPU) 19 | OPTIMIZATION = s 20 | TARGET = BootloaderDFU 21 | SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) 22 | LUFA_PATH = ../../LUFA 23 | CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) 24 | LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) 25 | 26 | # Flash size and bootloader section sizes of the target, in KB. These must 27 | # match the target's total FLASH size and the bootloader size set in the 28 | # device's fuses. 29 | FLASH_SIZE_KB = 128 30 | BOOT_SECTION_SIZE_KB = 8 31 | 32 | # Bootloader address calculation formulas 33 | # Do not modify these macros, but rather modify the dependent values above. 34 | CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) 35 | BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) 36 | BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) 37 | 38 | # Bootloader linker section flags for relocating the API table sections to 39 | # known FLASH addresses - these should not normally be user-edited. 40 | BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) 41 | BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) 42 | BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) 43 | BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) 44 | 45 | # Default target 46 | all: 47 | 48 | # Include LUFA build script makefiles 49 | include $(LUFA_PATH)/Build/lufa_core.mk 50 | include $(LUFA_PATH)/Build/lufa_sources.mk 51 | include $(LUFA_PATH)/Build/lufa_build.mk 52 | include $(LUFA_PATH)/Build/lufa_cppcheck.mk 53 | include $(LUFA_PATH)/Build/lufa_doxygen.mk 54 | include $(LUFA_PATH)/Build/lufa_avrdude.mk 55 | include $(LUFA_PATH)/Build/lufa_atprogram.mk 56 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/common/host.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011,2012 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #include 19 | //#include 20 | #include "keycode.h" 21 | #include "host.h" 22 | #include "util.h" 23 | #include "debug.h" 24 | 25 | 26 | #ifdef NKRO_ENABLE 27 | bool keyboard_nkro = true; 28 | #endif 29 | 30 | static host_driver_t *driver; 31 | static uint16_t last_system_report = 0; 32 | static uint16_t last_consumer_report = 0; 33 | 34 | 35 | void host_set_driver(host_driver_t *d) 36 | { 37 | driver = d; 38 | } 39 | 40 | host_driver_t *host_get_driver(void) 41 | { 42 | return driver; 43 | } 44 | 45 | uint8_t host_keyboard_leds(void) 46 | { 47 | if (!driver) return 0; 48 | return (*driver->keyboard_leds)(); 49 | } 50 | /* send report */ 51 | void host_keyboard_send(report_keyboard_t *report) 52 | { 53 | if (!driver) return; 54 | (*driver->send_keyboard)(report); 55 | 56 | if (debug_keyboard) { 57 | dprint("keyboard_report: "); 58 | for (uint8_t i = 0; i < KEYBOARD_REPORT_SIZE; i++) { 59 | dprintf("%02X ", report->raw[i]); 60 | } 61 | dprint("\n"); 62 | } 63 | } 64 | 65 | void host_mouse_send(report_mouse_t *report) 66 | { 67 | if (!driver) return; 68 | (*driver->send_mouse)(report); 69 | } 70 | 71 | void host_system_send(uint16_t report) 72 | { 73 | if (report == last_system_report) return; 74 | last_system_report = report; 75 | 76 | if (!driver) return; 77 | (*driver->send_system)(report); 78 | } 79 | 80 | void host_consumer_send(uint16_t report) 81 | { 82 | if (report == last_consumer_report) return; 83 | last_consumer_report = report; 84 | 85 | if (!driver) return; 86 | (*driver->send_consumer)(report); 87 | } 88 | 89 | uint16_t host_last_sysytem_report(void) 90 | { 91 | return last_system_report; 92 | } 93 | 94 | uint16_t host_last_consumer_report(void) 95 | { 96 | return last_consumer_report; 97 | } 98 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/HID_EEPROM_Loader.c: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Special application to extract an EEPROM image stored in FLASH memory, and 34 | * copy it to the device EEPROM. This application is designed to be used with 35 | * the HID build system module of LUFA to program the EEPROM of a target device 36 | * that uses the HID bootloader protocol, which does not have native EEPROM 37 | * programming support. 38 | */ 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | /* References to the binary EEPROM data linked in the AVR's FLASH memory space */ 45 | extern const char _binary_InputEEData_bin_start[]; 46 | extern const char _binary_InputEEData_bin_end[]; 47 | extern const char _binary_InputEEData_bin_size[]; 48 | 49 | /* Friendly names for the embedded binary data stored in FLASH memory space */ 50 | #define InputEEData _binary_InputEEData_bin_start 51 | #define InputEEData_size ((int)_binary_InputEEData_bin_size) 52 | 53 | int main(void) 54 | { 55 | /* Copy out the embedded EEPROM data from FLASH to EEPROM memory space */ 56 | for (uint16_t i = 0; i < InputEEData_size; i++) 57 | eeprom_update_byte((uint8_t*)i, pgm_read_byte(&InputEEData[i])); 58 | 59 | /* Infinite loop once complete */ 60 | for (;;); 61 | } 62 | -------------------------------------------------------------------------------- /server/firmware/tmk_keyboard/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/BootloaderHID.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2014. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.lufa-lib.org 7 | */ 8 | 9 | /* 10 | Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaims all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for BootloaderHID.c. 34 | */ 35 | 36 | #ifndef _BOOTLOADERHID_H_ 37 | #define _BOOTLOADERHID_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #include "Descriptors.h" 48 | 49 | #include 50 | #include 51 | 52 | /* Preprocessor Checks: */ 53 | #if !defined(__OPTIMIZE_SIZE__) 54 | #error This bootloader requires that it be optimized for size, not speed, to fit into the target device. Change optimization settings and try again. 55 | #endif 56 | 57 | /* Macros: */ 58 | /** Bootloader special address to start the user application */ 59 | #define COMMAND_STARTAPPLICATION 0xFFFF 60 | 61 | /** Magic bootloader key to unlock forced application start mode. */ 62 | #define MAGIC_BOOT_KEY 0xDC42 63 | 64 | /* Function Prototypes: */ 65 | static void SetupHardware(void); 66 | 67 | void Application_Jump_Check(void) ATTR_INIT_SECTION(3); 68 | 69 | void EVENT_USB_Device_ConfigurationChanged(void); 70 | void EVENT_USB_Device_UnhandledControlRequest(void); 71 | 72 | #endif 73 | 74 | --------------------------------------------------------------------------------