OpenSourceEBike / ebike_wireless_remote

ANT+ remote button
10 stars 8 forks source link

bluetooth + ANT working #5

Closed rananna closed 3 years ago

rananna commented 3 years ago

Bluetooth capability has been added. Ant Device number can be changed for ANT+ LEV control. I have tested with ANT+LEV devices with different device numbers and it works fine. Please note that variables are cleared with a reset, so, I added the function : write_to persistent_memory_and_reset() to deal with this issue. This needs to be added to the motor code also. Operation:

  1. short press on MINUS__PIN will decrease assist level
  2. short press on PLUS__PIN will increase assist level
  3. short press on ENTERPIN will pageup on Garmin bike computer 4 short press on STANDBYPIN will pagedown on garmin bike computet 5 long press on PLUS__PIN will start bluetooth advertising
  4. long press on MINUS__PIN will stop bluetooth advertising the remote will also stop bluetooth after 10 minutes of bluetooth advertising in case the user forgets to turn it off for lower power consumption.
casainho commented 3 years ago

Thanks!!

Adding the Bluetooth part is not easy. I think the commit needs a bit more work as there are things that does not make sense. For instance, you added TSDZ2_REMOTE_FIRMWARE_MAJOR and TSDZ2_REMOTE_FIRMWARE_MINOR to makefile and it is not used, right?

Also I see 2 main.c files, one inside the firmware folder.

And you added buttons.h, but that is also not used, right??

Can you please review all this?

See that I use [url=https://flathub.org/apps/details/org.gnome.gitg]gitg[/url] and [url=https://meldmerge.org/]meld[/url] to view the diffs between commits and repository / folder / file diffs. This kind of tools may help you.

Also try read about group some changes together, with git merge --squash. You can have a working branch but then merge to master with squash and it will be only one clean commit:

git checkout master git merge --squash bugfix git commit

rananna commented 3 years ago

Yes, there are clearly some issues I am having with Git, I will look into it and try again. Thanks for the references.