Closed EmerickH closed 5 years ago
@btsimonh can you review this please?
though I may as well start where you are at :)
:). "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
did not activate and enable the serial buffers (and other stuff). config.h is still too complex :).
@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 :)
:) old protocol still works. now on to new....
got some working; stuck in sending from HB.
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 :).
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!!!!
Nice! I will test this Saturday, thank you very much for your job! Have you got any test script/protocol specifications to test faster?
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.
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.
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
one more commit for the day; ascii_protcol now separate to protocol.c - so the protcol.c is rather simpler now :)
I made some littles additions to select beetween protocols:
INCLUDE_PROTOCOL1
andINCLUDE_PROTOCOL2
in config.hprotocol2_xxx
functions toprotocol_xxx
to make them compatible with main.c calls (protocol 1'sprotocol_xxx
are now disabled if protocol 2 is choosen)To fix / to do:
READ_SENSOR
enabled byHOVERBOARD_WITH_SOFTWARE_SERIAL_B2_C9
is activating sensorcomms.c file which is creating errors because it is usingusart2_it_xx
andusart3_it_xx
variables (why?)Can we use the same ones as protocol.c ? For
ascii_byte
probably but isprotocol_process_message
=process_message
?Discussion on #4