TabbycatPie / CustomKeyboard

A small CH551 project
52 stars 10 forks source link

Hitting 34 (+5) key device limit #13

Closed mpheyse closed 2 years ago

mpheyse commented 2 years ago

Store Page clear says "The total length of each key macro is 40 digits"

Yet the software stops at 34 digits "1234567890123456789012345678901234" for one macro with an error "Can NOT add macro key: Hardware limitation"

The error is false as you can still add a single digit to all of the other keys, and it still works. (39 total)

Another way: add "1234567890" to keys 1,2,3. Then on key 4 it will error after "1234" (34 device total digits) , yet you can still ad just one digit to the rest (36 total)

So the error is wrong and its not stopping us at a HW limit. And we are not getting our 40x6key macros as promised.

TabbycatPie commented 2 years ago

A single digit is called normal key(personnally), Macro keys are stored in a diffierent place in memory ,so you can still set normal keys after macro's memory is full ( you can not create another macro key , but you can still set normal keys ).I know, this data structure sounds weird and foolish in some way(it wastes precious flash memory), but this is a pretty simple way to expand function of this device without touching previous codes. And I also think this chipset is too weak to handle such complex algorithm

TabbycatPie commented 2 years ago

https://github.com/TabbycatPie/CustomKeyboard/blob/main/CustomKeyboard/usar/main.c at line 13, there are only 34 keycodes you can add to the macro keycode array. I sacrificed some macro's dataflash for other utilities, maybe some old version firmware are 40 macro keys but new versions are 34. And the total dataflash of the chip are128B, each keycode is 1B ,there is no way to make 40*6 macros happen. In the end Im really sorry for the store's description misleading QAQ.