Closed NilsMinor closed 4 years ago
Hi,
I think it would be better to change the signature of the ButtonHandler so that the type of button event is directly passed to that handler: void ButtonHandler(u8 buttonId, ButtonState buttonState, u32 timeDs)
Also, I think you have some code formatter that cluttered the pull request a lot. We would only be able to merge it if only the proper places in the code are changed.
Thanks :-) Marius
Hi,
I thought it might be wrong to change all ButtonEvent handlers but of course I can do it this way :) I used visual code which seems to format the code different to your style. I want to change my IDE to eclipse, do you have your format style as .xml file? I have some problems figuring out why eclipse (the newest mars version) doe not find so many functions and variables. Do you provide an eclipse setup? I've seen an old project from your company with an eclipse setup (https://github.com/mwaylabs/fruitymesh-devenv) do you also provide a new repo for this? This would make the development setup much easier ^^. Thanks, Nils
I added an ButtonState enum to with the states INITAL, PRESSED, RELEASED. I also added a new variable 'ButtonState button1State' to . The button handler will be called on falling and rising edge and still stores the hold time in button1HoldTimeDs. Inside the overwritten Module::ButtonHandler function the user can call GS->button1State to get information about the button wass pressed or released. This commit should fix #123