tygamvrelis / oil_lamp

Gimballed oil lantern motion recording & playback
1 stars 0 forks source link

MCU code updates #55

Closed tygamvrelis closed 4 years ago

tygamvrelis commented 4 years ago

Fixes #53.

Seems like the root cause was a UART framing error caused by the RPi transmitting some junk data to the MCU right before its first transmission. I thought the MCU code would have been robust to such issues, since I was conditionally resetting the USART hardware if huart2.RxState indicated an error. However, it turns out I actually had to check huart2.ErrorCode to catch framing errors.

Upon making this fix to the MCU code, playback successfully started up autonomously on the RPi several times, as desired!

This PR also brings in a reset command for the MCU which can be issued from within the Python code. Also implements lss_goLimp on the MCU side because I thought it might be useful to have sitting around.