btsimonh / hoverboard-firmware-hack

New Hoverboard Firmware Hack. Now written from scratch and generally much better.
GNU General Public License v3.0
22 stars 4 forks source link

Littles additions to select beetween protocols #6

Closed EmerickH closed 5 years ago

EmerickH commented 5 years ago

I made some littles additions to select beetween protocols:

To fix / to do:

Discussion on #4

EmerickH commented 5 years ago

@btsimonh can you review this please?

btsimonh commented 5 years ago

though I may as well start where you are at :)

btsimonh commented 5 years ago

:). "READ_SENSOR enabled by HOVERBOARD_WITH_SOFTWARE_SERIAL_B2_C9 is activating sensorcomms.c file which is creating errors because it is using usart2_it_xx and usart3_it_xx variables (why?)" because you moved the control defines to the end... so

if defined(READ_SENSOR)

did not activate and enable the serial buffers (and other stuff). config.h is still too complex :).

btsimonh commented 5 years ago

@EmerickH - i've pushed to newprotocol - explanation in commit. But now going to do a little cleanup (add comments, move important functions to the top, etc.) before testing :)

btsimonh commented 5 years ago

:) old protocol still works. now on to new....

btsimonh commented 5 years ago

got some working; stuck in sending from HB.

btsimonh commented 5 years ago

current status: receives and acks messages. ascii works (from very simple tests of disabling poweroff). Test message is acked and responded to. Two messages are send out if acks are not sent. I have part of protocol_tick() temporarily - it was interfering with testing, so will test/implement last. back to 'real' work for a while, so if you do any fixes, please contribute :).

btsimonh commented 5 years ago

update: All now working for basic tests on protocol2 and protocol1 Once concern is console_log - I think in my config will trigger some kind of DMA!!!!

EmerickH commented 5 years ago

Nice! I will test this Saturday, thank you very much for your job! Have you got any test script/protocol specifications to test faster?

btsimonh commented 5 years ago

my testing has been from NodeRed (javascript snippets); If you are familiar with it, just watch out for linux serial port transparency. Let me know if it's useful, and I'll tart up my test flow and push it in the repo. Else I can separate out the JS for protocol parsing as a separate JS snippet file.

EmerickH commented 5 years ago

I've never used NodeRed but I know vanilla Javascript and NodeJs (it's what I was using on my first tests) so it should be OK. I can separate myself the protocol if you don't have time.

btsimonh commented 5 years ago

just pushed a NR flow, plus a 'snippets.js' - this should give you a head start. It's pretty much all there now. have read and written hall data and sensor data via protocol. Have seen the odd NACK. No resends/timeouts from JS yet. s

btsimonh commented 5 years ago

one more commit for the day; ascii_protcol now separate to protocol.c - so the protcol.c is rather simpler now :)