diff --git a/.gitmodules b/.gitmodules index e69de29b..c479e392 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "protocol/usb_hid/USB_Host_Shield_2.0-tmk"] + path = protocol/usb_hid/USB_Host_Shield_2.0-tmk + url = https://github.com/tmk/USB_Host_Shield_2.0.git +[submodule "protocol/lufa/lufa-abcminiuser"] + path = protocol/lufa/lufa-abcminiuser + url = https://github.com/abcminiuser/lufa.git diff --git a/README.md b/README.md index c9c2eda4..50456880 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,14 @@ Source code is available here: Updates ------- +#### 2017/05/30 +Fixed **Modifier/Layer key stuck** problem. See this wiki entry. If you need old keymap behaviour for some reason define `NO_TRACK_KEY_PRESS` in your `config.h`. + +This is virtually equivalent to QMK `PREVENT_STUCK_MODIFIERS`. + +#### 2017/01/11 +Changed action code for `ACTION_LAYER_MODS` and this may cause incompatibility with existent shared URL and downloaded firmwware of keymap editor. If you are using the action you just have to redefine it on keymap editor. Existent keymap code should not suffer. + #### 2016/06/26 Keymap framework was updated. `fn_actions[]` should be defined as `action_t` instead of `uint16_t`. And default code for keymap handling is now included in core you just need define `uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]` and `action_t fn_actions[]`. diff --git a/common.mk b/common.mk index 69be0e13..9c3425b4 100644 --- a/common.mk +++ b/common.mk @@ -21,6 +21,7 @@ SRC += $(COMMON_DIR)/host.c \ ifeq (yes,$(strip $(UNIMAP_ENABLE))) SRC += $(COMMON_DIR)/unimap.c OPT_DEFS += -DUNIMAP_ENABLE + OPT_DEFS += -DACTIONMAP_ENABLE else ifeq (yes,$(strip $(ACTIONMAP_ENABLE))) SRC += $(COMMON_DIR)/actionmap.c @@ -49,10 +50,22 @@ endif ifeq (yes,$(strip $(CONSOLE_ENABLE))) OPT_DEFS += -DCONSOLE_ENABLE else - OPT_DEFS += -DNO_PRINT + # Remove print functions when console is disabled and + # no other print method like UART is available + ifneq (yes, $(strip $(DEBUG_PRINT_AVAILABLE))) + OPT_DEFS += -DNO_PRINT + OPT_DEFS += -DNO_DEBUG + endif +endif + +ifeq (yes,$(strip $(NO_DEBUG))) OPT_DEFS += -DNO_DEBUG endif +ifeq (yes,$(strip $(NO_PRINT))) + OPT_DEFS += -DNO_PRINT +endif + ifeq (yes,$(strip $(COMMAND_ENABLE))) SRC += $(COMMON_DIR)/command.c OPT_DEFS += -DCOMMAND_ENABLE @@ -88,14 +101,16 @@ ifeq (yes,$(strip $(KEYMAP_SECTION_ENABLE))) EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x else ifeq ($(strip $(MCU)),atmega32u4) EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x + else ifeq ($(strip $(MCU)),at90usb1286) + EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr51.x else EXTRALDFLAGS = $(error no ldscript for keymap section) endif endif # Version string -VERSION := $(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null) -OPT_DEFS += -DVERSION=$(VERSION) +TMK_VERSION := $(shell (git describe --always --dirty=+ || echo 'unknown') 2> /dev/null) +OPT_DEFS += -DTMK_VERSION=$(TMK_VERSION) # Search Path diff --git a/common/action.c b/common/action.c index 3a3c4014..a53b3a3f 100644 --- a/common/action.c +++ b/common/action.c @@ -1,5 +1,5 @@ /* -Copyright 2012,2013 Jun Wako +Copyright 2012,2013,2020 Jun Wako This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ along with this program. If not, see . #include "action.h" #include "hook.h" #include "wait.h" +#include "bootloader.h" #ifdef DEBUG_ACTION #include "debug.h" @@ -58,6 +59,8 @@ void action_exec(keyevent_t event) void process_action(keyrecord_t *record) { + if (hook_process_action(record)) return; + keyevent_t event = record->event; #ifndef NO_ACTION_TAPPING uint8_t tap_count = record->tap.count; @@ -65,7 +68,7 @@ void process_action(keyrecord_t *record) if (IS_NOEVENT(event)) { return; } - action_t action = layer_switch_get_action(event.key); + action_t action = layer_switch_get_action(event); dprint("ACTION: "); debug_action(action); #ifndef NO_ACTION_LAYER dprint(" layer_state: "); layer_debug(); @@ -101,7 +104,7 @@ void process_action(keyrecord_t *record) { uint8_t mods = (action.kind.id == ACT_LMODS_TAP) ? action.key.mods : action.key.mods<<4; - switch (action.layer_tap.code) { + switch (action.key.code) { #ifndef NO_ACTION_ONESHOT case MODS_ONESHOT: // Oneshot modifier @@ -160,6 +163,13 @@ void process_action(keyrecord_t *record) } else { dprint("MODS_TAP: Tap: register_code\n"); register_code(action.key.code); + + // Delay for MacOS #659 + if (action.key.code == KC_CAPSLOCK || + action.key.code == KC_NUMLOCK || + action.key.code == KC_SCROLLLOCK) { + wait_ms(100); + } } } else { dprint("MODS_TAP: No tap: add_mods\n"); @@ -247,14 +257,18 @@ void process_action(keyrecord_t *record) case ACT_LAYER_TAP: case ACT_LAYER_TAP_EXT: switch (action.layer_tap.code) { - case 0xe0 ... 0xef: - /* layer On/Off with modifiers(left only) */ + case 0xc0 ... 0xdf: + /* layer On/Off with modifiers */ if (event.pressed) { layer_on(action.layer_tap.val); - register_mods(action.layer_tap.code & 0x0f); + register_mods((action.layer_tap.code & 0x10) ? + (action.layer_tap.code & 0x0f) << 4 : + (action.layer_tap.code & 0x0f)); } else { layer_off(action.layer_tap.val); - unregister_mods(action.layer_tap.code & 0x0f); + unregister_mods((action.layer_tap.code & 0x10) ? + (action.layer_tap.code & 0x0f) << 4 : + (action.layer_tap.code & 0x0f)); } break; case OP_TAP_TOGGLE: @@ -287,6 +301,13 @@ void process_action(keyrecord_t *record) if (tap_count > 0) { dprint("KEYMAP_TAP_KEY: Tap: register_code\n"); register_code(action.layer_tap.code); + + // Delay for MacOS #659 + if (action.layer_tap.code == KC_CAPSLOCK || + action.layer_tap.code == KC_NUMLOCK || + action.layer_tap.code == KC_SCROLLLOCK) { + wait_ms(100); + } } else { dprint("KEYMAP_TAP_KEY: No tap: On on press\n"); layer_on(action.layer_tap.val); @@ -335,6 +356,15 @@ void process_action(keyrecord_t *record) break; #endif case ACT_COMMAND: + switch (action.command.id) { + case COMMAND_BOOTLOADER: + if (event.pressed) { + clear_keyboard(); + wait_ms(50); + bootloader_jump(); + } + break; + } break; #ifndef NO_ACTION_FUNCTION case ACT_FUNCTION: @@ -359,37 +389,28 @@ void register_code(uint8_t code) } #ifdef LOCKING_SUPPORT_ENABLE - else if (KC_LOCKING_CAPS == code) { -#ifdef LOCKING_RESYNC_ENABLE - // Resync: ignore if caps lock already is on - if (host_keyboard_leds() & (1<. * 000r|0000|0000 0001 Transparent code * 000r|0000| keycode Key * 000r|mods|0000 0000 Modifiers - * 000r|mods| keycode Modifiers+Key(Modified key) + * 000r|mods| keycode Modifiers+key(Modified key) * r: Left/Right flag(Left:0, Right:1) * * ACT_MODS_TAP(001r): - * 001r|mods|0000 0000 Modifiers with OneShot - * 001r|mods|0000 0001 Modifiers with tap toggle - * 001r|mods|0000 00xx (reserved) - * 001r|mods| keycode Modifiers with Tap Key(Dual role) + * 001r|mods|0000 0000 Modifiers with OneShot[TAP] + * 001r|mods|0000 0001 Modifiers with tap toggle[TAP] + * 001r|mods|0000 00xx (reserved) (0x02-03) + * 001r|mods| keycode Modifiers with tap key[TAP] * * * Other Keys(01xx) @@ -47,7 +47,7 @@ along with this program. If not, see . * 0100|10| usage(10) (reserved) * 0100|11| usage(10) (reserved) * - * ACT_MOUSEKEY(0110): TODO: Not needed? + * ACT_MOUSEKEY(0101): TODO: Not needed? * 0101|xxxx| keycode Mouse key * * 011x|xxxx xxxx xxxx (reseved) @@ -70,13 +70,14 @@ along with this program. If not, see . * 1001|oopp|BBBB BBBB 8-bit Bitwise Operation??? * * ACT_LAYER_TAP(101x): - * 101E|LLLL| keycode On/Off with tap key (0x00-DF)[TAP] - * 101E|LLLL|1110 mods On/Off with modifiers (0xE0-EF)[NOT TAP] + * 101E|LLLL| keycode On/Off with tap key [TAP] + * 101E|LLLL|110r mods On/Off with modifiers (0xC0-DF)[NOT TAP] + * r: Left/Right flag(Left:0, Right:1) * 101E|LLLL|1111 0000 Invert with tap toggle (0xF0) [TAP] * 101E|LLLL|1111 0001 On/Off (0xF1) [NOT TAP] * 101E|LLLL|1111 0010 Off/On (0xF2) [NOT TAP] * 101E|LLLL|1111 0011 Set/Clear (0xF3) [NOT TAP] - * 101E|LLLL|1111 xxxx Reserved (0xF4-FF) + * 101E|LLLL|1111 xxxx (reserved) (0xF4-FF) * ELLLL: layer 0-31(E: extra bit for layer 16-31) * * @@ -197,25 +198,26 @@ typedef union { * bit 4 +----- LR flag(Left:0, Right:1) */ enum mods_bit { - MOD_LCTL = 0x01, - MOD_LSFT = 0x02, - MOD_LALT = 0x04, - MOD_LGUI = 0x08, - MOD_RCTL = 0x11, - MOD_RSFT = 0x12, - MOD_RALT = 0x14, - MOD_RGUI = 0x18, + MOD_NONE = 0x0000, + MOD_LCTL = 0x0100, + MOD_LSFT = 0x0200, + MOD_LALT = 0x0400, + MOD_LGUI = 0x0800, + MOD_RCTL = 0x1100, + MOD_RSFT = 0x1200, + MOD_RALT = 0x1400, + MOD_RGUI = 0x1800, }; enum mods_codes { MODS_ONESHOT = 0x00, MODS_TAP_TOGGLE = 0x01, }; #define ACTION_KEY(key) ACTION(ACT_MODS, (key)) -#define ACTION_MODS(mods) ACTION(ACT_MODS, ((mods)&0x1f)<<8 | 0) -#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, ((mods)&0x1f)<<8 | (key)) -#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | (key)) -#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_ONESHOT) -#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_TAP_TOGGLE) +#define ACTION_MODS(mods) ACTION(ACT_MODS, ((mods)&0x1f00) | 0) +#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, ((mods)&0x1f00) | (key)) +#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, ((mods)&0x1f00) | (key)) +#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f00) | MODS_ONESHOT) +#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f00) | MODS_TAP_TOGGLE) /* @@ -267,7 +269,7 @@ enum layer_pram_tap_op { #define ACTION_LAYER_ON_OFF(layer) ACTION_LAYER_TAP((layer), OP_ON_OFF) #define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON) #define ACTION_LAYER_SET_CLEAR(layer) ACTION_LAYER_TAP((layer), OP_SET_CLEAR) -#define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xe0 | ((mods)&0x0f)) +#define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xc0 | ((mods>>8)&0x1f)) /* With Tapping */ #define ACTION_LAYER_TAP_KEY(layer, key) ACTION_LAYER_TAP((layer), (key)) #define ACTION_LAYER_TAP_TOGGLE(layer) ACTION_LAYER_TAP((layer), OP_TAP_TOGGLE) @@ -286,6 +288,12 @@ enum layer_pram_tap_op { /* * Extensions */ +/* Macro */ +#define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) +#define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id)) +#define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt)<<8 | (id)) + +/* Backlight */ enum backlight_opt { BACKLIGHT_INCREASE = 0, BACKLIGHT_DECREASE = 1, @@ -293,18 +301,18 @@ enum backlight_opt { BACKLIGHT_STEP = 3, BACKLIGHT_LEVEL = 4, }; -/* Macro */ -#define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) -#define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id)) -#define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt)<<8 | (id)) -/* Backlight */ #define ACTION_BACKLIGHT_INCREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_INCREASE << 8) #define ACTION_BACKLIGHT_DECREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_DECREASE << 8) #define ACTION_BACKLIGHT_TOGGLE() ACTION(ACT_BACKLIGHT, BACKLIGHT_TOGGLE << 8) #define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP << 8) #define ACTION_BACKLIGHT_LEVEL(level) ACTION(ACT_BACKLIGHT, BACKLIGHT_LEVEL << 8 | level) + /* Command */ -#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (addr)) +enum command_ids { + COMMAND_BOOTLOADER, // jump to bootloader +}; +#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (id)) + /* Function */ enum function_opts { FUNC_TAP = 0x8, /* indciates function is tappable */ diff --git a/common/action_layer.c b/common/action_layer.c index 6b5a7fd2..be316697 100644 --- a/common/action_layer.c +++ b/common/action_layer.c @@ -24,7 +24,9 @@ static void default_layer_state_set(uint32_t state) default_layer_state = state; hook_default_layer_change(default_layer_state); default_layer_debug(); debug("\n"); +#ifdef NO_TRACK_KEY_PRESS clear_keyboard_but_mods(); // To avoid stuck keys +#endif } void default_layer_debug(void) @@ -66,7 +68,9 @@ static void layer_state_set(uint32_t state) layer_state = state; hook_layer_change(layer_state); layer_debug(); dprintln(); +#ifdef NO_TRACK_KEY_PRESS clear_keyboard_but_mods(); // To avoid stuck keys +#endif } void layer_clear(void) @@ -115,26 +119,47 @@ void layer_debug(void) -action_t layer_switch_get_action(keypos_t key) +/* return layer effective for key at this time */ +static uint8_t current_layer_for_key(keypos_t key) { - action_t action = ACTION_TRANSPARENT; - #ifndef NO_ACTION_LAYER + action_t action = ACTION_TRANSPARENT; uint32_t layers = layer_state | default_layer_state; /* check top layer first */ for (int8_t i = 31; i >= 0; i--) { if (layers & (1UL< is CTL_( ALT_( [S]T(key1), [S]T(key2) )) . */ +#define SFT_(...) D(LSFT), __VA_ARGS__, U(LSFT) +#define CTL_(...) D(LCTL), __VA_ARGS__, U(LCTL) +#define ALT_(...) D(LALT), __VA_ARGS__, U(LALT) +#define AGR_(...) D(RALT), __VA_ARGS__, U(RALT) +/* Unicode macros for XOrg/MacOs/Win. */ +/* Example: UNIW_(0,1,4,9) enters a bullet glyph on Windows using Alt+KeyPad(####). */ +#define UNIX_(d1,d2,d3,d4) CTL_(ST(U)), T(d1), T(d2), T(d3), T(d4) , T(ENT) +#define UNIM_(d1,d2,d3,d4) ALT_( T(d1), T(d2), T(d3), T(d4) ) +#define UNIW_(d1,d2,d3,d4) ALT_( T(P##d1), T(P##d2), T(P##d3), T(P##d4) ) /* for backward comaptibility */ #define MD(key) DOWN(KC_##key) diff --git a/common/action_tapping.c b/common/action_tapping.c index a74eb106..45cb2fcf 100644 --- a/common/action_tapping.c +++ b/common/action_tapping.c @@ -115,7 +115,7 @@ bool process_tapping(keyrecord_t *keyp) */ else if (IS_RELEASED(event) && !waiting_buffer_typed(event)) { // Modifier should be retained till end of this tapping. - action_t action = layer_switch_get_action(event.key); + action_t action = layer_switch_get_action(event); switch (action.kind.id) { case ACT_LMODS: case ACT_RMODS: @@ -152,7 +152,7 @@ bool process_tapping(keyrecord_t *keyp) debug_tapping_key(); return true; } - else if (is_tap_key(event.key) && event.pressed) { + else if (is_tap_key(event) && event.pressed) { if (tapping_key.tap.count > 1) { debug("Tapping: Start new tap with releasing last tap(>1).\n"); // unregister key @@ -196,7 +196,7 @@ bool process_tapping(keyrecord_t *keyp) tapping_key = (keyrecord_t){}; return true; } - else if (is_tap_key(event.key) && event.pressed) { + else if (is_tap_key(event) && event.pressed) { if (tapping_key.tap.count > 1) { debug("Tapping: Start new tap with releasing last timeout tap(>1).\n"); // unregister key @@ -241,7 +241,7 @@ bool process_tapping(keyrecord_t *keyp) tapping_key = *keyp; return true; } - } else if (is_tap_key(event.key)) { + } else if (is_tap_key(event)) { // Sequential tap can be interfered with other tap key. debug("Tapping: Start with interfering other tap.\n"); tapping_key = *keyp; @@ -272,7 +272,7 @@ bool process_tapping(keyrecord_t *keyp) } // not tapping state else { - if (event.pressed && is_tap_key(event.key)) { + if (event.pressed && is_tap_key(event)) { debug("Tapping: Start(Press tap key).\n"); tapping_key = *keyp; waiting_buffer_scan_tap(); diff --git a/common/actionmap.h b/common/actionmap.h index 2ebfb0d0..c8f9c38d 100644 --- a/common/actionmap.h +++ b/common/actionmap.h @@ -1,5 +1,5 @@ /* -Copyright 2015 Jun Wako +Copyright 2015,2020 Jun Wako This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -283,43 +283,9 @@ along with this program. If not, see . #define AC_WWW_STOP ACTION_USAGE_CONSUMER(APPCONTROL_STOP) #define AC_WWW_REFRESH ACTION_USAGE_CONSUMER(APPCONTROL_REFRESH) #define AC_WWW_FAVORITES ACTION_USAGE_CONSUMER(APPCONTROL_BOOKMARKS) -/* Jump to bootloader */ -#define AC_BOOTLOADER ACTION_KEY(KC_BOOTLOADER) -/* Fn key */ -/* -#define AC_FN0 ACTION_KEY(KC_FN0) -#define AC_FN1 ACTION_KEY(KC_FN1) -#define AC_FN2 ACTION_KEY(KC_FN2) -#define AC_FN3 ACTION_KEY(KC_FN3) -#define AC_FN4 ACTION_KEY(KC_FN4) -#define AC_FN5 ACTION_KEY(KC_FN5) -#define AC_FN6 ACTION_KEY(KC_FN6) -#define AC_FN7 ACTION_KEY(KC_FN7) -#define AC_FN8 ACTION_KEY(KC_FN8) -#define AC_FN9 ACTION_KEY(KC_FN9) -#define AC_FN10 ACTION_KEY(KC_FN10) -#define AC_FN11 ACTION_KEY(KC_FN11) -#define AC_FN12 ACTION_KEY(KC_FN12) -#define AC_FN13 ACTION_KEY(KC_FN13) -#define AC_FN14 ACTION_KEY(KC_FN14) -#define AC_FN15 ACTION_KEY(KC_FN15) -#define AC_FN16 ACTION_KEY(KC_FN16) -#define AC_FN17 ACTION_KEY(KC_FN17) -#define AC_FN18 ACTION_KEY(KC_FN18) -#define AC_FN19 ACTION_KEY(KC_FN19) -#define AC_FN20 ACTION_KEY(KC_FN20) -#define AC_FN21 ACTION_KEY(KC_FN21) -#define AC_FN22 ACTION_KEY(KC_FN22) -#define AC_FN23 ACTION_KEY(KC_FN23) -#define AC_FN24 ACTION_KEY(KC_FN24) -#define AC_FN25 ACTION_KEY(KC_FN25) -#define AC_FN26 ACTION_KEY(KC_FN26) -#define AC_FN27 ACTION_KEY(KC_FN27) -#define AC_FN28 ACTION_KEY(KC_FN28) -#define AC_FN29 ACTION_KEY(KC_FN29) -#define AC_FN30 ACTION_KEY(KC_FN30) -#define AC_FN31 ACTION_KEY(KC_FN31) -*/ +#define AC_BRIGHTNESS_INC ACTION_USAGE_CONSUMER(BRIGHTNESS_INCREMENT) +#define AC_BRIGHTNESS_DEC ACTION_USAGE_CONSUMER(BRIGHTNESS_DECREMENT) + /* Mousekey */ #define AC_MS_UP ACTION_MOUSEKEY(KC_MS_UP) #define AC_MS_DOWN ACTION_MOUSEKEY(KC_MS_DOWN) @@ -338,6 +304,10 @@ along with this program. If not, see . #define AC_MS_ACCEL1 ACTION_MOUSEKEY(KC_MS_ACCEL1) #define AC_MS_ACCEL2 ACTION_MOUSEKEY(KC_MS_ACCEL2) +/* Command */ +#define AC_BOOTLOADER ACTION_COMMAND(COMMAND_BOOTLOADER, 0) + + /* * Short names */ @@ -396,6 +366,8 @@ along with this program. If not, see . #define AC_P8 ACTION_KEY(KC_KP_8) #define AC_P9 ACTION_KEY(KC_KP_9) #define AC_P0 ACTION_KEY(KC_KP_0) +#define AC_P00 ACTION_KEY(KC_KP_00) +#define AC_P000 ACTION_KEY(KC_KP_000) #define AC_PDOT ACTION_KEY(KC_KP_DOT) #define AC_PCMM ACTION_KEY(KC_KP_COMMA) #define AC_PSLS ACTION_KEY(KC_KP_SLASH) @@ -447,9 +419,12 @@ along with this program. If not, see . #define AC_WSTP ACTION_USAGE_CONSUMER(APPCONTROL_STOP) #define AC_WREF ACTION_USAGE_CONSUMER(APPCONTROL_REFRESH) #define AC_WFAV ACTION_USAGE_CONSUMER(APPCONTROL_BOOKMARKS) -/* Jump to bootloader */ -#define AC_BTLD ACTION_KEY(KC_BOOTLOADER) +#define AC_BRTI ACTION_USAGE_CONSUMER(BRIGHTNESS_INCREMENT) +#define AC_BRTD ACTION_USAGE_CONSUMER(BRIGHTNESS_DECREMENT) /* Transparent */ #define AC_TRNS ACTION_KEY(KC_TRANSPARENT) +/* Command */ +#define AC_BTLD AC_BOOTLOADER + #endif diff --git a/common/avr/bootloader.c b/common/avr/bootloader.c index 7c744e8c..8abce9d8 100644 --- a/common/avr/bootloader.c +++ b/common/avr/bootloader.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "bootloader.h" @@ -16,8 +17,8 @@ * AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet. * Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'. * - * * Size of Bootloaders in bytes: + * Atmel DFU loader(ATmega32U2) 4096 * Atmel DFU loader(ATmega32U4) 4096 * Atmel DFU loader(AT90USB128) 8192 * LUFA bootloader(ATmega32U4) 4096 @@ -27,45 +28,60 @@ * Teensy++ halfKay(AT90USB128) 1024 * * - * AVR Boot section is located at the end of Flash memory like the followings. - * - * - * byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128) - * 0x0000 +---------------+ 0x00000 +---------------+ - * | | | | - * | | | | - * | Application | | Application | - * | | | | - * = = = = - * | | 32KB-4KB | | 128KB-8KB - * 0x6000 +---------------+ 0x1FC00 +---------------+ - * | Bootloader | 4KB | Bootloader | 8KB - * 0x7FFF +---------------+ 0x1FFFF +---------------+ + * AVR Boot section is located at the end of Flash memory. * - * - * byte Teensy(ATMega32u4) byte Teensy++(AT90SUB128) - * 0x0000 +---------------+ 0x00000 +---------------+ - * | | | | - * | | | | - * | Application | | Application | - * | | | | - * = = = = - * | | 32KB-512B | | 128KB-1KB - * 0x7E00 +---------------+ 0x1FC00 +---------------+ - * | Bootloader | 512B | Bootloader | 1KB - * 0x7FFF +---------------+ 0x1FFFF +---------------+ + * byte ATMega32u4 with 4096-byte Boot section + * 0x0000 +---------------+ + * | | + * | | + * | Application | 28KB + * | | + * = = + * | | + * 0x7000 +---------------+ <---- BOOTLOADER_START + * | Bootloader | 4KB BOOTLOADER_SIZE + * 0x7FFF +---------------+ <---- FLASHEND */ -#ifndef BOOTLOADER_SIZE -#warning To use bootloader_jump() you need to define BOOTLOADER_SIZE in config.h. -#define BOOTLOADER_SIZE 4096 -#endif -#define FLASH_SIZE (FLASHEND + 1L) -#define BOOTLOADER_START (FLASH_SIZE - BOOTLOADER_SIZE) +/* bootloader start address in byte */ +#define BOOTLOADER_START (FLASHEND - bootloader_size() + 1) + +/* boot section size in byte */ +static inline uint16_t bootloader_size(void) +{ +#if defined(BOOTLOADER_SIZE) + return BOOTLOADER_SIZE; +#else + #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U2__) || \ + defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega16U2__) || \ + defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) + uint8_t hfuse = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS); + switch ((hfuse >> 1) & 3) { + case 0: return 4096; + case 1: return 2048; + case 2: return 1024; + case 3: return 512; + } + return 4096; + #elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || \ + defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) + uint8_t hfuse = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS); + switch ((hfuse >> 1) & 3) { + case 0: return 8192; + case 1: return 4096; + case 2: return 2048; + case 3: return 1024; + } + return 8192; + #else + #error Set Boot section size to BOOTLOADER_SIZE in config.h + #endif +#endif +} -/* - * Entering the Bootloader via Software +/* + * Entering the Bootloader via Software * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html */ #define BOOTLOADER_RESET_KEY 0xB007B007 @@ -76,7 +92,6 @@ void bootloader_jump(void) { #ifdef PROTOCOL_LUFA USB_Disable(); cli(); - _delay_ms(2000); #endif #ifdef PROTOCOL_PJRC @@ -87,6 +102,14 @@ void bootloader_jump(void) { _delay_ms(5); #endif +#ifndef NO_BOOTLOADER_CATERINA_BOOTKEY + // Set bootkey for Arduino Leonardo and Pro Micro bootloader + // Watchdog reset with bootkey causes the bootloader to enter program mode instead of starting application. + // https://github.com/arduino/ArduinoCore-avr/blob/master/bootloaders/caterina/Caterina.c#L68-L69 + // https://github.com/sparkfun/SF32u4_boards/blob/master/sparkfun/avr/bootloaders/caterina/Caterina.c#L88-L89 + *(volatile uint16_t *)0x0800 = 0x7777; +#endif + // watchdog reset reset_key = BOOTLOADER_RESET_KEY; wdt_enable(WDTO_250MS); @@ -101,85 +124,20 @@ void bootloader_jump_after_watchdog_reset(void) if ((MCUSR & (1<= TX_BUFFER_SIZE) i = 0; + // return immediately to avoid deadlock when interrupt is disabled(called from ISR) + if (tx_buffer_tail == i && (SREG & (1<= TX_BUFFER_SIZE) i = 0; - UDR0 = tx_buffer[i]; + UDRn = tx_buffer[i]; tx_buffer_tail = i; } } // Receive Interrupt -ISR(USART_RX_vect) +ISR(RX_vect) { uint8_t c, i; - c = UDR0; + c = UDRn; i = rx_buffer_head + 1; if (i >= RX_BUFFER_SIZE) i = 0; if (i != rx_buffer_tail) { diff --git a/common/command.c b/common/command.c index bb471e88..54050bd9 100644 --- a/common/command.c +++ b/common/command.c @@ -57,9 +57,10 @@ static void command_console_help(void); #ifdef MOUSEKEY_ENABLE static bool mousekey_console(uint8_t code); static void mousekey_console_help(void); +static uint8_t numkey2num(uint8_t code); #endif -static uint8_t numkey2num(uint8_t code); + static void switch_default_layer(uint8_t layer); @@ -283,7 +284,7 @@ static bool command_common(uint8_t code) print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " "VER: " STR(DEVICE_VER) "\n"); - print("BUILD: " STR(VERSION) " (" __TIME__ " " __DATE__ ")\n"); + print("BUILD: " STR(TMK_VERSION) " (" __TIME__ " " __DATE__ ")\n"); /* build options */ print("OPTIONS:" #ifdef PROTOCOL_PJRC @@ -629,6 +630,7 @@ static bool mousekey_console(uint8_t code) /*********************************************************** * Utilities ***********************************************************/ +#if MOUSEKEY_ENABLE static uint8_t numkey2num(uint8_t code) { switch (code) { @@ -645,6 +647,7 @@ static uint8_t numkey2num(uint8_t code) } return 0; } +#endif static void switch_default_layer(uint8_t layer) { diff --git a/common/command.h b/common/command.h index b57a6c1c..961edf15 100644 --- a/common/command.h +++ b/common/command.h @@ -16,7 +16,7 @@ along with this program. If not, see . */ #ifndef COMMAND_H -#define COMMAND +#define COMMAND_H /* TODO: Refactoring */ typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t; diff --git a/common/hook.c b/common/hook.c index 4ed2403c..22be9a30 100644 --- a/common/hook.c +++ b/common/hook.c @@ -47,3 +47,8 @@ void hook_keyboard_leds_change(uint8_t led_status) { __attribute__((weak)) void hook_bootmagic(void) {} + +__attribute__((weak)) +bool hook_process_action(keyrecord_t *record) { + return false; +} diff --git a/common/hook.h b/common/hook.h index 56fe5677..ddd05c6f 100644 --- a/common/hook.h +++ b/common/hook.h @@ -20,6 +20,11 @@ along with this program. If not, see . #include "keyboard.h" #include "led.h" +#include "action.h" + +#ifdef __cplusplus +extern "C" { +#endif /* ------------------------------------- * Protocol hooks @@ -47,6 +52,10 @@ void hook_usb_suspend_loop(void); * the "normal" indicator LED status by default. */ void hook_usb_wakeup(void); +/* Called repeatedly until getting to CONFIGURED state */ +/* Default behaviour: do nothing. */ +void hook_usb_startup_wait_loop(void); + /* ------------------------------------- * Keyboard hooks @@ -76,5 +85,12 @@ void hook_keyboard_leds_change(uint8_t led_status); /* Default behaviour: do nothing. */ void hook_bootmagic(void); +/* Called on before processing key event */ +/* returns true if the event is consumed and default action is not needed. */ +bool hook_process_action(keyrecord_t *record); + +#ifdef __cplusplus +} +#endif #endif /* _HOOKS_H_ */ diff --git a/common/host.h b/common/host.h index 9814b10d..fefb8141 100644 --- a/common/host.h +++ b/common/host.h @@ -32,6 +32,9 @@ extern "C" { extern bool keyboard_nkro; #endif +/* These parameters should be included into host driver also? + * keyboard_protocol: 0:Boot, 1:Report(default) + * keyboard_idle: idle rate in unit of 4ms */ extern uint8_t keyboard_idle; extern uint8_t keyboard_protocol; diff --git a/common/keyboard.c b/common/keyboard.c index b0319369..0eb28418 100644 --- a/common/keyboard.c +++ b/common/keyboard.c @@ -93,7 +93,7 @@ void keyboard_init(void) } /* - * Do keyboard routine jobs: scan mantrix, light LEDs, ... + * Do keyboard routine jobs: scan matrix, light LEDs, ... * This is repeatedly called as fast as possible. */ void keyboard_task(void) @@ -126,19 +126,22 @@ void keyboard_task(void) matrix_ghost[r] = matrix_row; #endif if (debug_matrix) matrix_print(); - for (uint8_t c = 0; c < MATRIX_COLS; c++) { - if (matrix_change & ((matrix_row_t)1< +Copyright 2011,2012,2020 Jun Wako This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,13 +25,21 @@ along with this program. If not, see . #define IS_ERROR(code) (KC_ROLL_OVER <= (code) && (code) <= KC_UNDEFINED) #define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF) + +// Use original HID usages on B0-DD instead of TMK specific codes +#ifndef USE_ORIGINAL_HID_USAGE #define IS_KEY(code) (KC_A <= (code) && (code) <= KC_EXSEL) +#else +#define IS_KEY(code) ((KC_A <= (code) && (code) <= KC_EXSEL) || \ + (KC_KP_00 <= (code) && (code) <= KC_KP_HEXADECIMAL)) +#endif + #define IS_MOD(code) (KC_LCTRL <= (code) && (code) <= KC_RGUI) #define IS_SPECIAL(code) ((0xA5 <= (code) && (code) <= 0xDF) || (0xE8 <= (code) && (code) <= 0xFF)) #define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE) -#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_WFAV) +#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_BRIGHTNESS_DEC) #define IS_FN(code) (KC_FN0 <= (code) && (code) <= KC_FN31) #define IS_MOUSEKEY(code) (KC_MS_UP <= (code) && (code) <= KC_MS_ACCEL2) #define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT) @@ -109,6 +117,8 @@ along with this program. If not, see . #define KC_P8 KC_KP_8 #define KC_P9 KC_KP_9 #define KC_P0 KC_KP_0 +#define KC_P00 KC_KP_00 +#define KC_P000 KC_KP_000 #define KC_PDOT KC_KP_DOT #define KC_PCMM KC_KP_COMMA #define KC_PSLS KC_KP_SLASH @@ -165,6 +175,8 @@ along with this program. If not, see . #define KC_WSTP KC_WWW_STOP #define KC_WREF KC_WWW_REFRESH #define KC_WFAV KC_WWW_FAVORITES +#define KC_BRTI KC_BRIGHTNESS_INC +#define KC_BRTD KC_BRIGHTNESS_DEC /* Jump to bootloader */ #define KC_BTLD KC_BOOTLOADER /* Transparent */ @@ -175,329 +187,324 @@ along with this program. If not, see . /* USB HID Keyboard/Keypad Usage(0x07) */ enum hid_keyboard_keypad_usage { - KC_NO = 0x00, - KC_ROLL_OVER, - KC_POST_FAIL, - KC_UNDEFINED, - KC_A, - KC_B, - KC_C, - KC_D, - KC_E, - KC_F, - KC_G, - KC_H, - KC_I, - KC_J, - KC_K, - KC_L, - KC_M, /* 0x10 */ - KC_N, - KC_O, - KC_P, - KC_Q, - KC_R, - KC_S, - KC_T, - KC_U, - KC_V, - KC_W, - KC_X, - KC_Y, - KC_Z, - KC_1, - KC_2, - KC_3, /* 0x20 */ - KC_4, - KC_5, - KC_6, - KC_7, - KC_8, - KC_9, - KC_0, - KC_ENTER, - KC_ESCAPE, - KC_BSPACE, - KC_TAB, - KC_SPACE, - KC_MINUS, - KC_EQUAL, - KC_LBRACKET, - KC_RBRACKET, /* 0x30 */ - KC_BSLASH, /* \ (and |) */ - KC_NONUS_HASH, /* Non-US # and ~ (Typically near the Enter key) */ - KC_SCOLON, /* ; (and :) */ - KC_QUOTE, /* ' and " */ - KC_GRAVE, /* Grave accent and tilde */ - KC_COMMA, /* , and < */ - KC_DOT, /* . and > */ - KC_SLASH, /* / and ? */ - KC_CAPSLOCK, - KC_F1, - KC_F2, - KC_F3, - KC_F4, - KC_F5, - KC_F6, - KC_F7, /* 0x40 */ - KC_F8, - KC_F9, - KC_F10, - KC_F11, - KC_F12, - KC_PSCREEN, - KC_SCROLLLOCK, - KC_PAUSE, - KC_INSERT, - KC_HOME, - KC_PGUP, - KC_DELETE, - KC_END, - KC_PGDOWN, - KC_RIGHT, - KC_LEFT, /* 0x50 */ - KC_DOWN, - KC_UP, - KC_NUMLOCK, - KC_KP_SLASH, - KC_KP_ASTERISK, - KC_KP_MINUS, - KC_KP_PLUS, - KC_KP_ENTER, - KC_KP_1, - KC_KP_2, - KC_KP_3, - KC_KP_4, - KC_KP_5, - KC_KP_6, - KC_KP_7, - KC_KP_8, /* 0x60 */ - KC_KP_9, - KC_KP_0, - KC_KP_DOT, - KC_NONUS_BSLASH, /* Non-US \ and | (Typically near the Left-Shift key) */ - KC_APPLICATION, - KC_POWER, - KC_KP_EQUAL, - KC_F13, - KC_F14, - KC_F15, - KC_F16, - KC_F17, - KC_F18, - KC_F19, - KC_F20, - KC_F21, /* 0x70 */ - KC_F22, - KC_F23, - KC_F24, - KC_EXECUTE, - KC_HELP, - KC_MENU, - KC_SELECT, - KC_STOP, - KC_AGAIN, - KC_UNDO, - KC_CUT, - KC_COPY, - KC_PASTE, - KC_FIND, - KC__MUTE, - KC__VOLUP, /* 0x80 */ - KC__VOLDOWN, - KC_LOCKING_CAPS, /* locking Caps Lock */ - KC_LOCKING_NUM, /* locking Num Lock */ - KC_LOCKING_SCROLL, /* locking Scroll Lock */ - KC_KP_COMMA, - KC_KP_EQUAL_AS400, /* equal sign on AS/400 */ - KC_INT1, - KC_INT2, - KC_INT3, - KC_INT4, - KC_INT5, - KC_INT6, - KC_INT7, - KC_INT8, - KC_INT9, - KC_LANG1, /* 0x90 */ - KC_LANG2, - KC_LANG3, - KC_LANG4, - KC_LANG5, - KC_LANG6, - KC_LANG7, - KC_LANG8, - KC_LANG9, - KC_ALT_ERASE, - KC_SYSREQ, - KC_CANCEL, - KC_CLEAR, - KC_PRIOR, - KC_RETURN, - KC_SEPARATOR, - KC_OUT, /* 0xA0 */ - KC_OPER, - KC_CLEAR_AGAIN, - KC_CRSEL, - KC_EXSEL, /* 0xA4 */ + KC_NO = 0x00, + KC_ROLL_OVER, // 01 + KC_POST_FAIL, // 02 + KC_UNDEFINED, // 03 + KC_A, // 04 + KC_B, // 05 + KC_C, // 06 + KC_D, // 07 + KC_E, // 08 + KC_F, // 09 + KC_G, // 0A + KC_H, // 0B + KC_I, // 0C + KC_J, // 0D + KC_K, // 0E + KC_L, // 0F + KC_M, // 10 + KC_N, // 11 + KC_O, // 12 + KC_P, // 13 + KC_Q, // 14 + KC_R, // 15 + KC_S, // 16 + KC_T, // 17 + KC_U, // 18 + KC_V, // 19 + KC_W, // 1A + KC_X, // 1B + KC_Y, // 1C + KC_Z, // 1D + KC_1, // 1E + KC_2, // 1F + KC_3, // 20 + KC_4, // 21 + KC_5, // 22 + KC_6, // 23 + KC_7, // 24 + KC_8, // 25 + KC_9, // 26 + KC_0, // 27 + KC_ENTER, // 28 + KC_ESCAPE, // 29 + KC_BSPACE, // 2A + KC_TAB, // 2B + KC_SPACE, // 2C + KC_MINUS, // 2D + KC_EQUAL, // 2E + KC_LBRACKET, // 2F + KC_RBRACKET, // 30 + KC_BSLASH, // 31 \ (and |) + KC_NONUS_HASH, // 32 Non-US # and ~ (Typically near the Enter key) + KC_SCOLON, // 33 ; (and :) + KC_QUOTE, // 34 ' and " + KC_GRAVE, // 35 Grave accent and tilde + KC_COMMA, // 36 , and < + KC_DOT, // 37 . and > + KC_SLASH, // 38 / and ? + KC_CAPSLOCK, // 39 + KC_F1, // 3A + KC_F2, // 3B + KC_F3, // 3C + KC_F4, // 3D + KC_F5, // 3E + KC_F6, // 3F + KC_F7, // 40 + KC_F8, // 41 + KC_F9, // 42 + KC_F10, // 43 + KC_F11, // 44 + KC_F12, // 45 + KC_PSCREEN, // 46 + KC_SCROLLLOCK, // 47 + KC_PAUSE, // 48 + KC_INSERT, // 49 + KC_HOME, // 4A + KC_PGUP, // 4B + KC_DELETE, // 4C + KC_END, // 4D + KC_PGDOWN, // 4E + KC_RIGHT, // 4F + KC_LEFT, // 50 + KC_DOWN, // 51 + KC_UP, // 52 + KC_NUMLOCK, // 53 + KC_KP_SLASH, // 54 + KC_KP_ASTERISK, // 55 + KC_KP_MINUS, // 56 + KC_KP_PLUS, // 57 + KC_KP_ENTER, // 58 + KC_KP_1, // 59 + KC_KP_2, // 5A + KC_KP_3, // 5B + KC_KP_4, // 5C + KC_KP_5, // 5D + KC_KP_6, // 5E + KC_KP_7, // 5F + KC_KP_8, // 60 + KC_KP_9, // 61 + KC_KP_0, // 62 + KC_KP_DOT, // 63 + KC_NONUS_BSLASH, // 64 Non-US \ and | (Typically near the Left-Shift key) */ + KC_APPLICATION, // 65 + KC_POWER, // 66 + KC_KP_EQUAL, // 67 + KC_F13, // 68 + KC_F14, // 69 + KC_F15, // 6A + KC_F16, // 6B + KC_F17, // 6C + KC_F18, // 6D + KC_F19, // 6E + KC_F20, // 6F + KC_F21, // 70 + KC_F22, // 71 + KC_F23, // 72 + KC_F24, // 73 + KC_EXECUTE, // 74 + KC_HELP, // 75 + KC_MENU, // 76 + KC_SELECT, // 77 + KC_STOP, // 78 + KC_AGAIN, // 79 + KC_UNDO, // 7A + KC_CUT, // 7B + KC_COPY, // 7C + KC_PASTE, // 7D + KC_FIND, // 7E + KC__MUTE, // 7F + KC__VOLUP, // 80 + KC__VOLDOWN, // 81 + KC_LOCKING_CAPS, // 82 locking Caps Lock */ + KC_LOCKING_NUM, // 83 locking Num Lock */ + KC_LOCKING_SCROLL, // 84 locking Scroll Lock */ + KC_KP_COMMA, // 85 + KC_KP_EQUAL_AS400, // 86 equal sign on AS/400 */ + KC_INT1, // 87 + KC_INT2, // 88 + KC_INT3, // 89 + KC_INT4, // 8A + KC_INT5, // 8B + KC_INT6, // 8C + KC_INT7, // 8D + KC_INT8, // 8E + KC_INT9, // 8F + KC_LANG1, // 90 + KC_LANG2, // 91 + KC_LANG3, // 92 + KC_LANG4, // 93 + KC_LANG5, // 94 + KC_LANG6, // 95 + KC_LANG7, // 96 + KC_LANG8, // 97 + KC_LANG9, // 98 + KC_ALT_ERASE, // 99 + KC_SYSREQ, // 9A + KC_CANCEL, // 9B + KC_CLEAR, // 9C + KC_PRIOR, // 9D + KC_RETURN, // 9E + KC_SEPARATOR, // 9F + KC_OUT, // A0 + KC_OPER, // A1 + KC_CLEAR_AGAIN, // A2 + KC_CRSEL, // A3 + KC_EXSEL, // A4 - /* NOTE: 0xA5-DF are used for internal special purpose */ - -#if 0 - /* NOTE: Following codes(0xB0-DD) are not used. Leave them for reference. */ - KC_KP_00 = 0xB0, - KC_KP_000, - KC_THOUSANDS_SEPARATOR, - KC_DECIMAL_SEPARATOR, - KC_CURRENCY_UNIT, - KC_CURRENCY_SUB_UNIT, - KC_KP_LPAREN, - KC_KP_RPAREN, - KC_KP_LCBRACKET, /* { */ - KC_KP_RCBRACKET, /* } */ - KC_KP_TAB, - KC_KP_BSPACE, - KC_KP_A, - KC_KP_B, - KC_KP_C, - KC_KP_D, - KC_KP_E, /* 0xC0 */ - KC_KP_F, - KC_KP_XOR, - KC_KP_HAT, - KC_KP_PERC, - KC_KP_LT, - KC_KP_GT, - KC_KP_AND, - KC_KP_LAZYAND, - KC_KP_OR, - KC_KP_LAZYOR, - KC_KP_COLON, - KC_KP_HASH, - KC_KP_SPACE, - KC_KP_ATMARK, - KC_KP_EXCLAMATION, - KC_KP_MEM_STORE, /* 0xD0 */ - KC_KP_MEM_RECALL, - KC_KP_MEM_CLEAR, - KC_KP_MEM_ADD, - KC_KP_MEM_SUB, - KC_KP_MEM_MUL, - KC_KP_MEM_DIV, - KC_KP_PLUS_MINUS, - KC_KP_CLEAR, - KC_KP_CLEAR_ENTRY, - KC_KP_BINARY, - KC_KP_OCTAL, - KC_KP_DECIMAL, - KC_KP_HEXADECIMAL, /* 0xDD */ -#endif + /* NOTE: Following code range(0xB0-DD) are shared with special codes of 8-bit keymap */ + KC_KP_00 = 0xB0, + KC_KP_000, // B1 + KC_THOUSANDS_SEPARATOR, // B2 + KC_DECIMAL_SEPARATOR, // B3 + KC_CURRENCY_UNIT, // B4 + KC_CURRENCY_SUB_UNIT, // B5 + KC_KP_LPAREN, // B6 + KC_KP_RPAREN, // B7 + KC_KP_LCBRACKET, // B8 { + KC_KP_RCBRACKET, // B9 } + KC_KP_TAB, // BA + KC_KP_BSPACE, // BB + KC_KP_A, // BC + KC_KP_B, // BD + KC_KP_C, // BE + KC_KP_D, // BF + KC_KP_E, // C0 + KC_KP_F, // C1 + KC_KP_XOR, // C2 + KC_KP_HAT, // C3 + KC_KP_PERC, // C4 + KC_KP_LT, // C5 + KC_KP_GT, // C6 + KC_KP_AND, // C7 + KC_KP_LAZYAND, // C8 + KC_KP_OR, // C9 + KC_KP_LAZYOR, // CA + KC_KP_COLON, // CB + KC_KP_HASH, // CC + KC_KP_SPACE, // CD + KC_KP_ATMARK, // CE + KC_KP_EXCLAMATION, // CF + KC_KP_MEM_STORE, // D0 + KC_KP_MEM_RECALL, // D1 + KC_KP_MEM_CLEAR, // D2 + KC_KP_MEM_ADD, // D3 + KC_KP_MEM_SUB, // D4 + KC_KP_MEM_MUL, // D5 + KC_KP_MEM_DIV, // D6 + KC_KP_PLUS_MINUS, // D7 + KC_KP_CLEAR, // D8 + KC_KP_CLEAR_ENTRY, // D9 + KC_KP_BINARY, // DA + KC_KP_OCTAL, // DB + KC_KP_DECIMAL, // DC + KC_KP_HEXADECIMAL, // DD /* Modifiers */ - KC_LCTRL = 0xE0, - KC_LSHIFT, - KC_LALT, - KC_LGUI, - KC_RCTRL, - KC_RSHIFT, - KC_RALT, - KC_RGUI, - - /* NOTE: 0xE8-FF are used for internal special purpose */ + KC_LCTRL = 0xE0, + KC_LSHIFT, // E1 + KC_LALT, // E2 + KC_LGUI, // E3 + KC_RCTRL, // E4 + KC_RSHIFT, // E5 + KC_RALT, // E6 + KC_RGUI, // E7 }; -/* Special keycodes */ -/* NOTE: 0xA5-DF and 0xE8-FF are used for internal special purpose */ +/* Special keycodes for 8-bit keymap + NOTE: 0xA5-DF and 0xE8-FF are used for internal special purpose */ enum internal_special_keycodes { /* System Control */ - KC_SYSTEM_POWER = 0xA5, - KC_SYSTEM_SLEEP, - KC_SYSTEM_WAKE, + KC_SYSTEM_POWER = 0xA5, + KC_SYSTEM_SLEEP, // A6 + KC_SYSTEM_WAKE, // A7 /* Media Control */ - KC_AUDIO_MUTE, - KC_AUDIO_VOL_UP, - KC_AUDIO_VOL_DOWN, - KC_MEDIA_NEXT_TRACK, - KC_MEDIA_PREV_TRACK, - KC_MEDIA_FAST_FORWARD, - KC_MEDIA_REWIND, - KC_MEDIA_STOP, - KC_MEDIA_PLAY_PAUSE, - KC_MEDIA_EJECT, - KC_MEDIA_SELECT, - KC_MAIL, - KC_CALCULATOR, - KC_MY_COMPUTER, - KC_WWW_SEARCH, - KC_WWW_HOME, - KC_WWW_BACK, - KC_WWW_FORWARD, - KC_WWW_STOP, - KC_WWW_REFRESH, - KC_WWW_FAVORITES, /* 0xBC */ + KC_AUDIO_MUTE, // A8 + KC_AUDIO_VOL_UP, // A9 + KC_AUDIO_VOL_DOWN, // AA + KC_MEDIA_NEXT_TRACK, // AB + KC_MEDIA_PREV_TRACK, // AC + KC_MEDIA_FAST_FORWARD, // AD + KC_MEDIA_REWIND, // AE + KC_MEDIA_STOP, // AF + KC_MEDIA_PLAY_PAUSE, // B0 + KC_MEDIA_EJECT, // B1 + KC_MEDIA_SELECT, // B2 + KC_MAIL, // B3 + KC_CALCULATOR, // B4 + KC_MY_COMPUTER, // B5 + KC_WWW_SEARCH, // B6 + KC_WWW_HOME, // B7 + KC_WWW_BACK, // B8 + KC_WWW_FORWARD, // B9 + KC_WWW_STOP, // BA + KC_WWW_REFRESH, // BB + KC_WWW_FAVORITES, // BC + KC_BRIGHTNESS_INC, // BD + KC_BRIGHTNESS_DEC, // BE /* Jump to bootloader */ - KC_BOOTLOADER = 0xBF, + KC_BOOTLOADER, // BF /* Fn key */ - KC_FN0 = 0xC0, - KC_FN1, - KC_FN2, - KC_FN3, - KC_FN4, - KC_FN5, - KC_FN6, - KC_FN7, - KC_FN8, - KC_FN9, - KC_FN10, - KC_FN11, - KC_FN12, - KC_FN13, - KC_FN14, - KC_FN15, - - KC_FN16 = 0xD0, - KC_FN17, - KC_FN18, - KC_FN19, - KC_FN20, - KC_FN21, - KC_FN22, - KC_FN23, - KC_FN24, - KC_FN25, - KC_FN26, - KC_FN27, - KC_FN28, - KC_FN29, - KC_FN30, - KC_FN31, /* 0xDF */ + KC_FN0, // C0 + KC_FN1, // C1 + KC_FN2, // C2 + KC_FN3, // C3 + KC_FN4, // C4 + KC_FN5, // C5 + KC_FN6, // C6 + KC_FN7, // C7 + KC_FN8, // C8 + KC_FN9, // C9 + KC_FN10, // CA + KC_FN11, // CB + KC_FN12, // CC + KC_FN13, // CD + KC_FN14, // CE + KC_FN15, // CF + KC_FN16, // D0 + KC_FN17, // D1 + KC_FN18, // D2 + KC_FN19, // D3 + KC_FN20, // D4 + KC_FN21, // D5 + KC_FN22, // D6 + KC_FN23, // D7 + KC_FN24, // D8 + KC_FN25, // D9 + KC_FN26, // DA + KC_FN27, // DB + KC_FN28, // DC + KC_FN29, // DD + KC_FN30, // DE + KC_FN31, // DF /**************************************/ /* 0xE0-E7 for Modifiers. DO NOT USE. */ /**************************************/ /* Mousekey */ - KC_MS_UP = 0xF0, - KC_MS_DOWN, - KC_MS_LEFT, - KC_MS_RIGHT, - KC_MS_BTN1, - KC_MS_BTN2, - KC_MS_BTN3, - KC_MS_BTN4, - KC_MS_BTN5, /* 0xF8 */ + KC_MS_UP = 0xF0, + KC_MS_DOWN, // F1 + KC_MS_LEFT, // F2 + KC_MS_RIGHT, // F3 + KC_MS_BTN1, // F4 + KC_MS_BTN2, // F5 + KC_MS_BTN3, // F6 + KC_MS_BTN4, // F7 + KC_MS_BTN5, // F8 /* Mousekey wheel */ - KC_MS_WH_UP, - KC_MS_WH_DOWN, - KC_MS_WH_LEFT, - KC_MS_WH_RIGHT, /* 0xFC */ + KC_MS_WH_UP, // F9 + KC_MS_WH_DOWN, // FA + KC_MS_WH_LEFT, // FB + KC_MS_WH_RIGHT, // FC /* Mousekey accel */ - KC_MS_ACCEL0, - KC_MS_ACCEL1, - KC_MS_ACCEL2 /* 0xFF */ + KC_MS_ACCEL0, // FD + KC_MS_ACCEL1, // FE + KC_MS_ACCEL2 // FF }; #endif /* KEYCODE_H */ diff --git a/common/keymap.c b/common/keymap.c index 01c6e642..617a1f70 100644 --- a/common/keymap.c +++ b/common/keymap.c @@ -1,5 +1,5 @@ /* -Copyright 2013,2016 Jun Wako +Copyright 2013,2016,2020 Jun Wako This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -145,7 +145,7 @@ static action_t keycode_to_action(uint8_t keycode) case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE: return (action_t)ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode)); break; - case KC_AUDIO_MUTE ... KC_WWW_FAVORITES: + case KC_AUDIO_MUTE ... KC_BRIGHTNESS_DEC: return (action_t)ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode)); break; case KC_MS_UP ... KC_MS_ACCEL2: @@ -155,9 +155,7 @@ static action_t keycode_to_action(uint8_t keycode) return (action_t)ACTION_TRANSPARENT; break; case KC_BOOTLOADER: - clear_keyboard(); - wait_ms(50); - bootloader_jump(); // not return + return (action_t)ACTION_COMMAND(COMMAND_BOOTLOADER, 0); break; default: return (action_t)ACTION_NO; diff --git a/common/matrix.c b/common/matrix.c index 9939307a..bfca5930 100644 --- a/common/matrix.c +++ b/common/matrix.c @@ -48,21 +48,21 @@ __attribute__ ((weak)) void matrix_print(void) { #if (MATRIX_COLS <= 8) - print("r/c 01234567\n"); + print("\n 01234567\n"); #elif (MATRIX_COLS <= 16) - print("r/c 0123456789ABCDEF\n"); + print("\n 0123456789ABCDEF\n"); #elif (MATRIX_COLS <= 32) - print("r/c 0123456789ABCDEF0123456789ABCDEF\n"); + print("\n 0123456789ABCDEF0123456789ABCDEF\n"); #endif for (uint8_t row = 0; row < MATRIX_ROWS; row++) { #if (MATRIX_COLS <= 8) - xprintf("%02X: %08b%s\n", row, bitrev(matrix_get_row(row)), + xprintf("%X:%08b%s\n", row&0xF, bitrev(matrix_get_row(row)), #elif (MATRIX_COLS <= 16) - xprintf("%02X: %016b%s\n", row, bitrev16(matrix_get_row(row)), + xprintf("%X:%016b%s\n", row&0xF, bitrev16(matrix_get_row(row)), #elif (MATRIX_COLS <= 32) - xprintf("%02X: %032b%s\n", row, bitrev32(matrix_get_row(row)), + xprintf("%X:%032b%s\n", row&0xF, bitrev32(matrix_get_row(row)), #endif #ifdef MATRIX_HAS_GHOST matrix_has_ghost_in_row(row) ? " +Copyright 2011,2012,2020 Jun Wako This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,9 +33,19 @@ along with this program. If not, see . #define MOUSE_BTN3 (1<<2) #define MOUSE_BTN4 (1<<3) #define MOUSE_BTN5 (1<<4) +#define MOUSE_BTN6 (1<<5) +#define MOUSE_BTN7 (1<<6) +#define MOUSE_BTN8 (1<<7) -/* Consumer Page(0x0C) - * following are supported by Windows: http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx + +/* + * USB HID Specifications + * https://www.usb.org/hid#approved-usage-table-review-requests + */ + +/* + * Consumer Page(0x0C) + * https://github.com/tmk/tmk_keyboard/issues/370 */ #define AUDIO_MUTE 0x00E2 #define AUDIO_VOL_UP 0x00E9 @@ -65,8 +75,13 @@ along with this program. If not, see . #define TRANSPORT_REWIND 0x00B4 #define TRANSPORT_EJECT 0x00B8 #define APPCONTROL_MINIMIZE 0x0206 +/* Display Brightness Controls https://www.usb.org/sites/default/files/hutrr41_0.pdf */ +#define BRIGHTNESS_INCREMENT 0x006F +#define BRIGHTNESS_DECREMENT 0x0070 -/* Generic Desktop Page(0x01) - system power control */ +/* + * Generic Desktop Page(0x01) - system power control + */ #define SYSTEM_POWER_DOWN 0x0081 #define SYSTEM_SLEEP 0x0082 #define SYSTEM_WAKE_UP 0x0083 @@ -179,7 +194,9 @@ typedef struct { (key == KC_WWW_FORWARD ? APPCONTROL_FORWARD : \ (key == KC_WWW_STOP ? APPCONTROL_STOP : \ (key == KC_WWW_REFRESH ? APPCONTROL_REFRESH : \ - (key == KC_WWW_FAVORITES ? APPCONTROL_BOOKMARKS : 0))))))))))))))))))))) + (key == KC_WWW_FAVORITES ? APPCONTROL_BOOKMARKS : \ + (key == KC_BRIGHTNESS_INC ? BRIGHTNESS_INCREMENT : \ + (key == KC_BRIGHTNESS_DEC ? BRIGHTNESS_DECREMENT : 0))))))))))))))))))))))) #ifdef __cplusplus } diff --git a/common/ringbuf.h b/common/ringbuf.h new file mode 100644 index 00000000..23bb41e0 --- /dev/null +++ b/common/ringbuf.h @@ -0,0 +1,73 @@ +#ifndef RINGBUF_H +#define RINGBUF_H + +#include +#include + +// NOTE: buffer size must be 2^n and up to 255. size_mask should be 2^n - 1 due to using &(AND) instead of %(modulo) +typedef struct { + uint8_t *buffer; + uint8_t head; + uint8_t tail; + uint8_t size_mask; +} ringbuf_t; + +static inline void ringbuf_init(ringbuf_t *buf, uint8_t *array, uint8_t size); +static inline int16_t ringbuf_get(ringbuf_t *buf); +static inline bool ringbuf_put(ringbuf_t *buf, uint8_t data); +static inline void ringbuf_write(ringbuf_t *buf, uint8_t data); +static inline bool ringbuf_is_empty(ringbuf_t *buf); +static inline bool ringbuf_is_full(ringbuf_t *buf); +static inline void ringbuf_reset(ringbuf_t *buf); + +static inline void ringbuf_init(ringbuf_t *buf, uint8_t *array, uint8_t size) +{ + buf->buffer = array; + buf->head = 0; + buf->tail = 0; + buf->size_mask = size - 1; +} +static inline int16_t ringbuf_get(ringbuf_t *buf) +{ + if (ringbuf_is_empty(buf)) return -1; + uint8_t data = buf->buffer[buf->tail]; + buf->tail++; + buf->tail &= buf->size_mask; + return data; +} +static inline bool ringbuf_put(ringbuf_t *buf, uint8_t data) +{ + if (ringbuf_is_full(buf)) { + return false; + } + buf->buffer[buf->head] = data; + buf->head++; + buf->head &= buf->size_mask; + return true; +} +// this overrides data in buffer when it is full +static inline void ringbuf_write(ringbuf_t *buf, uint8_t data) +{ + buf->buffer[buf->head] = data; + buf->head++; + buf->head &= buf->size_mask; + // eat tail: override data yet to be consumed + if (buf->head == buf->tail) { + buf->tail++; + buf->tail &= buf->size_mask; + } +} +static inline bool ringbuf_is_empty(ringbuf_t *buf) +{ + return (buf->head == buf->tail); +} +static inline bool ringbuf_is_full(ringbuf_t *buf) +{ + return (((buf->head + 1) & buf->size_mask) == buf->tail); +} +static inline void ringbuf_reset(ringbuf_t *buf) +{ + buf->head = 0; + buf->tail = 0; +} +#endif diff --git a/common/suspend.h b/common/suspend.h index 80617a82..f0a668cf 100644 --- a/common/suspend.h +++ b/common/suspend.h @@ -5,9 +5,17 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + void suspend_idle(uint8_t timeout); void suspend_power_down(void); bool suspend_wakeup_condition(void); void suspend_wakeup_init(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/common/timer.h b/common/timer.h index fe23f87a..3bd72e4a 100644 --- a/common/timer.h +++ b/common/timer.h @@ -25,7 +25,10 @@ along with this program. If not, see . #endif -#define TIMER_DIFF(a, b, max) ((a) >= (b) ? (a) - (b) : (max) - (b) + (a)) +#define TIMER_DIFF(a, b, max) ((max == UINT8_MAX) ? ((uint8_t)((a)-(b))) : ( \ + (max == UINT16_MAX) ? ((uint16_t)((a)-(b))) : ( \ + (max == UINT32_MAX) ? ((uint32_t)((a)-(b))) : ( \ + (a) >= (b) ? (a) - (b) : (max) + 1 - (b) + (a) )))) #define TIMER_DIFF_8(a, b) TIMER_DIFF(a, b, UINT8_MAX) #define TIMER_DIFF_16(a, b) TIMER_DIFF(a, b, UINT16_MAX) #define TIMER_DIFF_32(a, b) TIMER_DIFF(a, b, UINT32_MAX) diff --git a/common/unimap.c b/common/unimap.c index 84109b5a..fcdc93bd 100644 --- a/common/unimap.c +++ b/common/unimap.c @@ -25,8 +25,8 @@ keypos_t unimap_translate(keypos_t key) unimap_trans[key.row][key.col]; #endif return (keypos_t) { - .row = ((unimap_pos & 0xf0) >> 4), - .col = (unimap_pos & 0x0f) + .row = ((unimap_pos >> 4 ) & 0x07), + .col = (unimap_pos & 0x0F) }; } @@ -35,13 +35,13 @@ __attribute__ ((weak)) action_t action_for_key(uint8_t layer, keypos_t key) { keypos_t uni = unimap_translate(key); - if ((uni.row << 4 | uni.col) == UNIMAP_NO) { + if ((uni.row << 4 | uni.col) > 0x7F) { return (action_t)ACTION_NO; } #if defined(__AVR__) - return (action_t)pgm_read_word(&actionmaps[(layer)][(uni.row & 0x7)][(uni.col)]); + return (action_t)pgm_read_word(&actionmaps[(layer)][(uni.row & 0x07)][(uni.col & 0x0F)]); #else - return actionmaps[(layer)][(uni.row & 0x7)][(uni.col)]; + return actionmaps[(layer)][(uni.row & 0x07)][(uni.col & 0x0F)]; #endif } diff --git a/common/unimap.h b/common/unimap.h index 6a78d885..cd00e1d7 100644 --- a/common/unimap.h +++ b/common/unimap.h @@ -73,6 +73,25 @@ KANA: Japanese かな(Hiragana/Katakana) AC_##K78, AC_##K79, AC_##K7A, AC_##K7B, AC_##K7C, AC_##K7D, AC_##K7E, AC_##K7F } /* 78-7F */ \ } + +/* Matrix poision for Universal 128-key keyboard + ,-----------------------------------------------. + | 68| 69| 6A| 6B| 6C| 6D| 6E| 6F| 70| 71| 72| 73| +,---. |-----------------------------------------------| ,-----------. ,-----------. +| 29| | 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 42| 43| 44| 45| | 46| 47| 48| | 01| 02| 03| +`---' `-----------------------------------------------' `-----------' `-----------' +,-----------------------------------------------------------. ,-----------. ,---------------. +| 35| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 2D| 2E| 74| 2A| | 49| 4A| 4B| | 53| 54| 55| 56| +|-----------------------------------------------------------| |-----------| |---------------| +| 2B| 14| 1A| 08| 15| 17| 1C| 18| 0C| 12| 13| 2F| 30| 31| | 4C| 4D| 4E| | 5F| 60| 61| 57| +|-----------------------------------------------------------| `-----------' |---------------| +| 39| 04| 16| 07| 09| 0A| 0B| 0D| 0E| 0F| 33| 34| 32| 28| | 5C| 5D| 5E| 66| +|-----------------------------------------------------------| ,---. |---------------| +| 79| 64| 1D| 1B| 06| 19| 05| 11| 10| 36| 37| 38| 75| 7D| | 52| | 59| 5A| 5B| 58| +|-----------------------------------------------------------| ,-----------. |---------------| +| 78| 7B| 7A| 77| 2C| 76| 00| 7E| 7F| 65| 7C| | 50| 51| 4F| | 62| 63| 67| +`-----------------------------------------------------------' `-----------' `---------------' +*/ // Universal map position codes enum unimap_position_codes { // logical name position(row << 4 | col) @@ -127,7 +146,7 @@ enum unimap_position_codes { UNIMAP_LBRACKET, // 0x2F UNIMAP_RBRACKET, // 0x30 UNIMAP_BSLASH, // 0x31 - UNIMAP_NONUS_HASH, // 0x32 ISO UK hasu + UNIMAP_NONUS_HASH, // 0x32 ISO UK hash UNIMAP_SCOLON, // 0x33 UNIMAP_QUOTE, // 0x34 UNIMAP_GRAVE, // 0x35 diff --git a/doc/USB_NKRO.txt b/doc/USB_NKRO.txt index d9f1d122..ddf79c25 100644 --- a/doc/USB_NKRO.txt +++ b/doc/USB_NKRO.txt @@ -155,6 +155,6 @@ AquaKeyTest.exe http://geekhack.org/showthread.php?t=6643 Linux: xkeycaps xev -showkeys +showkey EOF diff --git a/doc/build.md b/doc/build.md index 57a36ac4..cf3e5277 100644 --- a/doc/build.md +++ b/doc/build.md @@ -10,33 +10,33 @@ Download and Install 2. **Programmer** Install [dfu-programmer][dfu-prog]. GUI tool [Atmel FLIP][flip] also can be used on Windows. -3. **Driver** On Windows when you start DFU bootloader on the chip first time you will see **Found New Hardware Wizard** to install driver. If you install device driver properly you will find chip name like **ATmega32U4** under **LibUSB-Win32 Devices** tree on **Device Manager**. If not you shall need to update its driver on **Device Manager**. You will find the driver in `FLIP` install directory like: `C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\`. In case of `dfu-programmer` install driver distributed with it. +3. **Driver** On Windows when you start DFU bootloader on the chip for the first time you will see **Found New Hardware Wizard** to install driver. If you install the device driver properly you will find a chip name like **ATmega32U4** under the **LibUSB-Win32 Devices** tree in **Device Manager**. If not you will need to update its driver in **Device Manager**. You will find the driver in the `FLIP` install directory, something like this: `C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\`. For `dfu-programmer` install the driver distributed with it. -If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader]. +If you use a PJRC Teensy you don't need step 2 and 3 above, just get the [Teensy loader][teensy-loader]. -### 2. Download source -You can find firmware source at github: +### 2. Download Source +You can find the firmware source on github: - -If you are familiar with [`git`][git] tools you are recommended to use it but you can also download zip archive from: +If you are familiar with [`git`][git] tools you can use that; otherwise you can download the zip archive from: - -Build firmware +Build Firmware -------------- -### 1. Open terminal -Open terminal window to get access to commands. Use Cygwin(or MingGW) shell terminal in Windows or `Terminal.app` on Mac OSX. +### 1. Open Terminal +Open a terminal window. Use the Cygwin (or MingGW) shell terminal on Windows, the `Terminal.app` on Mac OSX, and whatever terminal you like on Linux. -### 2. Change directory -Move to project directory in the firmware source. +### 2. Change Directory +Move to the project directory in the firmware source. cd tmk_keyboard/{'keyboard' or 'converter'}/ ### 3. Make -Build firmware using GNU `make` command. You'll see `_.hex` file in that directory unless something unexpected occurs in build process. +Build the firmware using the GNU `make` command. You'll see a `_.hex` file in that directory unless something unexpected occurs in build process. make -f Makefile. clean @@ -47,16 +47,17 @@ Build firmware using GNU `make` command. You'll see `_.hex` fi Program Controller ------------------ -Now you have **hex** file to program on current directory. This **hex** is only needed to program your controller, other files are used for development and you may leave and forget them. +Now you have a **hex** file in the current directory. This **hex** file is only needed to program your controller, other files are used for development and you may leave and forget them. -### 1. Start bootloader -How to program controller depends on controller chip and its board design. To program AVR USB chips you'll need to start it up in bootloader mode. Most of boards with the chip have a push button to let bootloader come up. Consult with your controller board manual. +### 1. Start Bootloader +How you program the controller depends on the controller chip and its board design. To program an AVR USB chip you'll need to start it up in bootloader mode. Most boards have a push-button to load the bootloader. Consult with your controller board's manual. + ### 2. Program with DFU bootloader -Stock AVR USB chips have DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. `FLIP` has two version of tool, GUI app and command line program. If you want GUI see tutorial below. Open source alternative `dfu-programmer` also supports AVR chips, it is command line tool and runs on Linux, Mac OSX and even Windows. +Stock AVR USB chips have the DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. `FLIP` has two version of the tool, a GUI app and a command line program. If you want the GUI see the tutorial below. An open source alternative, `dfu-programmer`, also supports AVR chips; it is a command line tool and runs on Linux, Mac OSX and even Windows. -To program with command of `FLIP` run this. Note that you need to set PATH variable properly. +To program with the command line version of `FLIP` run this. Note that you need to set the PATH variable properly. $ make -f Makefile. flip @@ -70,16 +71,16 @@ Or you can execute the command directly as the following. $ dfu-programmer flash $ dfu-programmer reset -`` part will be `atmega32u4` or `atmega32u2` in most cases. See manual of the command for the detail. On Linux and Mac OSX you will need proper permission to program a controller and you can use `sudo` command for this purpose probably. On Linux you also can configure `udev` rules to set permission. +The `` part will be `atmega32u4` or `atmega32u2` in most cases. See the manual of the command for details. On Linux and Mac OSX you will need proper permissions to program a controller and you can probably use `sudo` command for this purpose. On Linux you also can configure `udev` rules to set permissions. -#### FLIP GUI tutorial -1. On menu bar click **Device** -> **Select**, then choose your chip name. (In most cases **ATmega32U2** or **ATmega32U4**) -2. On menu bar click **Settings** -> **Communication** -> **USB**, then click **Open** button on **USB Port Connection** dialog. At this point you'll have to plug into USB and start bootloader. +#### FLIP GUI Tutorial +1. In the menu bar click **Device** -> **Select**, then choose your chip name. (In most cases **ATmega32U2** or **ATmega32U4**) +2. In the menu bar click **Settings** -> **Communication** -> **USB**, then click the **Open** button in the **USB Port Connection** dialog. At this point you'll have to plug into USB and start the bootloader. -3. On menu bar click **File** -> **Load HEX File**, then select your firmware hex file on File Selector dialog. -4. On **Operations Flow** panel click **Run** button to load the firmware binary to the chip. Note that you should keep **Erase**, **Blank Check**, **Program** and **Verify** check boxes selected. -5. Re-plug USB cord or click **Start Application** button to restart your controller. +3. In the menu bar click **File** -> **Load HEX File**, then select your firmware hex file in the File Selector dialog. +4. In the **Operations Flow** panel click the **Run** button to load the firmware binary to the chip. Note that you should keep the **Erase**, **Blank Check**, **Program** and **Verify** check boxes selected. +5. Re-connect the USB cord or click the **Start Application** button to restart your controller. Done. See also these instructions if needed. @@ -88,17 +89,17 @@ See also these instructions if needed. - -##### Troubleshoot +##### Troubleshooting * **FLIP: AtLibUsbDfu.dll not found** -Remove current driver and re-install one FLIP provides from DeviceManager of WIndows. See +Remove the current driver and re-install the one FLIP provides from DeviceManager of Windows. See -### 3. Program with Other programmer -If you are using PJRC Teensy consult with instruction of [Teensy Loader][teensy-loader]. Or run this target with `make` after you install command line version of it. +### 3. Program with Another Programmer +If you are using a PJRC Teensy consult with the instructions for [Teensy Loader][teensy-loader]. Or run this target with `make` after you install the command line version of it. $ make -f Makefile. teensy -You may want to use other programmer like [`avrdude`][avrdude]. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in Makefile. See below. +You may want to use another programmer like [`avrdude`][avrdude]. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in the Makefile. See below. $ make -f Makefile. program @@ -132,10 +133,10 @@ Set your MCU and its clock in Hz. # LUFA bootloader 4096 OPT_DEFS += -DBOOTLOADER_SIZE=4096 -If you are using PJRC Teensy use `512` for `BOOTLOADER_SIZE`, otherwise use `4096` unless you are sure. +If you are using a PJRC Teensy use `512` for `BOOTLOADER_SIZE`, otherwise use `4096` unless you are sure. ### 2. Features -Optional. Note that ***comment out*** with `#` to disable them. +Optional. Note that you can ***comment out*** lines with `#` to disable them. BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) @@ -147,7 +148,7 @@ Optional. Note that ***comment out*** with `#` to disable them. #BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality ### 3. Programmer -Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`. +Optional. Set the proper command for your controller, bootloader, and programmer. This command can be used with `make program`. # avrdude with AVRISPmkII PROGRAM_CMD = avrdude -p $(MCU) -c avrispmkII -P USB -U flash:w:$(TARGET).hex @@ -162,7 +163,7 @@ Optional. Set proper command for your controller, bootloader and programmer. Thi Config.h Options ---------------- -### 1. Magic command key combination +### 1. Magic Command Key Combination #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT))) diff --git a/doc/hook.txt b/doc/hook.md similarity index 54% rename from doc/hook.txt rename to doc/hook.md index 1689034e..0cebf858 100644 --- a/doc/hook.txt +++ b/doc/hook.md @@ -6,17 +6,19 @@ The following hooks are available available: Hook function | Timing --------------------------------|----------------------------------------------- -`hook_early_init(void)` | Early in the boot process, before the matrix is initialized and before a connection is made with the host. Thus, this hook has access to very few parameters, but it is a good place to define any custom parameters needed by other early processes. -`hook_late_init(void)` | Near the end of the boot process, after Boot Magic has run and LEDs have been initialized. -`hook_bootmagic(void)` | During the Boot Magic window, after EEPROM and Bootloader checks are made, but before any other built-in Boot Magic checks are made. -`hook_usb_wakeup(void)` | When the device wakes up from USB suspend state. -`hook_usb_suspend_entry(void)` | When the device enters USB suspend state. -`hook_usb_suspend_loop(void)` | Continuously, while the device is in USB suspend state. *Default action:* power down and periodically check the matrix, causing wakeup if needed. -`hook_keyboard_loop(void)` | Continuously, during the main loop, after the matrix is checked. -`hook_matrix_change(keyevent_t event)` | When a matrix state change is detected, before any other actions are processed. -`hook_layer_change(uint32_t layer_state)` | When any layer is changed. -`hook_default_layer_change(uint32_t default_layer_state)` | When any default layer is changed. -`hook_keyboard_leds_change(uint8_t led_status)` | Whenever a change in the LED status is performed. *Default action:* call `keyboard_set_leds(led_status)` +`void hook_early_init(void)` | Early in the boot process, before the matrix is initialized and before a connection is made with the host. Thus, this hook has access to very few parameters, but it is a good place to define any custom parameters needed by other early processes. +`void hook_late_init(void)` | Near the end of the boot process, after Boot Magic has run and LEDs have been initialized. +`void hook_bootmagic(void)` | During the Boot Magic window, after EEPROM and Bootloader checks are made, but before any other built-in Boot Magic checks are made. +`void hook_usb_startup_wait_loop(void)` | Continuously, until the device gets ready and into USB configured state. +`void hook_usb_wakeup(void)` | When the device wakes up from USB suspend state. +`void hook_usb_suspend_entry(void)` | When the device enters USB suspend state. +`void hook_usb_suspend_loop(void)` | Continuously, while the device is in USB suspend state. *Default action:* power down and periodically check the matrix, causing wakeup if needed. +`void hook_keyboard_loop(void)` | Continuously, during the main loop, after the matrix is checked. +`void hook_matrix_change(keyevent_t event)` | When a matrix state change is detected, before any other actions are processed. +`void hook_layer_change(uint32_t layer_state)` | When any layer is changed. +`void hook_default_layer_change(uint32_t default_layer_state)` | When any default layer is changed. +`void hook_keyboard_leds_change(uint8_t led_status)` | Whenever a change in the LED status is performed. *Default action:* call `keyboard_set_leds(led_status)` +`bool hook_process_action(keyrecord_t *record)` | Before key event is processed by tmk_core. Return true if the event is consumed and default action is not needed. diff --git a/doc/keycode.txt b/doc/keycode.txt index 1712929c..ee4b4f6f 100644 --- a/doc/keycode.txt +++ b/doc/keycode.txt @@ -84,7 +84,7 @@ KC_PAUSE KC_PAUS 48 Keyboard Pause1 KC_INSERT KC_INS 49 Keyboard Insert1 KC_HOME 4A Keyboard Home1 KC_PGUP 4B Keyboard PageUp1 -KC_DELETE KC_DELETE 4C Keyboard Delete Forward +KC_DELETE KC_DEL 4C Keyboard Delete Forward KC_END 4D Keyboard End1 KC_PGDOWN KC_PGDN 4E Keyboard PageDown1 KC_RIGHT KC_RGHT 4F Keyboard RightArrow1 @@ -201,7 +201,7 @@ KC_MEDIA_STOP KC_MSTP Stop KC_MEDIA_FAST_FORWARD KC_MFFD Fast Forward KC_MEDIA_REWIND KC_MRWD Rewind KC_MEDIA_PLAY_PAUSE KC_MPLY Play/Pause -KC_EJCT KC_MEDIA_EJECT Stop/Eject +KC_MEDIA_EJECT KC_EJCT Stop/Eject KC_MEDIA_SELECT KC_MSEL AL Consumer Control Configuration KC_MAIL KC_MAIL AL Email Reader KC_CALCULATOR KC_CALC AL Calculator diff --git a/doc/keymap.md b/doc/keymap.md index 87b72e05..dfb80797 100644 --- a/doc/keymap.md +++ b/doc/keymap.md @@ -68,7 +68,7 @@ The **default layer** is the base keymap layer (0-31) which is always active and Note that the `default_layer_state` variable only determines the lowest value to which `layer_state` may be set, and that `default_layer_state` is used by the core firmware when determining the starting value of `layer_state` before applying changes. In other words, the default layer will *always* be set to *on* in `layer_state`. -The default layer is defined in the firmware by the `default_layer_state` variable, which is identical in format to the `layer_state` variable exlpained above. The value may be changed using the following functions: +The default layer is defined in the firmware by the `default_layer_state` variable, which is identical in format to the `layer_state` variable explained above. The value may be changed using the following functions: - `default_layer_state_set(state)` sets the state to the specified 32-bit integer value. - AND/OR/XOR functions set the state based on a boolean logic comparison between the current state and the specified 32-bit integer value: @@ -86,7 +86,7 @@ default_layer_state_set(1UL<<3); ### 0.2 Layer Precedence and Transparency -Note that ***higher layers have priority in the layer stack***. The firmware starts at the topmost active layer, and works down to the bottom to find the an active keycode. Once the search encounters any keycode other than **`KC_TRNS`** (transparent) on an active layer, the search is halted and the remaining lower layers aren't examined, even if they are active. +Note that ***higher layers have priority in the layer stack***. The firmware starts at the topmost active layer, and works down to the bottom to find an active keycode. Once the search encounters any keycode other than **`KC_TRNS`** (transparent) on an active layer, the search is halted and the remaining lower layers aren't examined, even if they are active. **Note:** a layer must be activated before it may be included in the stack search. @@ -140,7 +140,7 @@ You can find other keymap definitions in file `keymap.c` located on project dire * `-----------------------------------------------------------' * |Gui |Alt |Space |Alt |Gui| * `--------------------------------------------' - */ + */ KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, TRNS,BSPC, \ LCTL,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, \ @@ -158,7 +158,7 @@ You can find other keymap definitions in file `keymap.c` located on project dire * `-----------------------------------------------------------' * |Gui |Alt |Mb1 |Alt | | * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel + * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel */ KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ TAB, TRNS,TRNS,TRNS,TRNS,TRNS,WH_L,WH_D,WH_U,WH_R,TRNS,TRNS,TRNS,BSPC, \ @@ -194,7 +194,7 @@ See [`common/keycode.h`](../common/keycode.h) or keycode table below for the det - `KC_P1` to `KC_P0`, `KC_PDOT`, `KC_PCMM`, `KC_PSLS`, `KC_PAST`, `KC_PMNS`, `KC_PPLS`, `KC_PEQL`, `KC_PENT` for keypad. ### 1.2 Modifier -There are 8 modifiers which has discrimination between left and right. +There are 8 modifiers which has discrimination between left and right. - `KC_LCTL` and `KC_RCTL` for Control - `KC_LSFT` and `KC_RSFT` for Shift @@ -250,21 +250,30 @@ You can define these actions on *'A'* key and *'left shift'* modifier with: ACTION_KEY(KC_LSFT) #### 2.1.2 Modified key -This action is comprised of strokes of modifiers and a key. `Macro` action is needed if you want more complex key strokes. +This action is comprised of modifiers and a key. -Say you want to assign a key to `Shift + 1` to get character *'!'* or `Alt + Tab` to switch application windows. +Modified keys can be defined as below. Say you want to assign a key to `Shift + 1` to get character *'!'* or `Alt + Tab` to switch application windows. ACTION_MODS_KEY(MOD_LSFT, KC_1) ACTION_MODS_KEY(MOD_LALT, KC_TAB) + ACTION_MODS_KEY(MOD_LALT | MOD_LSFT, KC_TAB) -Or `Alt,Shift + Tab` can be defined. `ACTION_MODS_KEY(mods, key)` requires **4-bit modifier state** and a **keycode** as arguments. See `keycode.h` for `MOD_BIT()` macro. +These are identical to examples above. - ACTION_MODS_KEY(MOD_LALT | MOD_LSFT, KC_TAB) + ACTION_KEY(MOD_LSFT | KC_1) + ACTION_KEY(MOD_LALT | KC_TAB) + ACTION_KEY(MOD_LSFT | MOD_LALT | KC_TAB) #### 2.1.3 Multiple Modifiers Registers multiple modifiers with pressing a key. To specify multiple modifiers use `|`. - ACTION_MODS(MOD_ALT | MOD_LSFT) + ACTION_MODS(MOD_LALT | MOD_LSFT) + ACTION_MODS(MOD_LALT | MOD_LSFT | MOD_LCTL) + +These are identical to examples above. + + ACTION_KEY(MOD_LALT | MOD_LSFT, KC_NO) + ACTION_KEY(MOD_LALT | MOD_LSFT | MOD_LCTL, KC_NO) #### 2.1.3 Modifier with Tap key([Dual role][dual_role]) Works as a modifier key while holding, but registers a key on tap(press and release quickly). @@ -283,7 +292,7 @@ You can specify a **target layer** of action and **when the action is executed** + **layer**: `0`-`31` + **on**: { `ON_PRESS` | `ON_RELEASE` | `ON_BOTH` } -+ **bits**: 4-bit value and 1-bit mask bit ++ **bits**: 5-bit: 1-bit for mask and 4-bit for operand #### 2.2.1 Default Layer @@ -294,7 +303,7 @@ This sets Default Layer to given parameter `layer` and activate it. ACTION_DEFAULT_LAYER_SET(layer) -#### 2.2.2 Momentary +#### 2.2.2 Momentary Turns on `layer` momentarily while holding, in other words it activates when key is pressed and deactivate when released. ACTION_LAYER_MOMENTARY(layer) @@ -356,20 +365,44 @@ Turns on layer only and clear all layer on release.. #### 2.2.10 Bitwise operation - -**part** indicates which part of 32bit layer state(0-7). **bits** is 5-bit value. **on** indicates when the action is executed. +Performs bitwise operation(AND, OR, XOR, SET) against layer state. ACTION_LAYER_BIT_AND(part, bits, on) ACTION_LAYER_BIT_OR(part, bits, on) ACTION_LAYER_BIT_XOR(part, bits, on) ACTION_LAYER_BIT_SET(part, bits, on) -These actions works with parameters as following code. +`part` parameter indicates 0-based index(0-7) of where breaking 32-bit `layer_state` into eight nibbles(4-bit unit). - uint8_t shift = part*4; - uint32_t mask = (bits&0x10) ? ~(0xf< ((bits<) { + case BIT_AND: + layer_state = layer_state & (((bits&0xf)< (((bits&0xf)< text region + * | .text | + * | .fini9-0 | + * | | + * |------------| _etext + * | .data | + * | .bss | > data region + * | .noinit | + * | | + * |------------| 0x1D800 + * | .keymap | > keymap region(2KB) + * |------------| 0x1E000 + * | bootloader | 8KB + * +------------+ 0x1FFFF + * + * FIXME: Use this To fit to ATMega32U4 unimap address + * Flash Map of AT90USB(128KB) + * +------------+ 0x0000 + * | .vectors | + * | .progmem | + * | .init0-9 | > text region + * | .text | + * | .fini9-0 | + * | | + * |------------| _etext + * | .data | + * | .bss | > data region + * | .noinit | + * | | + * |------------| 0x6800 + * | .keymap | > keymap region(2KB) + * |------------| 0x7000 + * ~ ~ + * ~ ~ + * |------------| 0x1E000 + * | bootloader | 8KB + * +------------+ 0x1FFFF + */ + text (rx) : ORIGIN = 0, LENGTH = __TEXT_REGION_LENGTH__ + keymap (rw!x) : ORIGIN = 0x6800, LENGTH = 2K + data (rw!x) : ORIGIN = 0x800100, LENGTH = __DATA_REGION_LENGTH__ + eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = __EEPROM_REGION_LENGTH__ + fuse (rw!x) : ORIGIN = 0x820000, LENGTH = __FUSE_REGION_LENGTH__ + lock (rw!x) : ORIGIN = 0x830000, LENGTH = __LOCK_REGION_LENGTH__ + signature (rw!x) : ORIGIN = 0x840000, LENGTH = __SIGNATURE_REGION_LENGTH__ + user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = __USER_SIGNATURE_REGION_LENGTH__ +} +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + /* Internal text space or external memory. */ + .text : + { + *(.vectors) + KEEP(*(.vectors)) + /* For data that needs to reside in the lower 64k of progmem. */ + *(.progmem.gcc*) + /* PR 13812: Placing the trampolines here gives a better chance + that they will be in range of the code that uses them. */ + . = ALIGN(2); + __trampolines_start = . ; + /* The jump trampolines for the 16-bit limited relocs will reside here. */ + *(.trampolines) + *(.trampolines*) + __trampolines_end = . ; + /* avr-libc expects these data to reside in lower 64K. */ + *libprintf_flt.a:*(.progmem.data) + *libc.a:*(.progmem.data) + *(.progmem*) + . = ALIGN(2); + /* For future tablejump instruction arrays for 3 byte pc devices. + We don't relax jump/call instructions within these sections. */ + *(.jumptables) + *(.jumptables*) + /* For code that needs to reside in the lower 128k progmem. */ + *(.lowtext) + *(.lowtext*) + __ctors_start = . ; + *(.ctors) + __ctors_end = . ; + __dtors_start = . ; + *(.dtors) + __dtors_end = . ; + KEEP(SORT(*)(.ctors)) + KEEP(SORT(*)(.dtors)) + /* From this point on, we don't bother about wether the insns are + below or above the 16 bits boundary. */ + *(.init0) /* Start here after reset. */ + KEEP (*(.init0)) + *(.init1) + KEEP (*(.init1)) + *(.init2) /* Clear __zero_reg__, set up stack pointer. */ + KEEP (*(.init2)) + *(.init3) + KEEP (*(.init3)) + *(.init4) /* Initialize data and BSS. */ + KEEP (*(.init4)) + *(.init5) + KEEP (*(.init5)) + *(.init6) /* C++ constructors. */ + KEEP (*(.init6)) + *(.init7) + KEEP (*(.init7)) + *(.init8) + KEEP (*(.init8)) + *(.init9) /* Call main(). */ + KEEP (*(.init9)) + *(.text) + . = ALIGN(2); + *(.text.*) + . = ALIGN(2); + *(.fini9) /* _exit() starts here. */ + KEEP (*(.fini9)) + *(.fini8) + KEEP (*(.fini8)) + *(.fini7) + KEEP (*(.fini7)) + *(.fini6) /* C++ destructors. */ + KEEP (*(.fini6)) + *(.fini5) + KEEP (*(.fini5)) + *(.fini4) + KEEP (*(.fini4)) + *(.fini3) + KEEP (*(.fini3)) + *(.fini2) + KEEP (*(.fini2)) + *(.fini1) + KEEP (*(.fini1)) + *(.fini0) /* Infinite loop after program termination. */ + KEEP (*(.fini0)) + _etext = . ; + } > text + .data : + { + PROVIDE (__data_start = .) ; + *(.data) + *(.data*) + *(.gnu.linkonce.d*) + *(.rodata) /* We need to include .rodata here if gcc is used */ + *(.rodata*) /* with -fdata-sections. */ + *(.gnu.linkonce.r*) + . = ALIGN(2); + _edata = . ; + PROVIDE (__data_end = .) ; + } > data AT> text + .bss ADDR(.data) + SIZEOF (.data) : AT (ADDR (.bss)) + { + PROVIDE (__bss_start = .) ; + *(.bss) + *(.bss*) + *(COMMON) + PROVIDE (__bss_end = .) ; + } > data + __data_load_start = LOADADDR(.data); + __data_load_end = __data_load_start + SIZEOF(.data); + /* Global data not cleared after reset. */ + .noinit ADDR(.bss) + SIZEOF (.bss) : AT (ADDR (.noinit)) + { + PROVIDE (__noinit_start = .) ; + *(.noinit*) + PROVIDE (__noinit_end = .) ; + _end = . ; + PROVIDE (__heap_start = .) ; + } > data + /* keymap region is located at end of flash + * .fn_actions Fn actions definitions + * .keymaps Mapping layers + */ + .keymap : + { + PROVIDE(__keymap_start = .) ; + *(.keymap.fn_actions) /* 32*actions = 64bytes */ + . = ALIGN(0x40); + *(.keymap.keymaps) /* rest of .keymap section */ + *(.keymap*) + /* . = ALIGN(0x800); */ /* keymap section takes 2KB- */ + } > keymap = 0x00 /* zero fill */ + .eeprom : + { + /* See .data above... */ + KEEP(*(.eeprom*)) + __eeprom_end = . ; + } > eeprom + .fuse : + { + KEEP(*(.fuse)) + KEEP(*(.lfuse)) + KEEP(*(.hfuse)) + KEEP(*(.efuse)) + } > fuse + .lock : + { + KEEP(*(.lock*)) + } > lock + .signature : + { + KEEP(*(.signature*)) + } > signature + .user_signatures : + { + KEEP(*(.user_signatures*)) + } > user_signatures + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .note.gnu.build-id : { *(.note.gnu.build-id) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* DWARF 3 */ + .debug_pubtypes 0 : { *(.debug_pubtypes) } + .debug_ranges 0 : { *(.debug_ranges) } + /* DWARF Extension. */ + .debug_macro 0 : { *(.debug_macro) } +} diff --git a/protocol.mk b/protocol.mk index 2bf05742..47265d80 100644 --- a/protocol.mk +++ b/protocol.mk @@ -26,13 +26,6 @@ ifeq (yes,$(strip $(PS2_USE_USART))) endif -ifeq (yes,$(strip $(XT_USE_INT))) - SRC += protocol/xt_interrupt.c - SRC += protocol/xt_io_avr.c - OPT_DEFS += -DXT_USE_INT -endif - - ifeq (yes,$(strip $(SERIAL_MOUSE_MICROSOFT_ENABLE))) SRC += $(PROTOCOL_DIR)/serial_mouse_microsoft.c OPT_DEFS += -DSERIAL_MOUSE_ENABLE -DSERIAL_MOUSE_MICROSOFT \ diff --git a/protocol/adb.c b/protocol/adb.c index 164255ef..36005951 100644 --- a/protocol/adb.c +++ b/protocol/adb.c @@ -1,5 +1,5 @@ /* -Copyright 2011 Jun WAKO +Copyright 2011-19 Jun WAKO Copyright 2013 Shay Green This software is licensed with a Modified BSD License. @@ -41,6 +41,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include "adb.h" +#include "print.h" // GCC doesn't inline functions normally @@ -92,84 +93,167 @@ uint16_t adb_host_kbd_recv(uint8_t addr) } #ifdef ADB_MOUSE_ENABLE +__attribute__ ((weak)) void adb_mouse_init(void) { - return; + return; } -uint16_t adb_host_mouse_recv(void) -{ - return adb_host_talk(ADB_ADDR_MOUSE, ADB_REG_0); +__attribute__ ((weak)) +void adb_mouse_task(void) { + return; } #endif -uint16_t adb_host_talk(uint8_t addr, uint8_t reg) +// This sends Talk command to read data from register and returns length of the data. +uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len) { - uint16_t data = 0; + for (int8_t i =0; i < len; i++) buf[i] = 0; + cli(); attention(); - send_byte((addr<<4) | (ADB_CMD_TALK<<2) | reg); + send_byte((addr<<4) | ADB_CMD_TALK | reg); place_bit0(); // Stopbit(0) + // TODO: Service Request(Srq): + // Device holds low part of comannd stopbit for 140-260us + // + // Command: + // ......._ ______________________ ___ ............_ ------- + // | | | | | | | + // Command | | | | | Data bytes | | + // ........|___| | 140-260 |__| |_............|___| + // |stop0 | Tlt Stop-to-Start |start1| |stop0 | + // + // Command without data: + // ......._ __________________________ + // | | + // Command | | + // ........|___| | 140-260 | + // |stop0 | Tlt Stop-to-Start | + // + // Service Request: + // ......._ ______ ___ ............_ ------- + // | 140-260 | | | | | | + // Command | Service Request | | | | Data bytes | | + // ........|___________________| |__| |_............|___| + // |stop0 | |start1| |stop0 | + // ......._ __________ + // | 140-260 | + // Command | Service Request | + // ........|___________________| + // |stop0 | + // This can be happened? + // ......._ ______________________ ___ ............_ ----- + // | | | | | | 140-260 | + // Command | | | | | Data bytes | Service Request | + // ........|___| | 140-260 |__| |_............|_________________| + // |stop0 | Tlt Stop-to-Start |start1| |stop0 | + // + // "Service requests are issued by the devices during a very specific time at the + // end of the reception of the command packet. + // If a device in need of service issues a service request, it must do so within + // the 65 µs of the Stop Bit’s low time and maintain the line low for a total of 300 µs." + // + // "A device sends a Service Request signal by holding the bus low during the low + // portion of the stop bit of any command or data transaction. The device must lengthen + // the stop by a minimum of 140 J.lS beyond its normal duration, as shown in Figure 8-15." + // http://ww1.microchip.com/downloads/en/AppNotes/00591b.pdf if (!wait_data_hi(500)) { // Service Request(310us Adjustable Keyboard): just ignored + xprintf("R"); sei(); - return -30; // something wrong + return 0; } if (!wait_data_lo(500)) { // Tlt/Stop to Start(140-260us) sei(); - return 0; // No data to send + return 0; // No data from device(not error); + } + + // start bit(1) + if (!wait_data_hi(40)) { + xprintf("S"); + sei(); + return 0; + } + if (!wait_data_lo(100)) { + xprintf("s"); + sei(); + return 0; } - uint8_t n = 17; // start bit + 16 data bits + uint8_t n = 0; // bit count do { + // + // |<- bit_cell_max(130) ->| + // | |<- lo ->| + // | | |<-hi->| + // _______ + // | | | + // | 130-lo | lo-hi | + // |________| | + // uint8_t lo = (uint8_t) wait_data_hi(130); if (!lo) - goto error; + goto error; // no more bit or after stop bit uint8_t hi = (uint8_t) wait_data_lo(lo); if (!hi) - goto error; + goto error; // stop bit extedned by Srq? - hi = lo - hi; - lo = 130 - lo; + if (n/8 >= len) continue; // can't store in buf - data <<= 1; - if (lo < hi) { - data |= 1; + buf[n/8] <<= 1; + if ((130 - lo) < (lo - hi)) { + buf[n/8] |= 1; } - else if (n == 17) { - sei(); - return -20; - } - } - while ( --n ); - - // Stop bit can't be checked normally since it could have service request lenghtening - // and its high state never goes low. - if (!wait_data_hi(351) || wait_data_lo(91)) { - sei(); - return -21; } - sei(); - return data; + while ( ++n ); error: sei(); - return -n; + return n/8; } -void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l) +uint16_t adb_host_talk(uint8_t addr, uint8_t reg) +{ + uint8_t len; + uint8_t buf[8]; + len = adb_host_talk_buf(addr, reg, buf, 8); + if (len != 2) return 0; + return (buf[0]<<8 | buf[1]); +} + +void adb_host_listen_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len) { cli(); attention(); - send_byte((addr<<4) | (ADB_CMD_LISTEN<<2) | reg); + send_byte((addr<<4) | ADB_CMD_LISTEN | reg); place_bit0(); // Stopbit(0) + // TODO: Service Request _delay_us(200); // Tlt/Stop to Start place_bit1(); // Startbit(1) - send_byte(data_h); - send_byte(data_l); + for (int8_t i = 0; i < len; i++) { + send_byte(buf[i]); + //xprintf("%02X ", buf[i]); + } place_bit0(); // Stopbit(0); sei(); } +void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l) +{ + uint8_t buf[2] = { data_h, data_l }; + adb_host_listen_buf(addr, reg, buf, 2); +} + +void adb_host_flush(uint8_t addr) +{ + cli(); + attention(); + send_byte((addr<<4) | ADB_CMD_FLUSH); + place_bit0(); // Stopbit(0) + _delay_us(200); // Tlt/Stop to Start + sei(); +} + // send state of LEDs void adb_host_kbd_led(uint8_t addr, uint8_t led) { diff --git a/protocol/adb.h b/protocol/adb.h index a8b97ea5..5e155cbc 100644 --- a/protocol/adb.h +++ b/protocol/adb.h @@ -1,5 +1,5 @@ /* -Copyright 2011 Jun WAKO +Copyright 2011-19 Jun WAKO This software is licensed with a Modified BSD License. All of this is supposed to be Free Software, Open Source, DFSG-free, @@ -54,16 +54,28 @@ POSSIBILITY OF SUCH DAMAGE. /* ADB commands */ // Default Address +#define ADB_ADDR_0 0 #define ADB_ADDR_DONGLE 1 #define ADB_ADDR_KEYBOARD 2 #define ADB_ADDR_MOUSE 3 #define ADB_ADDR_TABLET 4 #define ADB_ADDR_APPLIANCE 7 +#define ADB_ADDR_8 8 +#define ADB_ADDR_9 9 +#define ADB_ADDR_10 10 +#define ADB_ADDR_11 11 +#define ADB_ADDR_12 12 +#define ADB_ADDR_13 13 +#define ADB_ADDR_14 14 +#define ADB_ADDR_15 15 +// for temporary purpose, do not use for polling +#define ADB_ADDR_TMP 15 +#define ADB_ADDR_MOUSE_POLL 10 // Command Type #define ADB_CMD_RESET 0 #define ADB_CMD_FLUSH 1 -#define ADB_CMD_LISTEN 2 -#define ADB_CMD_TALK 3 +#define ADB_CMD_LISTEN 8 +#define ADB_CMD_TALK 12 // Register #define ADB_REG_0 0 #define ADB_REG_1 1 @@ -76,16 +88,22 @@ POSSIBILITY OF SUCH DAMAGE. #define ADB_HANDLER_M0115 0x02 #define ADB_HANDLER_M3501 0x02 #define ADB_HANDLER_M1242_ANSI 0x10 -#define ADB_HANDLER_EXTENDED_PROTOCOL 0x03 +#define ADB_HANDLER_EXTENDED_KEYBOARD 0x03 +#define ADB_HANDLER_CLASSIC1_MOUSE 0x01 +#define ADB_HANDLER_CLASSIC2_MOUSE 0x02 +#define ADB_HANDLER_EXTENDED_MOUSE 0x04 +#define ADB_HANDLER_TURBO_MOUSE 0x32 // ADB host void adb_host_init(void); bool adb_host_psw(void); uint16_t adb_host_kbd_recv(uint8_t addr); -uint16_t adb_host_mouse_recv(void); uint16_t adb_host_talk(uint8_t addr, uint8_t reg); +uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len); void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l); +void adb_host_listen_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len); +void adb_host_flush(uint8_t addr); void adb_host_kbd_led(uint8_t addr, uint8_t led); void adb_mouse_task(void); void adb_mouse_init(void); diff --git a/protocol/chibios/README.md b/protocol/chibios/README.md index 2fadc799..49b0dfd3 100644 --- a/protocol/chibios/README.md +++ b/protocol/chibios/README.md @@ -4,9 +4,15 @@ This code can be used to run TMK keyboard logic on top of [ChibiOS], meaning tha ### Usage -- To use, get a [zip file](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip) of ChibiOS and unpack/rename it to `tmk_core/tool/chibios/ChibiOS`; or you can just clone [ChibiOS repo](https://github.com/ChibiOS/ChibiOS) there. For Freescale/NXP Kinetis support (meaning Teensies 3.x/LC and the Infinity keyboard), you'll also need a [zip](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip) of ChibiOS-Contrib, unpacked/renamed to `tmk_core/tool/chibios/ChibiOS-Contrib`. Likewise, for git-savvy people, just clone [ChibiOS-Contrib repo](https://github.com/ChibiOS/ChibiOS-Contrib) there. -- Note: the above mentioned directories are the defaults. You can have the two ChibiOS repositories wherever you want, just define their location in `CHIBIOS` and `CHIBIOS_CONTRIB` variables in your `Makefile`. -- You will also need to install an ARM toolchain, for instance from [here](https://launchpad.net/gcc-arm-embedded). On linux, this is usually also present as a package for your distribution (as `gcc-arm` or something similar). On OS X, you can use [homebrew](http://brew.sh/) with an appropriate tap. +- To use, get a [zip file](https://github.com/ChibiOS/ChibiOS/archive/stable_17.6.x.zip) of ChibiOS and unpack/rename it to `tmk_core/tool/chibios/ChibiOS`; or you can just clone [ChibiOS/ChibiOS](https://github.com/ChibiOS/ChibiOS) there. +If you use git, make sure to check out the most recent stable branch such as `stable_17.6.x` +For Freescale/NXP Kinetis support (meaning Teensies 3.x/LC and the Infinity keyboard), you'll also need a [zip](https://github.com/ChibiOS/ChibiOS-Contrib/archive/master.zip) of ChibiOS-Contrib, unpacked/renamed to `tmk_core/tool/chibios/ChibiOS-Contrib`. +Likewise, for git-savvy people, just clone [ChibiOS/ChibiOS-Contrib](https://github.com/ChibiOS/ChibiOS-Contrib) there. +- Note: the above mentioned directories are the defaults. +You can have the two ChibiOS repositories wherever you want, just define their location in `CHIBIOS` and `CHIBIOS_CONTRIB` variables in your `Makefile`. +- You will also need to install an ARM toolchain, for instance from [here](https://launchpad.net/gcc-arm-embedded). +On linux, this is usually also present as a package for your distribution (as `gcc-arm` or something similar). +On OS X, you can use [homebrew](http://brew.sh/) with an appropriate tap. ### Notes diff --git a/protocol/ibm4704.c b/protocol/ibm4704.c index 6a03cd44..75e7db12 100644 --- a/protocol/ibm4704.c +++ b/protocol/ibm4704.c @@ -39,7 +39,7 @@ Data ____|__/ X____X____X____X____X____X____X____X____X____X \___ | Start 0 1 2 3 4 5 6 7 P Stop Request by host -Start bit: can be long as 300-350us. +Start bit: can be long as 300-350us during start up and upto 2500us while key scanning Request: Host pulls Clock line down to request to send a command. Timing: After Request keyboard pull up Data and down Clock line to low for start bit. After request host release Clock line once Data line becomes hi. @@ -58,7 +58,7 @@ uint8_t ibm4704_send(uint8_t data) clock_lo(); /* wait for Start bit(Clock:lo/Data:hi) */ - WAIT(data_hi, 300, 0x30); + WAIT(data_hi, 5000, 0x30); /* Data bit */ for (uint8_t i = 0; i < 8; i++) { @@ -89,7 +89,7 @@ uint8_t ibm4704_send(uint8_t data) return 0; ERROR: idle(); - if (ibm4704_error > 0x30) { + if (ibm4704_error >= 0x30) { xprintf("S:%02X ", ibm4704_error); } IBM4704_INT_ON(); diff --git a/protocol/ibmpc.c b/protocol/ibmpc.c new file mode 100644 index 00000000..0e94e301 --- /dev/null +++ b/protocol/ibmpc.c @@ -0,0 +1,421 @@ +/* +Copyright 2010,2011,2012,2013,2019 Jun WAKO + +This software is licensed with a Modified BSD License. +All of this is supposed to be Free Software, Open Source, DFSG-free, +GPL-compatible, and OK to use in both free and proprietary applications. +Additions and corrections to this file are welcome. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +* Neither the name of the copyright holders nor the names of + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * IBM PC keyboard protocol + */ + +#include +#include +#include +#include "ibmpc.h" +#include "debug.h" +#include "timer.h" +#include "wait.h" + + +#define WAIT(stat, us, err) do { \ + if (!wait_##stat(us)) { \ + ibmpc_error = err; \ + goto ERROR; \ + } \ +} while (0) + + +volatile uint16_t ibmpc_isr_debug = 0; +volatile uint8_t ibmpc_protocol = IBMPC_PROTOCOL_NO; +volatile uint8_t ibmpc_error = IBMPC_ERR_NONE; + +/* 2-byte buffer for data received from keyboard + * buffer states: + * FFFF: empty + * FFss: one data + * sstt: two data + * eeFF: error + * where ss, tt and ee are 0x00-0xFE. 0xFF means empty or no data in buffer. + */ +static volatile uint16_t recv_data = 0xFFFF; +/* internal state of receiving data */ +static volatile uint16_t isr_state = 0x8000; +static uint8_t timer_start = 0; + +void ibmpc_host_init(void) +{ + // initialize reset pin to HiZ + IBMPC_RST_HIZ(); + inhibit(); + IBMPC_INT_INIT(); + IBMPC_INT_OFF(); +} + +void ibmpc_host_enable(void) +{ + IBMPC_INT_ON(); + idle(); +} + +void ibmpc_host_disable(void) +{ + IBMPC_INT_OFF(); + inhibit(); +} + +int16_t ibmpc_host_send(uint8_t data) +{ + bool parity = true; + ibmpc_error = IBMPC_ERR_NONE; + + dprintf("w%02X ", data); + + IBMPC_INT_OFF(); + + /* terminate a transmission if we have */ + inhibit(); + wait_us(100); // [5]p.54 + + /* 'Request to Send' and Start bit */ + data_lo(); + wait_us(100); + clock_hi(); // [5]p.54 [clock low]>100us [5]p.50 + WAIT(clock_lo, 10000, 1); // [5]p.53, -10ms [5]p.50 + + /* Data bit[2-9] */ + for (uint8_t i = 0; i < 8; i++) { + wait_us(15); + if (data&(1< FFFF + // FFss(one data) -> FFFF + // sstt(two data) -> FFtt + // eeFF(errror) -> FFFF + recv_data = data | (((data&0xFF00) == 0xFF00) ? 0x00FF : 0xFF00); + } + + if ((data&0x00FF) == 0x00FF) { + // error: eeFF + switch (data>>8) { + case IBMPC_ERR_FF: + // 0xFF(Overrun/Error) from keyboard + dprintf("!FF! "); + ret = 0xFF; + break; + case IBMPC_ERR_FULL: + // buffer full + dprintf("!FULL! "); + ret = 0xFF; + break; + case 0xFF: + // empty: FFFF + return -1; + default: + // other errors + dprintf("e%02X ", data>>8); + return -1; + } + } else { + if ((data | 0x00FF) != 0xFFFF) { + // two data: sstt + dprintf("b:%04X ", data); + ret = (data>>8); + } else { + // one data: FFss + ret = (data&0x00FF); + } + } + + //dprintf("i%04X ", ibmpc_isr_debug); ibmpc_isr_debug = 0; + dprintf("r%02X ", ret); + return ret; +} + +int16_t ibmpc_host_recv_response(void) +{ + // Command may take 25ms/20ms at most([5]p.46, [3]p.21) + uint8_t retry = 25; + int16_t data = -1; + while (retry-- && (data = ibmpc_host_recv()) == -1) { + wait_ms(1); + } + return data; +} + +void ibmpc_host_isr_clear(void) +{ + ibmpc_isr_debug = 0; + ibmpc_protocol = 0; + ibmpc_error = 0; + isr_state = 0x8000; + recv_data = 0xFFFF; +} + +#define LO8(w) (*((uint8_t *)&(w))) +#define HI8(w) (*(((uint8_t *)&(w))+1)) +// NOTE: With this ISR data line can be read within 2us after clock falling edge. +// To read data line early as possible: +// write naked ISR with asembly code to read the line and call C func to do other job? +ISR(IBMPC_INT_VECT) +{ + uint8_t dbit; + dbit = IBMPC_DATA_PIN&(1<= 3) { + ibmpc_isr_debug = isr_state; + ibmpc_error = IBMPC_ERR_TIMEOUT; + goto ERROR; + + // timeout error recovery - start receiving new data + // it seems to work somehow but may not under unstable situation + //timer_start = t; + //isr_state = 0x8000; + } + } + + isr_state = isr_state>>1; + if (dbit) isr_state |= 0x8000; + + // isr_state: state of receiving data from keyboard + // + // This should be initialized with 0x8000 before receiving data and + // the MSB '*1' works as marker to discrimitate between protocols. + // It stores sampled bit at MSB after right shift on each clock falling edge. + // + // XT protocol has two variants of signaling; XT_IBM and XT_Clone. + // XT_IBM uses two start bits 0 and 1 while XT_Clone uses just start bit 1. + // https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol + // + // 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + // ----------------------------------------------------- + // *1 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 0 Initial state(0x8000) + // + // x x x x x x x x | 0 0 0 0 0 0 0 0 midway(0-7 bits received) + // x x x x x x x x | *1 0 0 0 0 0 0 0 midway(8 bits received) + // b6 b5 b4 b3 b2 b1 b0 1 | 0 *1 0 0 0 0 0 0 XT_IBM-midway ^1 + // b7 b6 b5 b4 b3 b2 b1 b0 | 0 *1 0 0 0 0 0 0 AT-midway ^1 + // b7 b6 b5 b4 b3 b2 b1 b0 | 1 *1 0 0 0 0 0 0 XT_Clone-done ^3 + // b6 b5 b4 b3 b2 b1 b0 1 | 1 *1 0 0 0 0 0 0 XT_IBM-error ^3 + // pr b7 b6 b5 b4 b3 b2 b1 | 0 0 *1 0 0 0 0 0 AT-midway[b0=0] + // b7 b6 b5 b4 b3 b2 b1 b0 | 1 0 *1 0 0 0 0 0 XT_IBM-done ^2 + // pr b7 b6 b5 b4 b3 b2 b1 | 1 0 *1 0 0 0 0 0 AT-midway[b0=1] ^2 + // b7 b6 b5 b4 b3 b2 b1 b0 | 1 1 *1 0 0 0 0 0 XT_IBM-error-done + // x x x x x x x x | x 1 1 0 0 0 0 0 illegal + // st pr b7 b6 b5 b4 b3 b2 | b1 b0 0 *1 0 0 0 0 AT-done + // x x x x x x x x | x x 1 *1 0 0 0 0 illegal + // all other states than above illegal + // + // ^1: AT and XT_IBM takes same state. + // ^2: AT and XT_IBM takes same state in case that AT b0 is 1, + // we have to check AT stop bit to discriminate between the two protocol. + switch (isr_state & 0xFF) { + case 0b00000000: + case 0b10000000: + case 0b01000000: // ^1 + case 0b00100000: + // midway + goto NEXT; + break; + case 0b11000000: // ^3 + { + uint8_t us = 100; + // wait for rising and falling edge of b7 of XT_IBM + while (!(IBMPC_CLOCK_PIN&(1<>8; + ibmpc_protocol = IBMPC_PROTOCOL_XT_CLONE; + goto DONE; + } + } + break; + case 0b11100000: + // XT_IBM-error-done + ibmpc_isr_debug = isr_state; + isr_state = isr_state>>8; + ibmpc_protocol = IBMPC_PROTOCOL_XT_ERROR; + goto DONE; + break; + case 0b10100000: // ^2 + { + uint8_t us = 100; + // wait for rising and falling edge of AT stop bit to discriminate between XT and AT + while (!(IBMPC_CLOCK_PIN&(1<>8; + ibmpc_protocol = IBMPC_PROTOCOL_XT_IBM; + goto DONE; + } + } + break; + case 0b00010000: + case 0b10010000: + case 0b01010000: + case 0b11010000: + // AT-done + // TODO: parity check? + ibmpc_isr_debug = isr_state; + // stop bit check + if (isr_state & 0x8000) { + ibmpc_protocol = IBMPC_PROTOCOL_AT; + } else { + // Zenith Z-150 AT(beige/white lable) asserts stop bit as low + // https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige + ibmpc_protocol = IBMPC_PROTOCOL_AT_Z150; + } + isr_state = isr_state>>6; + goto DONE; + break; + case 0b01100000: + case 0b00110000: + case 0b10110000: + case 0b01110000: + case 0b11110000: + default: // xxxx_oooo(any 1 in low nibble) + // Illegal + ibmpc_isr_debug = isr_state; + ibmpc_error = IBMPC_ERR_ILLEGAL; + goto ERROR; + break; + } + +ERROR: + // error: eeFF + recv_data = (ibmpc_error<<8) | 0x00FF; + goto CLEAR; +DONE: + if ((isr_state & 0x00FF) == 0x00FF) { + // receive error code 0xFF + ibmpc_error = IBMPC_ERR_FF; + goto ERROR; + } + if (HI8(recv_data) != 0xFF && LO8(recv_data) != 0xFF) { + // buffer full + ibmpc_error = IBMPC_ERR_FULL; + goto ERROR; + } + // store data + recv_data = recv_data<<8; + recv_data |= isr_state & 0xFF; +CLEAR: + // clear for next data + isr_state = 0x8000; +NEXT: + return; +} + +/* send LED state to keyboard */ +void ibmpc_host_set_led(uint8_t led) +{ + if (0xFA == ibmpc_host_send(0xED)) { + ibmpc_host_send(led); + } +} diff --git a/protocol/ibmpc.h b/protocol/ibmpc.h new file mode 100644 index 00000000..64bc2c8a --- /dev/null +++ b/protocol/ibmpc.h @@ -0,0 +1,204 @@ +/* +Copyright 2010,2011,2012,2013,2019 Jun WAKO + +This software is licensed with a Modified BSD License. +All of this is supposed to be Free Software, Open Source, DFSG-free, +GPL-compatible, and OK to use in both free and proprietary applications. +Additions and corrections to this file are welcome. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +* Neither the name of the copyright holders nor the names of + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef IBMPC_H +#define IBMPC_H + +#include +#include "wait.h" +#include "print.h" + +/* + * IBM PC keyboard protocol + * + * PS/2 Resources + * -------------- + * [1] The PS/2 Mouse/Keyboard Protocol + * http://www.computer-engineering.org/ps2protocol/ + * Concise and thorough primer of PS/2 protocol. + * + * [2] Keyboard and Auxiliary Device Controller + * http://www.mcamafia.de/pdf/ibm_hitrc07.pdf + * Signal Timing and Format + * + * [3] Keyboards(101- and 102-key) + * http://www.mcamafia.de/pdf/ibm_hitrc11.pdf + * Keyboard Layout, Scan Code Set, POR, and Commands. + * + * [4] PS/2 Reference Manuals + * http://www.mcamafia.de/pdf/ibm_hitrc07.pdf + * Collection of IBM Personal System/2 documents. + * + * [5] TrackPoint Engineering Specifications for version 3E + * https://web.archive.org/web/20100526161812/http://wwwcssrv.almaden.ibm.com/trackpoint/download.html + */ +#define IBMPC_ACK 0xFA +#define IBMPC_RESEND 0xFE +#define IBMPC_SET_LED 0xED + +#define IBMPC_PROTOCOL_NO 0 +#define IBMPC_PROTOCOL_AT 0x10 +#define IBMPC_PROTOCOL_AT_Z150 0x11 +#define IBMPC_PROTOCOL_XT 0x20 +#define IBMPC_PROTOCOL_XT_IBM 0x21 +#define IBMPC_PROTOCOL_XT_CLONE 0x22 +#define IBMPC_PROTOCOL_XT_ERROR 0x23 + +// Error numbers +#define IBMPC_ERR_NONE 0 +#define IBMPC_ERR_RECV 0x00 +#define IBMPC_ERR_SEND 0x10 +#define IBMPC_ERR_TIMEOUT 0x20 +#define IBMPC_ERR_FULL 0x40 +#define IBMPC_ERR_ILLEGAL 0x80 +#define IBMPC_ERR_FF 0xF0 + +#define IBMPC_LED_SCROLL_LOCK 0 +#define IBMPC_LED_NUM_LOCK 1 +#define IBMPC_LED_CAPS_LOCK 2 + + +extern volatile uint16_t ibmpc_isr_debug; +extern volatile uint8_t ibmpc_protocol; +extern volatile uint8_t ibmpc_error; + +void ibmpc_host_init(void); +void ibmpc_host_enable(void); +void ibmpc_host_disable(void); +int16_t ibmpc_host_send(uint8_t data); +int16_t ibmpc_host_recv_response(void); +int16_t ibmpc_host_recv(void); +void ibmpc_host_isr_clear(void); +void ibmpc_host_set_led(uint8_t usb_led); + + +/*-------------------------------------------------------------------- + * static functions + *------------------------------------------------------------------*/ +#if defined(__AVR__) +/* + * Clock + */ +static inline void clock_lo(void) +{ + IBMPC_CLOCK_PORT &= ~(1< - #include - #include - - #include - - #include "Config/AppConfig.h" - - /* Function Prototypes: */ - void BootloaderAPI_ErasePage(const uint32_t Address); - void BootloaderAPI_WritePage(const uint32_t Address); - void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word); - uint8_t BootloaderAPI_ReadSignature(const uint16_t Address); - uint8_t BootloaderAPI_ReadFuse(const uint16_t Address); - uint8_t BootloaderAPI_ReadLock(void); - void BootloaderAPI_WriteLock(const uint8_t LockBits); - -#endif - diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderAPITable.S b/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderAPITable.S deleted file mode 100644 index 69ebd387..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderAPITable.S +++ /dev/null @@ -1,91 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -; Trampolines to actual API implementations if the target address is outside the -; range of a rjmp instruction (can happen with large bootloader sections) -.section .apitable_trampolines, "ax" -.global BootloaderAPI_Trampolines -BootloaderAPI_Trampolines: - - BootloaderAPI_ErasePage_Trampoline: - jmp BootloaderAPI_ErasePage - BootloaderAPI_WritePage_Trampoline: - jmp BootloaderAPI_WritePage - BootloaderAPI_FillWord_Trampoline: - jmp BootloaderAPI_FillWord - BootloaderAPI_ReadSignature_Trampoline: - jmp BootloaderAPI_ReadSignature - BootloaderAPI_ReadFuse_Trampoline: - jmp BootloaderAPI_ReadFuse - BootloaderAPI_ReadLock_Trampoline: - jmp BootloaderAPI_ReadLock - BootloaderAPI_WriteLock_Trampoline: - jmp BootloaderAPI_WriteLock - BootloaderAPI_UNUSED1: - ret - BootloaderAPI_UNUSED2: - ret - BootloaderAPI_UNUSED3: - ret - BootloaderAPI_UNUSED4: - ret - BootloaderAPI_UNUSED5: - ret - - - -; API function jump table -.section .apitable_jumptable, "ax" -.global BootloaderAPI_JumpTable -BootloaderAPI_JumpTable: - - rjmp BootloaderAPI_ErasePage_Trampoline - rjmp BootloaderAPI_WritePage_Trampoline - rjmp BootloaderAPI_FillWord_Trampoline - rjmp BootloaderAPI_ReadSignature_Trampoline - rjmp BootloaderAPI_ReadFuse_Trampoline - rjmp BootloaderAPI_ReadLock_Trampoline - rjmp BootloaderAPI_WriteLock_Trampoline - rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 - rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 - rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 - rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 - rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 - - - -; Bootloader table signatures and information -.section .apitable_signatures, "ax" -.global BootloaderAPI_Signatures -BootloaderAPI_Signatures: - - .long BOOT_START_ADDR ; Start address of the bootloader - .word 0xDF00 ; Signature for the CDC class bootloader - .word 0xDCFB ; Signature for a LUFA class bootloader diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c b/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c deleted file mode 100644 index f66a483e..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c +++ /dev/null @@ -1,641 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Main source file for the CDC class bootloader. This file contains the complete bootloader logic. - */ - -#define INCLUDE_FROM_BOOTLOADERCDC_C -#include "BootloaderCDC.h" - -/** Contains the current baud rate and other settings of the first virtual serial port. This must be retained as some - * operating systems will not open the port unless the settings can be set successfully. - */ -static CDC_LineEncoding_t LineEncoding = { .BaudRateBPS = 0, - .CharFormat = CDC_LINEENCODING_OneStopBit, - .ParityType = CDC_PARITY_None, - .DataBits = 8 }; - -/** Current address counter. This stores the current address of the FLASH or EEPROM as set by the host, - * and is used when reading or writing to the AVRs memory (either FLASH or EEPROM depending on the issued - * command.) - */ -static uint32_t CurrAddress; - -/** Flag to indicate if the bootloader should be running, or should exit and allow the application code to run - * via a watchdog reset. When cleared the bootloader will exit, starting the watchdog and entering an infinite - * loop until the AVR restarts and the application runs. - */ -static bool RunBootloader = true; - -/** Magic lock for forced application start. If the HWBE fuse is programmed and BOOTRST is unprogrammed, the bootloader - * will start if the /HWB line of the AVR is held low and the system is reset. However, if the /HWB line is still held - * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value - * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start. - */ -uint16_t MagicBootKey ATTR_NO_INIT; - - -/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application - * start key has been loaded into \ref MagicBootKey. If the bootloader started via the watchdog and the key is valid, - * this will force the user application to start via a software jump. - */ -void Application_Jump_Check(void) -{ - bool JumpToApplication = false; - - #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) - /* Disable JTAG debugging */ - JTAG_DISABLE(); - - /* Enable pull-up on the JTAG TCK pin so we can use it to select the mode */ - PORTF |= (1 << 4); - Delay_MS(10); - - /* If the TCK pin is not jumpered to ground, start the user application instead */ - JumpToApplication |= ((PINF & (1 << 4)) != 0); - - /* Re-enable JTAG debugging */ - JTAG_ENABLE(); - #endif - - /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */ - if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) - JumpToApplication |= true; - - /* If a request has been made to jump to the user application, honor it */ - if (JumpToApplication) - { - /* Turn off the watchdog */ - MCUSR &= ~(1< 0xFFFF) - WriteNextResponseByte(pgm_read_byte_far(CurrAddress | HighByte)); - #else - WriteNextResponseByte(pgm_read_byte(CurrAddress | HighByte)); - #endif - - /* If both bytes in current word have been read, increment the address counter */ - if (HighByte) - CurrAddress += 2; - - HighByte = !HighByte; - } - else - { - /* Read the next EEPROM byte into the endpoint */ - WriteNextResponseByte(eeprom_read_byte((uint8_t*)(intptr_t)(CurrAddress >> 1))); - - /* Increment the address counter after use */ - CurrAddress += 2; - } - } - } - else - { - uint32_t PageStartAddress = CurrAddress; - - if (MemoryType == MEMORY_TYPE_FLASH) - { - boot_page_erase(PageStartAddress); - boot_spm_busy_wait(); - } - - while (BlockSize--) - { - if (MemoryType == MEMORY_TYPE_FLASH) - { - /* If both bytes in current word have been written, increment the address counter */ - if (HighByte) - { - /* Write the next FLASH word to the current FLASH page */ - boot_page_fill(CurrAddress, ((FetchNextCommandByte() << 8) | LowByte)); - - /* Increment the address counter after use */ - CurrAddress += 2; - } - else - { - LowByte = FetchNextCommandByte(); - } - - HighByte = !HighByte; - } - else - { - /* Write the next EEPROM byte from the endpoint */ - eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte()); - - /* Increment the address counter after use */ - CurrAddress += 2; - } - } - - /* If in FLASH programming mode, commit the page after writing */ - if (MemoryType == MEMORY_TYPE_FLASH) - { - /* Commit the flash page to memory */ - boot_page_write(PageStartAddress); - - /* Wait until write operation has completed */ - boot_spm_busy_wait(); - } - - /* Send response byte back to the host */ - WriteNextResponseByte('\r'); - } -} -#endif - -/** Retrieves the next byte from the host in the CDC data OUT endpoint, and clears the endpoint bank if needed - * to allow reception of the next data packet from the host. - * - * \return Next received byte from the host in the CDC data OUT endpoint - */ -static uint8_t FetchNextCommandByte(void) -{ - /* Select the OUT endpoint so that the next data byte can be read */ - Endpoint_SelectEndpoint(CDC_RX_EPADDR); - - /* If OUT endpoint empty, clear it and wait for the next packet from the host */ - while (!(Endpoint_IsReadWriteAllowed())) - { - Endpoint_ClearOUT(); - - while (!(Endpoint_IsOUTReceived())) - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return 0; - } - } - - /* Fetch the next byte from the OUT endpoint */ - return Endpoint_Read_8(); -} - -/** Writes the next response byte to the CDC data IN endpoint, and sends the endpoint back if needed to free up the - * bank when full ready for the next byte in the packet to the host. - * - * \param[in] Response Next response byte to send to the host - */ -static void WriteNextResponseByte(const uint8_t Response) -{ - /* Select the IN endpoint so that the next data byte can be written */ - Endpoint_SelectEndpoint(CDC_TX_EPADDR); - - /* If IN endpoint full, clear it and wait until ready for the next packet to the host */ - if (!(Endpoint_IsReadWriteAllowed())) - { - Endpoint_ClearIN(); - - while (!(Endpoint_IsINReady())) - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return; - } - } - - /* Write the next byte to the IN endpoint */ - Endpoint_Write_8(Response); -} - -/** Task to read in AVR109 commands from the CDC data OUT endpoint, process them, perform the required actions - * and send the appropriate response back to the host. - */ -static void CDC_Task(void) -{ - /* Select the OUT endpoint */ - Endpoint_SelectEndpoint(CDC_RX_EPADDR); - - /* Check if endpoint has a command in it sent from the host */ - if (!(Endpoint_IsOUTReceived())) - return; - - /* Read in the bootloader command (first byte sent from host) */ - uint8_t Command = FetchNextCommandByte(); - - if (Command == AVR109_COMMAND_ExitBootloader) - { - RunBootloader = false; - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - else if ((Command == AVR109_COMMAND_SetLED) || (Command == AVR109_COMMAND_ClearLED) || - (Command == AVR109_COMMAND_SelectDeviceType)) - { - FetchNextCommandByte(); - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - else if ((Command == AVR109_COMMAND_EnterProgrammingMode) || (Command == AVR109_COMMAND_LeaveProgrammingMode)) - { - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - else if (Command == AVR109_COMMAND_ReadPartCode) - { - /* Return ATMEGA128 part code - this is only to allow AVRProg to use the bootloader */ - WriteNextResponseByte(0x44); - WriteNextResponseByte(0x00); - } - else if (Command == AVR109_COMMAND_ReadAutoAddressIncrement) - { - /* Indicate auto-address increment is supported */ - WriteNextResponseByte('Y'); - } - else if (Command == AVR109_COMMAND_SetCurrentAddress) - { - /* Set the current address to that given by the host (translate 16-bit word address to byte address) */ - CurrAddress = (FetchNextCommandByte() << 9); - CurrAddress |= (FetchNextCommandByte() << 1); - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - else if (Command == AVR109_COMMAND_ReadBootloaderInterface) - { - /* Indicate serial programmer back to the host */ - WriteNextResponseByte('S'); - } - else if (Command == AVR109_COMMAND_ReadBootloaderIdentifier) - { - /* Write the 7-byte software identifier to the endpoint */ - for (uint8_t CurrByte = 0; CurrByte < 7; CurrByte++) - WriteNextResponseByte(SOFTWARE_IDENTIFIER[CurrByte]); - } - else if (Command == AVR109_COMMAND_ReadBootloaderSWVersion) - { - WriteNextResponseByte('0' + BOOTLOADER_VERSION_MAJOR); - WriteNextResponseByte('0' + BOOTLOADER_VERSION_MINOR); - } - else if (Command == AVR109_COMMAND_ReadSignature) - { - WriteNextResponseByte(AVR_SIGNATURE_3); - WriteNextResponseByte(AVR_SIGNATURE_2); - WriteNextResponseByte(AVR_SIGNATURE_1); - } - else if (Command == AVR109_COMMAND_EraseFLASH) - { - /* Clear the application section of flash */ - for (uint32_t CurrFlashAddress = 0; CurrFlashAddress < (uint32_t)BOOT_START_ADDR; CurrFlashAddress += SPM_PAGESIZE) - { - boot_page_erase(CurrFlashAddress); - boot_spm_busy_wait(); - boot_page_write(CurrFlashAddress); - boot_spm_busy_wait(); - } - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - #if !defined(NO_LOCK_BYTE_WRITE_SUPPORT) - else if (Command == AVR109_COMMAND_WriteLockbits) - { - /* Set the lock bits to those given by the host */ - boot_lock_bits_set(FetchNextCommandByte()); - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - #endif - else if (Command == AVR109_COMMAND_ReadLockbits) - { - WriteNextResponseByte(boot_lock_fuse_bits_get(GET_LOCK_BITS)); - } - else if (Command == AVR109_COMMAND_ReadLowFuses) - { - WriteNextResponseByte(boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS)); - } - else if (Command == AVR109_COMMAND_ReadHighFuses) - { - WriteNextResponseByte(boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS)); - } - else if (Command == AVR109_COMMAND_ReadExtendedFuses) - { - WriteNextResponseByte(boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS)); - } - #if !defined(NO_BLOCK_SUPPORT) - else if (Command == AVR109_COMMAND_GetBlockWriteSupport) - { - WriteNextResponseByte('Y'); - - /* Send block size to the host */ - WriteNextResponseByte(SPM_PAGESIZE >> 8); - WriteNextResponseByte(SPM_PAGESIZE & 0xFF); - } - else if ((Command == AVR109_COMMAND_BlockWrite) || (Command == AVR109_COMMAND_BlockRead)) - { - /* Delegate the block write/read to a separate function for clarity */ - ReadWriteMemoryBlock(Command); - } - #endif - #if !defined(NO_FLASH_BYTE_SUPPORT) - else if (Command == AVR109_COMMAND_FillFlashPageWordHigh) - { - /* Write the high byte to the current flash page */ - boot_page_fill(CurrAddress, FetchNextCommandByte()); - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - else if (Command == AVR109_COMMAND_FillFlashPageWordLow) - { - /* Write the low byte to the current flash page */ - boot_page_fill(CurrAddress | 0x01, FetchNextCommandByte()); - - /* Increment the address */ - CurrAddress += 2; - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - else if (Command == AVR109_COMMAND_WriteFlashPage) - { - /* Commit the flash page to memory */ - boot_page_write(CurrAddress); - - /* Wait until write operation has completed */ - boot_spm_busy_wait(); - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - else if (Command == AVR109_COMMAND_ReadFLASHWord) - { - #if (FLASHEND > 0xFFFF) - uint16_t ProgramWord = pgm_read_word_far(CurrAddress); - #else - uint16_t ProgramWord = pgm_read_word(CurrAddress); - #endif - - WriteNextResponseByte(ProgramWord >> 8); - WriteNextResponseByte(ProgramWord & 0xFF); - } - #endif - #if !defined(NO_EEPROM_BYTE_SUPPORT) - else if (Command == AVR109_COMMAND_WriteEEPROM) - { - /* Read the byte from the endpoint and write it to the EEPROM */ - eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte()); - - /* Increment the address after use */ - CurrAddress += 2; - - /* Send confirmation byte back to the host */ - WriteNextResponseByte('\r'); - } - else if (Command == AVR109_COMMAND_ReadEEPROM) - { - /* Read the EEPROM byte and write it to the endpoint */ - WriteNextResponseByte(eeprom_read_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)))); - - /* Increment the address after use */ - CurrAddress += 2; - } - #endif - else if (Command != AVR109_COMMAND_Sync) - { - /* Unknown (non-sync) command, return fail code */ - WriteNextResponseByte('?'); - } - - /* Select the IN endpoint */ - Endpoint_SelectEndpoint(CDC_TX_EPADDR); - - /* Remember if the endpoint is completely full before clearing it */ - bool IsEndpointFull = !(Endpoint_IsReadWriteAllowed()); - - /* Send the endpoint data to the host */ - Endpoint_ClearIN(); - - /* If a full endpoint's worth of data was sent, we need to send an empty packet afterwards to signal end of transfer */ - if (IsEndpointFull) - { - while (!(Endpoint_IsINReady())) - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return; - } - - Endpoint_ClearIN(); - } - - /* Wait until the data has been sent to the host */ - while (!(Endpoint_IsINReady())) - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return; - } - - /* Select the OUT endpoint */ - Endpoint_SelectEndpoint(CDC_RX_EPADDR); - - /* Acknowledge the command from the host */ - Endpoint_ClearOUT(); -} - diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.h b/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.h deleted file mode 100644 index 9b326abc..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Header file for BootloaderCDC.c. - */ - -#ifndef _CDC_H_ -#define _CDC_H_ - - /* Includes: */ - #include - #include - #include - #include - #include - #include - #include - - #include "Descriptors.h" - #include "BootloaderAPI.h" - #include "Config/AppConfig.h" - - #include - #include - #include - - /* Preprocessor Checks: */ - #if !defined(__OPTIMIZE_SIZE__) - #error This bootloader requires that it be optimized for size, not speed, to fit into the target device. Change optimization settings and try again. - #endif - - /* Macros: */ - /** Version major of the CDC bootloader. */ - #define BOOTLOADER_VERSION_MAJOR 0x01 - - /** Version minor of the CDC bootloader. */ - #define BOOTLOADER_VERSION_MINOR 0x00 - - /** Hardware version major of the CDC bootloader. */ - #define BOOTLOADER_HWVERSION_MAJOR 0x01 - - /** Hardware version minor of the CDC bootloader. */ - #define BOOTLOADER_HWVERSION_MINOR 0x00 - - /** Eight character bootloader firmware identifier reported to the host when requested. */ - #define SOFTWARE_IDENTIFIER "LUFACDC" - - /** Magic bootloader key to unlock forced application start mode. */ - #define MAGIC_BOOT_KEY 0xDC42 - - /* Enums: */ - /** Possible memory types that can be addressed via the bootloader. */ - enum AVR109_Memories - { - MEMORY_TYPE_FLASH = 'F', - MEMORY_TYPE_EEPROM = 'E', - }; - - /** Possible commands that can be issued to the bootloader. */ - enum AVR109_Commands - { - AVR109_COMMAND_Sync = 27, - AVR109_COMMAND_ReadEEPROM = 'd', - AVR109_COMMAND_WriteEEPROM = 'D', - AVR109_COMMAND_ReadFLASHWord = 'R', - AVR109_COMMAND_WriteFlashPage = 'm', - AVR109_COMMAND_FillFlashPageWordLow = 'c', - AVR109_COMMAND_FillFlashPageWordHigh = 'C', - AVR109_COMMAND_GetBlockWriteSupport = 'b', - AVR109_COMMAND_BlockWrite = 'B', - AVR109_COMMAND_BlockRead = 'g', - AVR109_COMMAND_ReadExtendedFuses = 'Q', - AVR109_COMMAND_ReadHighFuses = 'N', - AVR109_COMMAND_ReadLowFuses = 'F', - AVR109_COMMAND_ReadLockbits = 'r', - AVR109_COMMAND_WriteLockbits = 'l', - AVR109_COMMAND_EraseFLASH = 'e', - AVR109_COMMAND_ReadSignature = 's', - AVR109_COMMAND_ReadBootloaderSWVersion = 'V', - AVR109_COMMAND_ReadBootloaderHWVersion = 'v', - AVR109_COMMAND_ReadBootloaderIdentifier = 'S', - AVR109_COMMAND_ReadBootloaderInterface = 'p', - AVR109_COMMAND_SetCurrentAddress = 'A', - AVR109_COMMAND_ReadAutoAddressIncrement = 'a', - AVR109_COMMAND_ReadPartCode = 't', - AVR109_COMMAND_EnterProgrammingMode = 'P', - AVR109_COMMAND_LeaveProgrammingMode = 'L', - AVR109_COMMAND_SelectDeviceType = 'T', - AVR109_COMMAND_SetLED = 'x', - AVR109_COMMAND_ClearLED = 'y', - AVR109_COMMAND_ExitBootloader = 'E', - }; - - /* Type Defines: */ - /** Type define for a non-returning pointer to the start of the loaded application in flash memory. */ - typedef void (*AppPtr_t)(void) ATTR_NO_RETURN; - - /* Function Prototypes: */ - static void CDC_Task(void); - static void SetupHardware(void); - - void Application_Jump_Check(void) ATTR_INIT_SECTION(3); - - void EVENT_USB_Device_ConfigurationChanged(void); - - #if defined(INCLUDE_FROM_BOOTLOADERCDC_C) || defined(__DOXYGEN__) - #if !defined(NO_BLOCK_SUPPORT) - static void ReadWriteMemoryBlock(const uint8_t Command); - #endif - static uint8_t FetchNextCommandByte(void); - static void WriteNextResponseByte(const uint8_t Response); - #endif - -#endif - diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.txt b/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.txt deleted file mode 100644 index 55e5e55a..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.txt +++ /dev/null @@ -1,240 +0,0 @@ -/** \file - * - * This file contains special DoxyGen information for the generation of the main page and other special - * documentation pages. It is not a project source file. - */ - -/** \mainpage CDC Class USB AVR Bootloader - * - * \section Sec_Compat Demo Compatibility: - * - * The following list indicates what microcontrollers are compatible with this demo. - * - * \li Series 7 USB AVRs (AT90USBxxx7) - * \li Series 6 USB AVRs (AT90USBxxx6) - * \li Series 4 USB AVRs (ATMEGAxxU4) - * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) - * - * \section Sec_Info USB Information: - * - * The following table gives a rundown of the USB utilization of this demo. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
USB Mode:Device
USB Class:Communications Device Class (CDC)
USB Subclass:Abstract Control Model (ACM)
Relevant Standards:USBIF CDC Class Standard
Supported USB Speeds:Full Speed Mode
- * - * \section Sec_Description Project Description: - * - * This bootloader enumerates to the host as a CDC Class device (virtual serial port), allowing for AVR109 - * protocol compatible programming software to load firmware onto the AVR. - * - * Out of the box this bootloader builds for the AT90USB1287 with an 8KB bootloader section size, and will fit - * into 4KB of bootloader space. If you wish to alter this size and/or change the AVR model, you will need to - * edit the MCU, FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB values in the accompanying makefile. - * - * When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the - * bootloader from the normal user application. - * - * \warning THIS BOOTLOADER IS NOT SECURE. Malicious entities can recover written data, even if the device - * lockbits are set. - * - * \section Sec_Running Running the Bootloader - * - * This bootloader is designed to be started via the HWB mechanism of the USB AVRs; ground the HWB pin (see device - * datasheet) then momentarily ground /RESET to start the bootloader. This assumes the HWBE fuse is set and the BOOTRST - * fuse is cleared. - * - * For board specific exceptions to the above, see below. - * - * \subsection SSec_XPLAIN Atmel Xplain Board - * Ground the USB AVR JTAG's \c TCK pin to ground when powering on the board to start the bootloader. This assumes the - * \c HWBE fuse is cleared and the \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board. - * - * \subsection SSec_Leonardo Arduino Leonardo Board - * Ground \c IO13 when powering the board to start the bootloader. This assumes the \c HWBE fuse is cleared and the - * \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board. - * - * \section Sec_Installation Driver Installation - * - * After running this bootloader for the first time on a new computer, you will need to supply the .INF - * file located in this bootloader project's directory as the device's driver when running under Windows. - * This will enable Windows to use its inbuilt CDC drivers, negating the need for custom drivers for the - * device. Other Operating Systems should automatically use their own inbuilt CDC-ACM drivers. - * - * \section Sec_HostApp Host Controller Application - * - * This bootloader is compatible with the open source application AVRDUDE, Atmel's AVRPROG, or other - * applications implementing the AVR109 protocol, which is documented on the Atmel website as an application - * note. - * - * \subsection SSec_AVRDude AVRDUDE (Windows, Mac, Linux) - * - * AVRDude is a free, cross-platform and open source command line programmer for Atmel and third party AVR - * programmers. It is available on the the Windows platform as part of the "WinAVR" package, or on other systems - * either from a build from the official source code, or in many distributions as a precompiled binary package. - * - * To load a new HEX file with AVRDude, specify "AVR109" as the programmer, with the allocated COM port. On Windows - * platforms this will be a COMx port name: - * \code - * avrdude -c AVR109 -p at90usb1287 -P COM0 -U flash:w:Mouse.hex - * \endcode - * - * On Linux systems, this will typically be a /dev/ttyACMx port name: - * \code - * avrdude -c AVR109 -p at90usb1287 -P /dev/ttyACM0 -U flash:w:Mouse.hex - * \endcode - * - * Refer to the AVRDude project documentation for additional usage instructions. - * - * \section Sec_API User Application API - * - * Several user application functions for FLASH and other special memory area manipulations are exposed by the bootloader, - * allowing the user application to call into the bootloader at runtime to read and write FLASH data. - * - * By default, the bootloader API jump table is located 32 bytes from the end of the device's FLASH memory, and follows the - * following layout: - * - * \code - * #define BOOTLOADER_API_TABLE_SIZE 32 - * #define BOOTLOADER_API_TABLE_START ((FLASHEND + 1UL) - BOOTLOADER_API_TABLE_SIZE) - * #define BOOTLOADER_API_CALL(Index) (void*)((BOOTLOADER_API_TABLE_START + (Index * 2)) / 2) - * - * void (*BootloaderAPI_ErasePage)(uint32_t Address) = BOOTLOADER_API_CALL(0); - * void (*BootloaderAPI_WritePage)(uint32_t Address) = BOOTLOADER_API_CALL(1); - * void (*BootloaderAPI_FillWord)(uint32_t Address, uint16_t Word) = BOOTLOADER_API_CALL(2); - * uint8_t (*BootloaderAPI_ReadSignature)(uint16_t Address) = BOOTLOADER_API_CALL(3); - * uint8_t (*BootloaderAPI_ReadFuse)(uint16_t Address) = BOOTLOADER_API_CALL(4); - * uint8_t (*BootloaderAPI_ReadLock)(void) = BOOTLOADER_API_CALL(5); - * void (*BootloaderAPI_WriteLock)(uint8_t LockBits) = BOOTLOADER_API_CALL(6); - * - * #define BOOTLOADER_MAGIC_SIGNATURE_START (BOOTLOADER_API_TABLE_START + (BOOTLOADER_API_TABLE_SIZE - 2)) - * #define BOOTLOADER_MAGIC_SIGNATURE 0xDCFB - * - * #define BOOTLOADER_CLASS_SIGNATURE_START (BOOTLOADER_API_TABLE_START + (BOOTLOADER_API_TABLE_SIZE - 4)) - * #define BOOTLOADER_CDC_SIGNATURE 0xDF00 - * - * #define BOOTLOADER_ADDRESS_START (BOOTLOADER_API_TABLE_START + (BOOTLOADER_API_TABLE_SIZE - 8)) - * #define BOOTLOADER_ADDRESS_LENGTH 4 - * \endcode - * - * From the application the API support of the bootloader can be detected by reading the FLASH memory bytes located at address - * \c BOOTLOADER_MAGIC_SIGNATURE_START and comparing them to the value \c BOOTLOADER_MAGIC_SIGNATURE. The class of bootloader - * can be determined by reading the FLASH memory bytes located at address \c BOOTLOADER_CLASS_SIGNATURE_START and comparing them - * to the value \c BOOTLOADER_CDC_SIGNATURE. The start address of the bootloader can be retrieved by reading the bytes of FLASH - * memory starting from address \c BOOTLOADER_ADDRESS_START. - * - * \subsection SSec_API_MemLayout Device Memory Map - * The following illustration indicates the final memory map of the device when loaded with the bootloader. - * - * \verbatim - * +----------------------------+ 0x0000 - * | | - * | | - * | | - * | | - * | | - * | | - * | | - * | | - * | User Application | - * | | - * | | - * | | - * | | - * | | - * | | - * | | - * +----------------------------+ FLASHEND - BOOT_SECTION_SIZE - * | | - * | Bootloader Application | - * | (Not User App. Accessible) | - * | | - * +----------------------------+ FLASHEND - 96 - * | API Table Trampolines | - * | (Not User App. Accessible) | - * +----------------------------+ FLASHEND - 32 - * | Bootloader API Table | - * | (User App. Accessible) | - * +----------------------------+ FLASHEND - 8 - * | Bootloader ID Constants | - * | (User App. Accessible) | - * +----------------------------+ FLASHEND - * \endverbatim - * - * \section Sec_KnownIssues Known Issues: - * - * \par On Linux machines, the CDC bootloader is unstable or inaccessible. - * A change to the \c ModemManager module in many Linux distributions causes - * this module to try to take control over inserted CDC devices, corrupting the - * datastream. A UDEV rule is required to prevent this. - * See here for resolution steps. - * If the issue still persists then uninstall modemmanager by executing sudo apt-get remove modemmanager, or - * the equivalent using your chosen distribution's package manager. - * - * \par On Linux machines, the CDC bootloader is inaccessible. - * On many Linux systems, non-root users do not have automatic access to newly - * inserted CDC devices. Root privileges or a UDEV rule is required to gain - * access. - * See here for resolution steps. - * - * \par After loading an application, it is not run automatically on startup. - * Some USB AVR boards ship with the BOOTRST fuse set, causing the bootloader - * to run automatically when the device is reset. In most cases, the BOOTRST - * fuse should be disabled and the HWBE fuse used instead to run the bootloader - * when needed. - * - * \section Sec_Options Project Options - * - * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Define Name:Location:Description:
NO_BLOCK_SUPPORTAppConfig.hDefine to disable memory block read/write support in the bootloader, requiring all reads and writes to be made - * using the byte-level commands.
NO_EEPROM_BYTE_SUPPORTAppConfig.hDefine to disable EEPROM memory byte read/write support in the bootloader, requiring all EEPROM reads and writes - * to be made using the block-level commands.
NO_FLASH_BYTE_SUPPORTAppConfig.hDefine to disable FLASH memory byte read/write support in the bootloader, requiring all FLASH reads and writes - * to be made using the block-level commands.
NO_LOCK_BYTE_WRITE_SUPPORTAppConfig.hDefine to disable lock byte write support in the bootloader, preventing the lock bits from being set programmatically.
- */ - diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/Config/AppConfig.h b/protocol/lufa/LUFA-git/Bootloaders/CDC/Config/AppConfig.h deleted file mode 100644 index bbb5cb22..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/Config/AppConfig.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * \brief Application Configuration Header File - * - * This is a header file which is be used to configure LUFA's - * compile time options, as an alternative to the compile time - * constants supplied through a makefile. - * - * For information on what each token does, refer to the - * \ref Sec_Options section of the application documentation. - */ - -#ifndef _APP_CONFIG_H_ -#define _APP_CONFIG_H_ - -// #define NO_BLOCK_SUPPORT -// #define NO_EEPROM_BYTE_SUPPORT -// #define NO_FLASH_BYTE_SUPPORT -// #define NO_LOCK_BYTE_WRITE_SUPPORT - -#endif diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/Config/LUFAConfig.h b/protocol/lufa/LUFA-git/Bootloaders/CDC/Config/LUFAConfig.h deleted file mode 100644 index af2dd306..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/Config/LUFAConfig.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * \brief LUFA Library Configuration Header File - * - * This header file is used to configure LUFA's compile time options, - * as an alternative to the compile time constants supplied through - * a makefile. - * - * For information on what each token does, refer to the LUFA - * manual section "Summary of Compile Tokens". - */ - -#ifndef _LUFA_CONFIG_H_ -#define _LUFA_CONFIG_H_ - - #if (ARCH == ARCH_AVR8) - - /* Non-USB Related Configuration Tokens: */ -// #define DISABLE_TERMINAL_CODES - - /* USB Class Driver Related Tokens: */ -// #define HID_HOST_BOOT_PROTOCOL_ONLY -// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} -// #define HID_USAGE_STACK_DEPTH {Insert Value Here} -// #define HID_MAX_COLLECTIONS {Insert Value Here} -// #define HID_MAX_REPORTITEMS {Insert Value Here} -// #define HID_MAX_REPORT_IDS {Insert Value Here} -// #define NO_CLASS_DRIVER_AUTOFLUSH - - /* General USB Driver Related Tokens: */ - #define ORDERED_EP_CONFIG - #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) - #define USB_DEVICE_ONLY -// #define USB_HOST_ONLY -// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} -// #define NO_LIMITED_CONTROLLER_CONNECT - #define NO_SOF_EVENTS - - /* USB Device Mode Driver Related Tokens: */ - #define USE_RAM_DESCRIPTORS -// #define USE_FLASH_DESCRIPTORS -// #define USE_EEPROM_DESCRIPTORS - #define NO_INTERNAL_SERIAL - #define FIXED_CONTROL_ENDPOINT_SIZE 8 - #define DEVICE_STATE_AS_GPIOR 0 - #define FIXED_NUM_CONFIGURATIONS 1 -// #define CONTROL_ONLY_DEVICE -// #define INTERRUPT_CONTROL_ENDPOINT - #define NO_DEVICE_REMOTE_WAKEUP - #define NO_DEVICE_SELF_POWER - - /* USB Host Mode Driver Related Tokens: */ -// #define HOST_STATE_AS_GPIOR {Insert Value Here} -// #define USB_HOST_TIMEOUT_MS {Insert Value Here} -// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} -// #define NO_AUTO_VBUS_MANAGEMENT -// #define INVERTED_VBUS_ENABLE_LINE - - #else - - #error Unsupported architecture for this LUFA configuration file. - - #endif -#endif diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/Descriptors.c b/protocol/lufa/LUFA-git/Bootloaders/CDC/Descriptors.c deleted file mode 100644 index 2ff6b503..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/Descriptors.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * USB Device Descriptors, for library use when in USB device mode. Descriptors are special - * computer-readable structures which the host requests upon device enumeration, to determine - * the device's capabilities and functions. - */ - -#include "Descriptors.h" - -/** Device descriptor structure. This descriptor, located in SRAM memory, describes the overall - * device characteristics, including the supported USB version, control endpoint size and the - * number of device configurations. The descriptor is read out by the USB host when the enumeration - * process begins. - */ -const USB_Descriptor_Device_t DeviceDescriptor = -{ - .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, - - .USBSpecification = VERSION_BCD(1,1,0), - .Class = CDC_CSCP_CDCClass, - .SubClass = CDC_CSCP_NoSpecificSubclass, - .Protocol = CDC_CSCP_NoSpecificProtocol, - - .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, - - .VendorID = 0x03EB, - .ProductID = 0x204A, - .ReleaseNumber = VERSION_BCD(1,0,0), - - .ManufacturerStrIndex = STRING_ID_Manufacturer, - .ProductStrIndex = STRING_ID_Product, - .SerialNumStrIndex = NO_DESCRIPTOR, - - .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS -}; - -/** Configuration descriptor structure. This descriptor, located in SRAM memory, describes the usage - * of the device in one of its supported configurations, including information about any device interfaces - * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting - * a configuration so that the host may correctly communicate with the USB device. - */ -const USB_Descriptor_Configuration_t ConfigurationDescriptor = -{ - .Config = - { - .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, - - .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), - .TotalInterfaces = 2, - - .ConfigurationNumber = 1, - .ConfigurationStrIndex = NO_DESCRIPTOR, - - .ConfigAttributes = USB_CONFIG_ATTR_RESERVED, - - .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) - }, - - .CDC_CCI_Interface = - { - .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - - .InterfaceNumber = INTERFACE_ID_CDC_CCI, - .AlternateSetting = 0, - - .TotalEndpoints = 1, - - .Class = CDC_CSCP_CDCClass, - .SubClass = CDC_CSCP_ACMSubclass, - .Protocol = CDC_CSCP_ATCommandProtocol, - - .InterfaceStrIndex = NO_DESCRIPTOR - }, - - .CDC_Functional_Header = - { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, - .Subtype = 0x00, - - .CDCSpecification = VERSION_BCD(1,1,0), - }, - - .CDC_Functional_ACM = - { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, - .Subtype = 0x02, - - .Capabilities = 0x02, - }, - - .CDC_Functional_Union = - { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, - .Subtype = 0x06, - - .MasterInterfaceNumber = INTERFACE_ID_CDC_CCI, - .SlaveInterfaceNumber = INTERFACE_ID_CDC_DCI, - }, - - .CDC_NotificationEndpoint = - { - .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - - .EndpointAddress = CDC_NOTIFICATION_EPADDR, - .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = CDC_NOTIFICATION_EPSIZE, - .PollingIntervalMS = 0xFF - }, - - .CDC_DCI_Interface = - { - .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - - .InterfaceNumber = INTERFACE_ID_CDC_DCI, - .AlternateSetting = 0, - - .TotalEndpoints = 2, - - .Class = CDC_CSCP_CDCDataClass, - .SubClass = CDC_CSCP_NoDataSubclass, - .Protocol = CDC_CSCP_NoDataProtocol, - - .InterfaceStrIndex = NO_DESCRIPTOR - }, - - .CDC_DataOutEndpoint = - { - .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - - .EndpointAddress = CDC_RX_EPADDR, - .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x05 - }, - - .CDC_DataInEndpoint = - { - .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - - .EndpointAddress = CDC_TX_EPADDR, - .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x05 - } -}; - -/** Language descriptor structure. This descriptor, located in SRAM memory, is returned when the host requests - * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate - * via the language ID table available at USB.org what languages the device supports for its string descriptors. - */ -const USB_Descriptor_String_t LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG); - -/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable - * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device - * Descriptor. - */ -const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(L"Dean Camera"); - -/** Product descriptor string. This is a Unicode string containing the product's details in human readable form, - * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device - * Descriptor. - */ -const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"LUFA CDC"); - -/** This function is called by the library when in device mode, and must be overridden (see LUFA library "USB Descriptors" - * documentation) by the application code so that the address and size of a requested descriptor can be given - * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function - * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the - * USB host. - */ -uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, - const void** const DescriptorAddress) -{ - const uint8_t DescriptorType = (wValue >> 8); - const uint8_t DescriptorNumber = (wValue & 0xFF); - - const void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; - - switch (DescriptorType) - { - case DTYPE_Device: - Address = &DeviceDescriptor; - Size = sizeof(USB_Descriptor_Device_t); - break; - case DTYPE_Configuration: - Address = &ConfigurationDescriptor; - Size = sizeof(USB_Descriptor_Configuration_t); - break; - case DTYPE_String: - if (DescriptorNumber == STRING_ID_Language) - { - Address = &LanguageString; - Size = LanguageString.Header.Size; - } - else if (DescriptorNumber == STRING_ID_Manufacturer) - { - Address = &ManufacturerString; - Size = ManufacturerString.Header.Size; - } - else if (DescriptorNumber == STRING_ID_Product) - { - Address = &ProductString; - Size = ProductString.Header.Size; - } - - break; - } - - *DescriptorAddress = Address; - return Size; -} - diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/Descriptors.h b/protocol/lufa/LUFA-git/Bootloaders/CDC/Descriptors.h deleted file mode 100644 index ef043791..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/Descriptors.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Header file for Descriptors.c. - */ - -#ifndef _DESCRIPTORS_H_ -#define _DESCRIPTORS_H_ - - /* Includes: */ - #include - - #include "Config/AppConfig.h" - - /* Macros: */ - #if defined(__AVR_AT90USB1287__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x97 - #define AVR_SIGNATURE_3 0x82 - #elif defined(__AVR_AT90USB647__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x96 - #define AVR_SIGNATURE_3 0x82 - #elif defined(__AVR_AT90USB1286__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x97 - #define AVR_SIGNATURE_3 0x82 - #elif defined(__AVR_AT90USB646__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x96 - #define AVR_SIGNATURE_3 0x82 - #elif defined(__AVR_ATmega32U4__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x95 - #define AVR_SIGNATURE_3 0x87 - #elif defined(__AVR_ATmega16U4__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x94 - #define AVR_SIGNATURE_3 0x88 - #elif defined(__AVR_ATmega32U2__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x95 - #define AVR_SIGNATURE_3 0x8A - #elif defined(__AVR_ATmega16U2__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x94 - #define AVR_SIGNATURE_3 0x89 - #elif defined(__AVR_AT90USB162__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x94 - #define AVR_SIGNATURE_3 0x82 - #elif defined(__AVR_ATmega8U2__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x93 - #define AVR_SIGNATURE_3 0x89 - #elif defined(__AVR_AT90USB82__) - #define AVR_SIGNATURE_1 0x1E - #define AVR_SIGNATURE_2 0x94 - #define AVR_SIGNATURE_3 0x82 - #else - #error The selected AVR part is not currently supported by this bootloader. - #endif - - /** Endpoint address for the CDC control interface event notification endpoint. */ - #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) - - /** Endpoint address for the CDC data interface TX (data IN) endpoint. */ - #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) - - /** Endpoint address for the CDC data interface RX (data OUT) endpoint. */ - #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) - - /** Size of the CDC data interface TX and RX data endpoint banks, in bytes. */ - #define CDC_TXRX_EPSIZE 16 - - /** Size of the CDC control interface notification endpoint bank, in bytes. */ - #define CDC_NOTIFICATION_EPSIZE 8 - - /* Type Defines: */ - /** Type define for the device configuration descriptor structure. This must be defined in the - * application code, as the configuration descriptor contains several sub-descriptors which - * vary between devices, and which describe the device's usage to the host. - */ - typedef struct - { - USB_Descriptor_Configuration_Header_t Config; - - // CDC Control Interface - USB_Descriptor_Interface_t CDC_CCI_Interface; - USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; - USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; - USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; - USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; - - // CDC Data Interface - USB_Descriptor_Interface_t CDC_DCI_Interface; - USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; - USB_Descriptor_Endpoint_t CDC_DataInEndpoint; - } USB_Descriptor_Configuration_t; - - /** Enum for the device interface descriptor IDs within the device. Each interface descriptor - * should have a unique ID index associated with it, which can be used to refer to the - * interface from other descriptors. - */ - enum InterfaceDescriptors_t - { - INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */ - INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */ - }; - - /** Enum for the device string descriptor IDs within the device. Each string descriptor should - * have a unique ID index associated with it, which can be used to refer to the string from - * other descriptors. - */ - enum StringDescriptors_t - { - STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ - STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ - STRING_ID_Product = 2, /**< Product string ID */ - }; - - /* Function Prototypes: */ - uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, - const void** const DescriptorAddress) - ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); - -#endif - diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/LUFA CDC Bootloader.inf b/protocol/lufa/LUFA-git/Bootloaders/CDC/LUFA CDC Bootloader.inf deleted file mode 100644 index 61624c73..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/LUFA CDC Bootloader.inf +++ /dev/null @@ -1,66 +0,0 @@ -;************************************************************ -; Windows USB CDC ACM Setup File -; Copyright (c) 2000 Microsoft Corporation -;************************************************************ - -[DefaultInstall] -CopyINF="LUFA CDC Bootloader.inf" - -[Version] -Signature="$Windows NT$" -Class=Ports -ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} -Provider=%MFGNAME% -DriverVer=7/1/2012,10.0.0.0 - -[Manufacturer] -%MFGNAME%=DeviceList, NTx86, NTamd64, NTia64 - -[SourceDisksNames] - -[SourceDisksFiles] - -[DestinationDirs] -DefaultDestDir=12 - -[DriverInstall] -Include=mdmcpq.inf -CopyFiles=FakeModemCopyFileSection -AddReg=DriverInstall.AddReg - -[DriverInstall.Services] -Include=mdmcpq.inf -AddService=usbser, 0x00000002, LowerFilter_Service_Inst - -[DriverInstall.AddReg] -HKR,,EnumPropPages32,,"msports.dll,SerialPortPropPageProvider" - -;------------------------------------------------------------------------------ -; Vendor and Product ID Definitions -;------------------------------------------------------------------------------ -; When developing your USB device, the VID and PID used in the PC side -; application program and the firmware on the microcontroller must match. -; Modify the below line to use your VID and PID. Use the format as shown below. -; Note: One INF file can be used for multiple devices with different VID and PIDs. -; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. -;------------------------------------------------------------------------------ -[DeviceList] -%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A - -[DeviceList.NTx86] -%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A - -[DeviceList.NTamd64] -%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A - -[DeviceList.NTia64] -%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A - -;------------------------------------------------------------------------------ -; String Definitions -;------------------------------------------------------------------------------ -;Modify these strings to customize your device -;------------------------------------------------------------------------------ -[Strings] -MFGNAME="http://www.lufa-lib.org" -DESCRIPTION="LUFA CDC Class Bootloader" diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/asf.xml b/protocol/lufa/LUFA-git/Bootloaders/CDC/asf.xml deleted file mode 100644 index 72f3ff04..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/asf.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/protocol/lufa/LUFA-git/Bootloaders/CDC/doxyfile b/protocol/lufa/LUFA-git/Bootloaders/CDC/doxyfile deleted file mode 100644 index 2dfb2a08..00000000 --- a/protocol/lufa/LUFA-git/Bootloaders/CDC/doxyfile +++ /dev/null @@ -1,2365 +0,0 @@ -# Doxyfile 1.8.8 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "LUFA Library - CDC Class Bootloader" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = ./Documentation/ - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = YES - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. -# -# Note For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = NO - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. -# The default value is: YES. - -GENERATE_TODOLIST = NO - -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. -# The default value is: YES. - -GENERATE_TESTLIST = NO - -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = NO - -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = ./ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.h \ - *.c \ - *.txt - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = Documentation/ - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = __* \ - INCLUDE_FROM_* - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = NO - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = NO - -# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# compiled with the --with-libclang option. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra stylesheet files is of importance (e.g. the last -# stylesheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = YES - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = YES - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = YES - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 1 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /