Melodee’s Status Update for 3/28/2020

Melodee’s Status Update for 3/28/2020

Progress

I spent this week debugging the Python firmware, and now the program works with the following scenarios:

  • One master tile and up to five slave tiles
  • Handling two play button presses in a row (the second press will be queued up and handed after the first iteration completes)
  • Handling multiple iterations in a row, with or without different tile configurations between the iterations

I also fixed all the known race conditions in the code by doing the following:

  • Instead of having the side interrupt handlers directly perform logic on the pulse received, queue up the pulses received and their timestamps and handle them in the main loop. Doing so prevents the interrupt handler from taking up too much time.
  • Whenever a pulse is added to the queue, sort the queue by time received so that pulses are handled in order.
  • Adding mutexes to each side, and locking them when a pulse is added or popped from the respective side queue. This prevents race conditions, as both the side interrupt handler and main loop might try to access the queue at the same time.

I still need to test and debug the following scenarios:

  • Tiles having multiple parents requests
  • Tiles having multiple children
  • Tile configuration wrapping around so that tile coordinates are negative relative to the master tile

I also realized that there was a case we didn’t consider before: that if Tile A is woken up by Tile B, and then Tile C sends a pulse to Tile A, Tile A has no idea whether Tile C is attempting to send a wake up signal or a real message. After discussing this problem with Eric, we decided that each tile side will be required to send a wake up pulse when trying to communicate with its neighbor for the first time. It is then up to each side to keep track of whether it’s sent a wake up pulse to its neighbor, and whether it’s received a wake up pulse from its neighbor.

Schedule

Last week, I said I would have liked to complete the Python simulator, but unfortunately I have a few more tests to make. Hopefully I can finally wrap it up, go over it with Eric, and then get to work on the C firmware.

Goals for next week

  • Finish debugging Python edge cases
  • Begin working on C simulation of tiles, time permitting

Leave a Reply

Your email address will not be published. Required fields are marked *