Commit graph

145 commits

Author SHA1 Message Date
tmk
856f5b3f88 core: Change bootmagic nkro 2023-11-27 02:31:35 +09:00
tmk
0c25c62a6d core: Fix bootmagic keymap_config for unimap 2023-11-27 02:15:05 +09:00
tmk
1cc716477b core: Fix bootmagic
- EEPROM_CLEAR wipes out eeprom with 0xFF now(avr)
- keymap config is not enabled during bootmagic
- wait until all key is released after bootmagic
- add eeconfig_debug() to command.c
2023-11-26 22:10:34 +09:00
tmk
66da6f4d64 core: Fix bootmagic for NKRO 2023-11-26 14:37:05 +09:00
tmk
50347c692b core: mouse debug print 2023-10-31 12:45:24 +09:00
tmk
002537b8ea core: Add mousekey support to ACTION_KEY() #675
ACT_MOUSEKEY can be removed but kept for backward compatibility.
Mousekeys work with ACTION_KEY(), ACTION_MODS_KEY(), ACTION_MODS_TAP_KEY() now.
But not completely with ACTION_LAYER_TAP_KEY(),
layer_param_bit_op { OP_TAP_TOGGLE, OP_ON_OFF, OP_OFF_ON, OP_SET_CLEAR }
overlaps with mousekeys KC_MS_* paritally(F0-F3).
2023-07-08 12:57:35 +09:00
tmk
46a060cd88 core: Include action_layer.h 2023-03-22 23:11:43 +09:00
tmk
45c7057b3b core: Fix BTLD action for tap key 2023-03-02 09:52:41 +09:00
tmk
059a330a29 core: Add JPY to unimap position code 2022-04-25 22:37:52 +09:00
tmk
6795e8fc0e core: Add keycode MACE and MACJ for macOS
Mac key 英数(eisuu) and かな(kana) send usage LANG2(0x91) and  LANG1(0x90)
respectively, and macOS uses them for English-Japanese input switching.
This gives the usages aliase as MACE and MACJ.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#japanese-jis-keys
2022-01-10 14:53:11 +09:00
tmk
d0cddedcdc adb_usb: Initialize keyboard dynamically #671
Extended and ISO keyboard are properly setup even after hot-plug
2021-11-17 23:49:12 +09:00
tmk
5f7d388dee core: Mouse buttons state integration #101
This allows users to use mousekey buttons with PS/2, ADB or
Serial pointing device.
2021-11-14 01:56:15 +09:00
tmk
4964617a31 core: NO_KEYBOARD build option
disables USB keyboard interface
2021-07-20 22:48:01 +09:00
tmk
7438f7baab ibmpc: ringbuf optimization for c 2021-07-07 23:13:15 +09:00
tmk
d14a00c44e core: Fix keymap.h header for C++ 2021-06-30 17:04:08 +09:00
tmk
2b07c0bd00 core: Build option: NKRO_6KRO_ENABLE 2021-06-29 20:35:24 +09:00
tmk
3341801f21 core: Fix ACTION_LAYER_MODS 2021-06-29 18:15:24 +09:00
tmk
4ed3e40fc0 lufa: Boot support for mouse extended report #692 2021-06-22 00:02:16 +09:00
Ethan Halsall
9b77bf9295 lufa: Update mouse descriptor for 16 bit #692
Squashed commit from: https://github.com/tmk/tmk_keyboard/pull/692
2021-06-22 00:02:16 +09:00
tmk
06d354c06b core: Fix is_tap_key() #673
System and media control keys work well with
ACTION_MODS_TAP_KEY and ACTION_LAYER_TAP_KEY now.
2021-02-08 16:28:59 +09:00
tmk
1460fbcf1c core: Update comments in keycode.h 2021-01-24 15:44:03 +09:00
tmk
02664fe72a core: Fix TAP_KEY(CapsLock) for MacOS #659 2020-11-07 17:18:18 +09:00
tmk
ab083c7ecf core: Clean up code of Locking key support 2020-11-07 17:17:13 +09:00
tmk
6271878a02 vusb: Fix keyboard_protocol and keyboard_idle #547 2020-07-27 10:02:38 +09:00
tmk
5c45beb89e core: Fix matrix_print() 2020-06-02 00:57:37 +09:00
tmk
3208b7e447 core: Add default impl for led_set() 2020-05-30 15:20:05 +09:00
tmk
0ab0ebf8cb core: Make TIMER0 ISR noblock
The TIMER0 ISR takes 1.5us and can affect IBMPC protocol ISR.
Add ISR_NOBLOCK to allow interrupt during TIMER0 ISR.
2020-05-22 11:52:44 +09:00
tmk
dd316b990f core: Add HID usage for Display Brightness Control 2020-05-11 21:58:50 +09:00
Purdea Andrei
061e662345 tmk_core/common/timer.h: Improve code generation for TIMER_DIFF* macros
Because of integer promotion the compiler is having a hard time generating
efficient code to calculate TIMER_DIFF* macros in some situations.
In the below example, the return value is "int", and this is causing the
trouble.

