summaryrefslogtreecommitdiffstats
path: root/tmk_core/common
AgeCommit message (Collapse)AuthorFilesLines
2019-02-15Debounce refactor / API (#3720)Drashna Jaelre1-15/+2
* Added xeal60 via clone of lets split * Delete removed other keymaps * Basic keymap (no FN). Compiles. * Removed NP_STAR and NP_SLSH. * Removed "debounce_algo = manual" in all keyboards with CUSTOM_MATRIX = yes. * Changed order of rules in TMK. Documented feature. * Fixed missing whitespace in debounce documentation Table wasn't working due to missing newline. * Added bold in a few areas. * DO NOT USE - Removed debounce from TMK. * Remove accidental xeal60 commit * DO NOT USE - debounce successfully compiled. * DO NOT USE Revert back to original API to support split_keyboards. * Working eager_pk * Whitespace cleanup. * Restored debounce.h since there wasnt any real change. * Moved debouncing_time variable to inside #if debounce * Removed check for custom_matrix. We can safely include the debounce file for compilation when custom_matrix is used. * Removed #include "matrix.h" from debounce.h * Bug fix - was using MATRIX_ROWS instead of num_rows * Fixed compilation error with debounce_sym_g * Renamed DEBOUNCE_ALGO to DEBOUNCE_TYPE * Malloc array in debounce_eager_pk, since split keyboards only use MATRIX_ROWS/2. * Fix compile error in debounce_eager_pk * Stricter, leaner DEBOUNCE_TYPE section in common_features.mk. Cleanup debounce_type.mk
2019-02-15Add kb and user level keyboard initialization functions (#3113)Drashna Jaelre3-14/+55
* Add suspend functions * Disable RGB code if it's disabled * Add keyboard_init functions * Change where references so it will compile * Wrong command chained in wake up kb function * Fix non-feature file changes * Add documentation * Re-add matrix init docs * add rgblight code to example * Remove suspend code * Clean up docs * Fix docs * Fix suspend code * more doc fixes * change function to startup_* rather than keyboard_init_ * fix spelling error * fix up docs to finish removing keyboard_init * Use Pre and Post init functions * Update Documenation * Remove changes to my keymap and userspace code * Cleanup * Revert changes to extra files * Forgot a semicolon * Make sure all protocols call keyboard_setup * Cleanup functions * Unset startup_user * Remove changes from division keyboard * Readd startup_user function * Remove all to startup_user * Update docs/custom_quantum_functions.md Co-Authored-By: drashna <drashna@live.com> * Update docs/custom_quantum_functions.md Co-Authored-By: drashna <drashna@live.com> * Add suggestion line * Rebase fixes * Update documentation to be more useful/accurate * Cleanup of documentation * Fix spacing inconsistency * Revert unexpected change to keymap
2019-02-13Add Satisfaction75 to QMK, Enable EEPROM on stm32f072 (#5094)Andrew Kannan2-3/+8
* Add stm32f072 base ck4x4 to handwired * add prints * Save these tries * Save changes again * Working hadron oled * OLEd working but ws2812b still iffy: * save another try * Encoder feature + OLED * RTC code * Implement clock setting mode * Whitespace * Encoder hooked up to working LED PWM code * Add missing files * eeprom changes * Save changes * Move i2c master * Move satisfaction75 under cannonkeys * Set proper default folder * Revert some core changes * Undo paved iris changes * Reorganize code for maintainability and prep for new features * Add starting code for clock OLED mode * Clock set mode finished * Add custom encoder modes * Actually add VIA keymap * Gate to only 072 * fix gate for only 072 * Update header guards and includes * Update i2c selection strategy * Update board.c to handle software reset to DFU
2019-02-11compiles, but long delay on startup and problemsskullY1-1/+1
2019-02-05Add One Shot Key callbacks (#4697)Thomas Baart2-15/+84
* Added callbacks to one shot modifier changes * Altered signature of callback functions * Reordered the callback methods, shortened brief documentation * Added One Shot Modifier callback documentation * First attempt at unit tests * Revert "First attempt at unit tests" This reverts commit 5ec21a782202c0d74cf21cb852bd319f0c8b4842. * Simplified oneshot function implementations * Made clear_oneshot_locked_mods to be conform action_util.h, adhering to the (void) signature * Made used datatypes for oneshot mods consistently unsigned integers * Corrected callback to call clear callback when clear_oneshot_locked_mods is invoked * Simplified oneshot equals statements * Corrected return type and signature of get and set oneshot locked mods * Consolidated one shot callbacks, added initial layer callback version * Fixed non-updating one shot layer variable after timeout or other clear, added code comments * Added better one shot key docs
2019-02-01Change return type of layer_switch_get_layer() to uint8_t (#5011)fauxpark2-3/+3
* Change return type of layer_switch_get_layer() to uint8_t * Keep loop index signed so we don't wrap around
2019-01-30Moving cannonkeys boards to one place, eeprom fix (#4999)Andrew Kannan1-4/+8
* Move boards to cannonkeys and share resources * Share common files between cannonkey boards * Fix ortho60 keymap * update LED numbers * Add RGB keys to Ortho60 and Ortho48 * Add Backlight control to default layout Ortho60 and 48 * Remove unnecessary ws2812.c SRC from rules.mk
2019-01-29Backlight - New option : BACKLIGHT_CAPS_LOCK (#4769)Rockman181-25/+32
* [BACKLIGHT_CAPS_LOCK_INDICATOR] Use backlight toggling as Caps Lock LED I've implemented this feature because S65-X doesn't have LED indicators and the existing led_set_kb(usb_led) function try to use backlight as indicator but that creates an inconsistency with backlight_config state. - define `BACKLIGHT_CAPS_LOCK_INDICATOR` to enable Caps Lock indicator using backlight (for keyboards without dedicated LED) - Don't turn off LED indicators when suspend because backlight is already turned off. Else led_set(0) will turn back on backlight. - Documentation has been updated * [BACKLIGHT_CAPS_LOCK_INDICATOR] Turn off all LED indicators except Caps Lock if BACKLIGHT_CAPS_LOCK_INDICATOR * [BACKLIGHT_CAPS_LOCK] Rename BACKLIGHT_CAPS_LOCK_INDICATOR * [BACKLIGHT_CAPS_LOCK] Use new IS_LED_ON method
2019-01-29Practice60 RGB and PWM Backlight (#4929)Andrew Kannan1-11/+6
* Update Practice60 to enable RGB via SPI DMA and use PWM backlight breathing * Correct stm32f103c8t6 flash size in eeprom definition * Remove unused files and improve ifdef checks * Update quantum/rgblight.c Co-Authored-By: awkannan <andrew.kannan@klaviyo.com> * Update quantum/rgblight.c Co-Authored-By: awkannan <andrew.kannan@klaviyo.com> * EEPROM implementation fix and updated p60 code * Update define * Remove dead code * Update keymap to remove test key * Update keymap again
2019-01-27Fix Command feature: use get_mods() instead of keyboard_report->mods (#4955)Konstantin Đorđević1-1/+1
* Remove unnecessary IS_COMMAND definition in clueboard/66/rev4 * Replace keyboard_report->mods with get_mods() in IS_COMMAND definitions * Update docs to use get_mods() instead of keyboard_report->mods * Replace keyboard_report->mods with get_mods() in tmk_core/protocol/usb_hid/test For some reason, this occurrence used KB_LSHIFT and KB_RSHIFT, which don't exist * Replace keyboard_report->mods with get_mods() in Massdrop keyboards (as per @patrickmt)
2019-01-27Adds a default value for IS_COMMAND for COMMAND feature (#4301)Drashna Jaelre1-0/+3
* Add default value for IS_COMMAND for COMMAND feature * Cleanup and consistency * Update Templates to reflect change * Fix IS_COMMAND in template * Fix IS_COMMAND define * Use consistent IS_COMMAND block in templates * Remove unnecessary `#undef IS_COMMAND` directives * Fix compile issue on orthodox * Reomve IS_COMMAND option for newer boards * Remove all existing definitions of IS_COMMAND if they use default LSHIFT and RSHIFT setting * Remove a couple of additional IS_COMMAND defines * Remove remaining redundant IS_COMMAND definitions * Remove #undef IS_COMMAND from orthodox:drashna and whitefox:konstantin * Remove multiple empty lines in modified config.h files * Update additional boards * Reomve IS_COMMAND from newer boards * Update Alice keyboard * Remove IS_COMMAND from additional boards Jan 24th edition
2019-01-26Whitespace cleanup.alex-ong1-3/+3
2019-01-26DO NOT USE - Removed debounce from TMK.alex-ong6-260/+3
2019-01-26DO NOT USE Merge branch 'master' into debounce_refactorAlex Ong18-838/+371
Merged, however now there are two debounce.h and debounce.c to mess around with and coalesce. # Conflicts: # quantum/matrix.c
2019-01-26Fix RGBLIGHT_SLEEP function (#4865)Drashna Jaelre1-17/+30
* Only re-enable RGBLIGHT if it was on when going to sleep * Reformat file to follow QMK Standards * Fix check, since this is a loop, whoops Much thanks to @Rockman18 for catching this and posting the additional code!
2019-01-25Add MOD_MASK_* macros to core code (#4337)Konstantin Đorđević1-0/+16
* Add MOD_MASK_* macros to core code * MOD_MASK_ALL → MOD_MASK_CSAG
2019-01-25Fix oneshot_time wrong type (#3696)Shihpin Tseng1-2/+2
* Fix oneshot_time wrong type * Fix oneshot_time_layer wrong type
2019-01-25Add support for RETRO_TAPPING to LT(layer, kc)lambda_sakura2-1/+10
2019-01-21Tidy up IS_{,HOST_}LED_{ON,OFF} macros (#4894)Konstantin Đorđević1-11/+6
* Tidy up IS_{,HOST_}LED_{ON,OFF} macros * Tweak LED control docs
2019-01-18Flip definitions of macOS brightness aliasJunya Ogura1-2/+2
Before: KC_BRMU - Brightness Down KC_BRMD - Brightness Up After: KC_BRMU - Brightness Up KC_BRMD - Brightness Down
2019-01-18Defined IS_(HOST_)LED_ON/OFF() and improved LED documentation (#4853)DidierLoiseau1-0/+6
* Defined IS_(HOST_)LED_ON/OFF() and improved LED documentation * Update docs/custom_quantum_functions.md Co-Authored-By: DidierLoiseau <didierloiseau+github@gmail.com> * Update docs/custom_quantum_functions.md Co-Authored-By: DidierLoiseau <didierloiseau+github@gmail.com> * Integrated @drashna and @fauxpark's PR comments - changed all plurals of "LED" to "LEDs" in the file - rewording of the note about host_keyboard_leds() vs. led_set_user() * Update docs/custom_quantum_functions.md Co-Authored-By: DidierLoiseau <didierloiseau+github@gmail.com>
2019-01-18MacOS Brightness Alias (#4836)Jeremy Bernhardt1-0/+4
* Added aliases for OSX brightness * Updated docs for alises * Moved aliases, added docs to Brightness section * Update docs/keycodes.md Co-Authored-By: germ <jeremythegeek@gmail.com> * Update docs/keycodes.md Co-Authored-By: germ <jeremythegeek@gmail.com> * Update keycode.h * Update keycode.h * Update keycodes.md * Update docs/keycodes.md Co-Authored-By: germ <jeremythegeek@gmail.com>
2019-01-17Simplify split_common Code significantly (#4772)James Churchill1-0/+2
* Eliminate separate slave loop Both master and slave run the standard keyboard_task main loop now. * Refactor i2c/serial specific code Simplify some of the preprocessor mess by using common function names. * Fix missing #endif * Move direct pin mapping support from miniaxe to split_common For boards with more pins than sense--sorry, switches. * Reordering and reformatting only * Don't run matrix_scan_quantum on slave side * Clean up the offset/slaveOffset calculations * Cut undebounced matrix size in half * Refactor debouncing * Minor fixups * Split split_common transport and debounce code into their own files Can now be replaced with custom versions per keyboard using CUSTOM_TRANSPORT = yes and CUSTOM_DEBOUNCE = yes * Refactor debounce for non-split keyboards too * Update handwired/xealous to build using new split_common * Fix debounce breaking basic test * Dodgy method to allow a split kb to only include one of i2c/serial SPLIT_TRANSPORT = serial or SPLIT_TRANSPORT = i2c will include only that driver code in the binary. SPLIT_TRANSPORT = custom (or anything else) will include neither, the keyboard must supply it's own code if SPLIT_TRANSPORT is not defined then the original behaviour (include both avr i2c and serial code) is maintained. This could be better but it would require explicitly updating all the existing split keyboards. * Enable LTO to get lets_split/sockets under the line * Add docs for SPLIT_TRANSPORT, CUSTOM_MATRIX, CUSTOM_DEBOUNCE * Remove avr-specific sei() from split matrix_setup Not needed now that slave doesn't have a separate main loop. Both sides (on avr) call sei() in lufa's main() after exiting keyboard_setup(). * Fix QUANTUM_LIB_SRC references and simplify SPLIT_TRANSPORT. * Add comments and fix formatting.
2019-01-17Add documentation and fix formating (#4860)Drashna Jaelre1-156/+145
2019-01-16Add some function comments in action_layer.c (#4858)Nikolaus Wittenstein1-6/+6
2019-01-09Add missing parentheses to some important macros (#4775)Konstantin Đorđević1-3/+3
* Add missing parentheses to quantum_keycodes macros * Add missing parentheses to progmem macros
2019-01-07Update to arm_atsam wait and timer routinespatrickmt2-18/+6
Microsecond (us) delays are now handled by a busy wait loop according to MCU frequency. This replaces the system counter method which had an overhead of around 12us. TC5 device and supporting routines removed as it was the old us delay counter. wait_ms is now properly a macro to CLK_delay_ms. wait_us is now properly a macro to CLK_delay_us. Removed CLK_get_us as it has no use. All calls to CLK_get_ms() have been replaced by timer_read64() with corrected typing. All calls to CLK_delay_ms() have been replaced by wait_ms(). All calls to CLK_delay_us() have been replaced by wait_us() and timings verified or updated as needed after review on scope. Corrected typing of variables using 64bit ms timer readings if needed.
2019-01-07Final HS60v2 changes. (#4790)yiancar7-648/+172
* initial commit, this now mostly works - RGB controls work - Dynamic keymap still broken due to eeprom - Via works * STM32 eeprom update - Update EEPROM emulation library to handle 8bit data like AVR. - This library also allows for multiple page pairs resulting in greater EEPROM size flexibility * hs60 changes * HS60 hhkb added * Update keyboards/hs60/v2/config.h Co-Authored-By: yiancar <yiangosyiangou@cytanet.com.cy>
2019-01-05Add underscores to names of brightness control constants in report.h (#4764)Konstantin Đorđević1-4/+4
2019-01-04Merge branch 'master' into debounce_refactorAlex Ong29-100/+1786
# Conflicts: # tmk_core/common/keyboard.c
2018-12-28Keep pressed keys on layer state change (fixes #2053, #2279) (#3905)Konstantin Đorđević3-1/+19
* Keep pressed keys on layer state change * Add doc comment for clear_keyboard_but_mods_and_keys * Keep pressed keys only if PREVENT_STUCK_MODIFIERS is on * Check STRICT_LAYER_RELEASE instead of PREVENT_STUCK_MODIFIERS
2018-12-15Refactor quantum/split_common/i2c.c, quantum/split_common/serial.c (#4522)Takeshi ISHII1-0/+4
* add temporary compile test shell script * Extended support of SKIP_VERSION to make invariant compile results during testing. * build_keyboard.mk, tmk_core/rules.mk: add LIB_SRC, QUANTUM_LIB_SRC support Support compiled object enclosed in library. e.g. ``` LIB_SRC += xxxx.c xxxx.c --> xxxx.o ---> xxxx.a ``` * remove 'ifdef/ifndef USE_I2C' from quantum/split_common/{i2c|serial}.c * add SKIP_DEBUG_INFO into tmk_core/rules.mk When SKIP_DEBUG_INFO=yes is specified, do not use the -g option at compile time. * tmk_core/rules.mk: Library object need -fno-lto * add SKIP_DEBUG_INFO=yes * remove temporary compile test shell script * add '#define SOFT_SERIAL_PIN D0' to keyboards/lets_split/rev?/config.h * quantum/split_common/serial.c: Changed not to use USE_I2C.
2018-12-14Fix up tap_code functionality (#4609)Drashna Jaelre2-1/+13
* Add delay in Tap Code to avoid issues I think a few people have reporting issues with it working properly, and it may be a timing issue. The 'register_code' uses this sort of delay in some of the functions, and this is probably why. Adding the 100ms delay should hopefully fix any issues with it. * Make tap_code delay configurable * Update documentation * Bring tap_code16 inline with changes * Fix type for tap_code16 Bad copy-paste job * Just use the value check for the define * Clarify timing in docs Co-Authored-By: drashna <drashna@live.com> * Wordsmithing Co-Authored-By: drashna <drashna@live.com>
2018-12-12Add standard definitions for ALGR and KC_ALGR (#4389)Konstantin Đorđević1-0/+1
* Add standard ALGR defition, remove (re)definitions from language files * Use ALGR(kc) consistently in ALTGR(kc) aliases * Non-Nordic keymaps should not use NO_ALGR * Add standard KC_ALGR definition * Update docs with ALGR and KC_ALGR * Update SS_ALGR and ALGR_T aliases
2018-12-04adding Hadron v3 keyboard, QWIIC devices support, haptic feedback support ↵ishtob2-3/+11
(#4462) * add initial support for hadron ver3 * add initial support for hadron ver3 * pull qwiic support for micro_led to be modified for use in hadron's 64x24 ssd1306 oled display * initial work on OLED using qwiic driver * early work to get 128x32 oled working by redefining qwiic micro oled parameters. Currently working, but would affect qwiic's micro oled functionality * moved oled defines to config.h and added ifndef to micro_oled driver * WORKING :D - note, still work in progress to get the start location correct on the 128x32 display. * added equation to automatically calculate display offset based on screen width * adding time-out timer to oled display * changed read lock staus via read_led_state * lock indications fixes * Added scroll lock indication to oled * add support for DRV2605 haptic driver * Improve readabiity of DRV2605 driver. -added typedef for waveform library -added unions for registers * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Fixes for PR * PR fixes * fix old persistent layer function to use new set_single_persistent_default_layer * fix issues with changing makefile defines that broken per-key haptic pulse * Comment fixes * Add definable parameter and auto-calibration based on motor choice
2018-11-28Add Extrakey support for Brightness up/down (#4477)Giuseppe Rota2-2/+11
2018-11-27Fixed docs/newbs_testing_debugging.md and tmk_core/common/print.hmtei1-5/+5
2018-11-16Use a single endpoint for HID reports (#3951)James Laird-Wah3-20/+69
* Unify multiple HID interfaces into one This reduces the number of USB endpoints required, which frees them up for other things. NKRO and EXTRAKEY always use the shared endpoint. By default, MOUSEKEY also uses it. This means it won't work as a Boot Procotol mouse in some BIOSes, etc. If you really think your keyboard needs to work as a mouse in your BIOS, set MOUSE_SHARED_EP = no in your rules.mk. By default, the core keyboard does not use the shared endpoint, as not all BIOSes are standards compliant and that's one place you don't want to find out your keyboard doesn't work.. If you are really confident, you can set KEYBOARD_SHARED_EP = yes to use the shared endpoint here too. * unify endpoints: ChibiOS protocol implementation * fixup: missing #ifdef EXTRAKEY_ENABLEs broke build on AVR with EXTRAKEY disabled * endpoints: restore error when too many endpoints required * lufa: wait up to 10ms to send keyboard input This avoids packets being dropped when two reports are sent in quick succession (eg. releasing a dual role key). * endpoints: fix compile on ARM_ATSAM * endpoint: ARM_ATSAM fixes No longer use wrong or unexpected endpoint IDs * endpoints: accommodate VUSB protocol V-USB has its own, understandably simple ideas about the report formats. It already blasts the mouse and extrakeys through one endpoint with report IDs. We just stay out of its way. * endpoints: document new endpoint configuration options * endpoints: respect keyboard_report->mods in NKRO The caller(s) of host_keyboard_send expect to be able to just drop modifiers in the mods field and not worry about whether NKRO is in use. This is a good thing. So we just shift it over if needs be. * endpoints: report.c: update for new keyboard_report format
2018-11-14Backlight status functions (#4259)Phillip Tennen2-6/+49
* add functions to set specific backlight state * add function to query backlight state * update documentation with new backlight functions * Update tmk_core/common/backlight.c Co-Authored-By: codyd51 <phillip.ennen@gmail.com> * Update tmk_core/common/backlight.h Co-Authored-By: codyd51 <phillip.ennen@gmail.com> * update docs for is_backlight_enabled() name change
2018-11-06command.h include was not set correctlyDrashna Jaelre1-4/+1
2018-11-06Fix Terminal feature on ChibiOSDrashna Jaelre1-0/+2
2018-11-02USB Suspend for arm_atsam protocolpatrickmt1-11/+79
Rewrote USB state tracking for implementation of suspend state. Updated suspend.c in entirety. Main subtasks (generally hardware related) are now run prior to keyboard task.
2018-11-02Move disable JTAG code from `keyboard_init` to `keyboard_setup`Danny Nguyen2-5/+11
This way all split keyboards are using that code instead of just those using split_common with the fix
2018-10-29Fix undefined reference to `console_printf` for CTRL and ALT keyboardspatrickmt1-2/+2
Fix undefined reference to `console_printf` for CTRL and ALT keyboards when enabling CONSOLE_ENABLE
2018-10-21Keyboard: bminiex : Working backlight (#4171)a-chol1-4/+1
* bminiex : Working backlight * bminiex keyboard with fixes * bminiex keyboard more fixes
2018-10-19stm32f1xx EEPROM emulation (#3914)Takuya Urakawa5-19/+33
* * Add stm32f1xx EEPROM emulation * Fix eeprom update compare bug Squashed commit of the following: commit b8f248ae08cec0cd81ecbb8854d9b39221d4d573 Author: hsgw <urkwtky@gmail.com> Date: Sat Sep 15 19:13:48 2018 +0900 fix EEPROM_update wrong compare commit d4ed4e6ea864e967a3e17f7edee4b0c3b4a25541 Author: hsgw <urkwtky@gmail.com> Date: Sat Sep 15 17:43:47 2018 +0900 eeprom fix initialization define commit b61aa7c04d70c64df3416d63e5da08b73b6053af Author: hsgw <urkwtky@gmail.com> Date: Sat Sep 15 16:33:40 2018 +0900 maybe working * Fix FLASH_KEY defines
2018-10-10Massdrop keyboards console device support for hid_listenpatrickmt2-2/+71
Added hid_listen USB device for arm_atsam USB protocol. Debug printing is now done through the console device (CONSOLE_ENABLE = yes) rather than the virtser device, for viewing in hid_listen. Function dpf(...) renamed to CDC_printf(...) and should now be called directly if intending to print to the virtual serial device.
2018-10-04Add mousekey_send to (un)register_codeDrashna Jaelre1-0/+2
2018-10-02Add tap_code function (#3784)Drashna Jaelre1-0/+1
* Add tap_code * formatting * Doc clarification * Rename variable to make more consistent
2018-10-02Add Function level EECONFIG code for EEPROM (#3084)Drashna Jaelre2-40/+107
* Add Function level EEPROM configuration Add kb and user functions for EEPROM, and example of how to use it. * Bug fixes and demo * Additional cleanup * Add EEPROM reset macro to example * Forgot init function in list * Move eeconfig_init_quantum function to quantum.c and actually set default layer * See if removing weak quantum function fixes issue * Fix travis compile error * Remove ifdef blocks from EECONFIG so settings are always set * Fix for ARM EEPROM updates * Fix merge issues * Fix potential STM32 EEPROM issues