ErgoDox / tmk_ErgoDox

Classic I_2C ErgoDox firmware.
GNU General Public License v3.0
1 stars 0 forks source link

Code cleanup #24

Open wobbol opened 7 years ago

wobbol commented 7 years ago

Removes an old #ifdef for cub's left hand led stuff and gives an example of how to use it. I don't have an ErgoDox with left hand leds so I can't test this, but I think it will work.

marknsikora commented 7 years ago

I think it would be better to move this code under a user hook personally, that way we don't have to worry about defining an empty function in each layout. I think there was some work to implement this in the cub repo.

wobbol commented 7 years ago

I gave a cursory glance to cub's and ben's repo and maybe I missed something, but I couldn't see much relevant to this use case. Maybe I could do something like this: Global function pointer, called hook_matrix_scan, in matrix.c that get initialized in matrixinit, if the keymap.c didn't assign the hook to anything. hook_matrix_scan is called in matrix_scan(). I am a little shaky on function pointers and I am not sure how robust this design will be in the future. That is why I didn't go this route. Does hook_matrix_scan have some semblance to a user hook? How can it be improved?

wobbol commented 7 years ago

void hook_layer_change(uint32_t layer_state) is where this code belongs.