Example C code:

int __attribute__ ((noinline)) test(uint8_t current_timer, uint8_t start_timer)
{
    return TIMER_DIFF_8(current_timer, start_timer);
}

BEFORE: (with -Os)

00004c40 <test>:
    4c40:       28 2f           mov     r18, r24
    4c42:       30 e0           ldi     r19, 0x00       ; 0
    4c44:       46 2f           mov     r20, r22
    4c46:       50 e0           ldi     r21, 0x00       ; 0
    4c48:       86 17           cp      r24, r22
    4c4a:       20 f0           brcs    .+8             ; 0x4c54 <test+0x14>
    4c4c:       c9 01           movw    r24, r18
    4c4e:       84 1b           sub     r24, r20
    4c50:       95 0b           sbc     r25, r21
    4c52:       08 95           ret
    4c54:       c9 01           movw    r24, r18
    4c56:       84 1b           sub     r24, r20
    4c58:       95 0b           sbc     r25, r21
    4c5a:       93 95           inc     r25
    4c5c:       08 95           ret

AFTER: (with -Os)

00004c40 <test>:
    4c40:       86 1b           sub     r24, r22
    4c42:       90 e0           ldi     r25, 0x00       ; 0
    4c44:       08 95           ret

Note: the example is showing -Os but improvements can be seen at all optimization levels,
including -O0. We never use -O0, but I tested it to make sure that no extra code is
generated in that case.
2020-04-01 07:46:18 +03:00
Purdea Andrei
338a1506dc tmk_core/common/timer.h: Fixing TIMER_DIFF macro to calculate difference correctly after the timer wraps.
Let's go through an example, using the following macro:

If the first timer read is 0xe4 and the second one is 0x32, the timer wrapped.
If the timer would have had more bits, it's new value would have been 0x132,
and the correct difference in time is 0x132 - 0xe4 = 0x4e

old code TIMER_DIFF_8(0x32, 0xe4) = 0xff - 0xe4 + 0x32 = 0x4d, which is wrong.
new code TIMER_DIFF_8(0x32, 0xe4) = 0xff + 1 - 0xe4 + 0x32 = 0x4e, which is correct.

This also gives a chance for a smart compiler to optimize the code using normal
integer overflow.

For example on AVR, the following C code:
uint8_t __attribute__ ((noinline)) test(uint8_t current_timer, uint8_t start_timer)
{
    return TIMER_DIFF_8(current_timer, start_timer);
}
With the original code, it gets translated to the following list of instructions:
00004c6e <test>:
    4c6e:       98 2f           mov     r25, r24
    4c70:       86 1b           sub     r24, r22
    4c72:       96 17           cp      r25, r22
    4c74:       08 f4           brcc    .+2             ; 0x4c78 <test+0xa>
    4c76:       81 50           subi    r24, 0x01       ; 1
    4c78:       08 95           ret
But with this commit, it gets translated to a single instruction:
00004c40 <test>:
    4c40:       86 1b           sub     r24, r22
    4c42:       08 95           ret

This unfortunately doesn't always work so nicely, for example the following C code:
int __attribute__ ((noinline)) test(uint8_t current_timer, uint8_t start_timer)
{
    return TIMER_DIFF_8(current_timer, start_timer);
}
(Note: return type changed to int)
With the original code it gets translated to:
00004c6e <test>:
    4c6e:       28 2f           mov     r18, r24
    4c70:       30 e0           ldi     r19, 0x00       ; 0
    4c72:       46 2f           mov     r20, r22
    4c74:       50 e0           ldi     r21, 0x00       ; 0
    4c76:       86 17           cp      r24, r22
    4c78:       20 f0           brcs    .+8             ; 0x4c82 <test+0x14>
    4c7a:       c9 01           movw    r24, r18
    4c7c:       84 1b           sub     r24, r20
    4c7e:       95 0b           sbc     r25, r21
    4c80:       08 95           ret
    4c82:       c9 01           movw    r24, r18
    4c84:       84 1b           sub     r24, r20
    4c86:       95 0b           sbc     r25, r21
    4c88:       81 50           subi    r24, 0x01       ; 1
    4c8a:       9f 4f           sbci    r25, 0xFF       ; 255
    4c8c:       08 95           ret
