Closed securelyfitz closed 12 months ago
seems like tx/rx is reliable enough it's best to just do it once, plus then you don't get misaligned byte pairs also, seems like uart timeout is good enough if set low. still need to clean up code and remove print statements
also - clue validation happens in the game data structure
fixed an annoying issue where if i sent too much data (~20 bytes) the rp2040 would hard crash a few seconds later. no errors. added a flush() after each byte write, while excessive , gets it one.
still need to clean up overlay geometry
overlay and text cleaned up. annoying hard crash issue disappeared for small transactions, but is now blocking TX/RX. some details:
theory:
More notes:
workaround is to use busio to create the UART interface with a large buffer. Have not isolated the missing bounds checking.
Solved two issues with TX/RX sync with a lead-in of carriage returns:
With this, the majority of transmissions are flawless. There are still occasional bitflips, but crc/encryption should easily catch those.
Closing this for the badge - but will pursue the memory corruption issue elsewhere.
right now it mostly works but has a few software delays hard coded for ease of debugging.
probably makes sense to break out 'transmit' and 'receive' into class member functions to make the trade logic a bit cleaner
also - once a trade happens, the card needs to be validated and both the card and handle need to be stored properly