KMKfw / kmk_firmware

Clackety Keyboards Powered by Python
https://kmkfw.zulipchat.com
Other
1.32k stars 458 forks source link

[BUG] KC.MACRO_SLEEP_MS(ms) crashes when used #949

Closed Noki0100 closed 3 months ago

Noki0100 commented 3 months ago

Describe the bug As described in the documentation for Sequences I added KC.MACRO_SLEEP_MS(500) to my code.py after getting setup with a RP2040 with some standard Cherry MX switches and diodes, when adding this option it crashes my device. Documentation also shows KC.MACRO_SLEEP(1000), but is probably a typo as it does nothing (not even crash).

To Reproduce

Expected behavior Should type a sequence and include delays.

Debug output N/A

Additional context 12 Key custom keyboard, followed this guide. All keys work when mapped to single characters. Sequences function when there is no KC.MACRO_SLEEP_MS(500) present. Sample code:

TEST = simple_key_sequence(
        (
                KC.L,
                KC.O,
                KC.O,
                KC.K,
                KC.MACRO_SLEEP_MS(500),
                KC.SPC,
                KC.A,
                KC.T,
                KC.MACRO_SLEEP_MS(500),
                KC.SPC,
                KC.T,
                KC.H,
                KC.I,
                KC.S,
                KC.MACRO_SLEEP_MS(500),
                KC.COLN,
                KC.SPC,
        )
)

keyboard.keymap = [
    [KC.A, KC.B, KC.C, KC.D, TEST, KC.F, KC.G, KC.H, KC.I, KC.J, KC.K, KC.L],
]

Also tried time.sleep(1) and this just stops it at the point where it is in the sequence.

gsteen commented 3 months ago

Are u using circiutpython 9.0.0? If so see #947