Wth this commit it gets translated to:
00004c40 <test>:
    4c40:       28 2f           mov     r18, r24
    4c42:       30 e0           ldi     r19, 0x00       ; 0
    4c44:       46 2f           mov     r20, r22
    4c46:       50 e0           ldi     r21, 0x00       ; 0
    4c48:       86 17           cp      r24, r22
    4c4a:       20 f0           brcs    .+8             ; 0x4c54 <test+0x14>
    4c4c:       c9 01           movw    r24, r18
    4c4e:       84 1b           sub     r24, r20
    4c50:       95 0b           sbc     r25, r21
    4c52:       08 95           ret
    4c54:       c9 01           movw    r24, r18
    4c56:       84 1b           sub     r24, r20
    4c58:       95 0b           sbc     r25, r21
    4c5a:       93 95           inc     r25
    4c5c:       08 95           ret
There is not much performance improvement in this case, however at least with this
commit it functions correctly.

Note: The following commit will improve compiler output for the latter example.
2020-04-01 07:45:05 +03:00
tmk
01477b7ef2 core: Fix unimap translation range 2020-02-03 12:47:01 +09:00
tmk
37a452f7c9 core: Fix bootloader for 128KB flash
Got warning on bootloader address calculation when MCU has 128KB flash
2019-12-04 15:09:36 +09:00
tmk
698c957cad core: Add short name for keycode KP_00 and KP_000 2019-11-12 15:38:31 +09:00
tmk
bc821b79d0 core: Remove unneeded code in bootloader_jump 2019-09-18 14:14:25 +09:00
tmk
83b90f4b6f core: Add AC_BTLD to actionmap and unimap
Now that it can jump to bootloader with AC_BTLD
2019-09-17 20:55:35 +09:00
tmk
c09600b56b core: Read bootloader size from AVR fuse bits
This makes defining BOOTLOADER_SIZE macro optional.
2019-09-17 16:19:52 +09:00
tmk
b3980122bb core: Fix comment and remove unused code 2019-09-16 18:43:38 +09:00
tmk
19350e3ee5 core: Add bootkey of Caterina bootloader
The bootkey set in bootloader_jump() works with Pro Micro and Leonardo.
This fix doesn't seem to prevent other bootloaders, however, it can be
disabled by defining NO_BOOTLOADER_CATERINA_BOOTKEY.
2019-09-16 17:49:38 +09:00
tmk
814eaa2dff core:adb_usb: Add Extended Mouse Protocol support #274
Also add Kensington Turbo Mouse 5 specific initialization
2019-06-23 15:04:35 +09:00
tmk
2b83b9a8f9 core: Add hook_process_action() 2019-05-29 23:57:51 +09:00
tmk
8449ad385b lufa: Print TMK version to console 2019-05-29 23:42:56 +09:00
tmk
f3e498590c core: Add hook_usb_startup_wait_loop 2019-05-29 14:50:56 +09:00
tmk
55443fabb7 core: Avoid deadlock when uart.c is used in ISR 2019-05-07 00:07:19 +09:00
tmk
c41e48a0ab core: Fix uart.c for ATmega32U4 2019-04-21 11:55:47 +09:00
rxy0424
8345571e1d make some change to complie stm32_f103_onekey with new version of Chibios (#583) 2018-11-07 08:08:08 +09:00
Konstantin Đorđević
a159172951 Fix header guard in tmk_core/common/command.h (#581) 2018-10-31 09:34:01 +09:00
tmk
6632802c79 core: Add ring buffer file 2018-09-23 12:36:18 +09:00
Øystein Bech Gadmar
9a9b8edfa9 core: Add utility macros in action_macro.h (#532) 2018-01-29 08:10:35 +09:00
tmk
d415e99f0c core: Add utility type_code() in aciton.h #528 2018-01-28 16:17:20 +09:00
alex-ong
f9e3bf7f38 core: Typo (mantrix -> matrix) 2018-01-26 16:53:27 +09:00