Long title issue, here's the breakdown:
The Feather Duo is currently experiencing an unexpected bug where commands which are meant for one specific stage are being broadcast to both stages at the same time. This can be recreated by periodically sending a command that will edit MIDAS's state (for instance, PT), and while most of the time the command will go through as expected, it will sometimes trigger the PT command flag (and thus transition) on both the booster and sustainer MIDAS.
The issue most likely stems from an issue in the feather duo code itself, as running the same command in MIDAS-BASE's console yields the same issue sometimes. As both the radio and management threads run on the same core, there exists the (albeit very small) possibility that this is an issue of context switching between the radio threads, causing the same command to be consumed by both threads.
More likely though, there is a logical error in the feather duo software where commands can be sent to their respective queues regardless of if the stage matches the stage_select.
Couple useful things to look at:
- Input handling is done in the handle_serial function in
main.cpp:89-153. This function is invoked by the management thread in main.cpp:163 once a new line of input is processed.
- The logic for sending a command is handled in
Radio_Rx_Thread in main.cpp:70-74
- This uses our own implementation of a queue: Queue.h. While this is unlikely the culprit, you may want to familiarize yourself with how it works.
Long title issue, here's the breakdown:
The Feather Duo is currently experiencing an unexpected bug where commands which are meant for one specific stage are being broadcast to both stages at the same time. This can be recreated by periodically sending a command that will edit MIDAS's state (for instance,
PT), and while most of the time the command will go through as expected, it will sometimes trigger thePTcommand flag (and thus transition) on both the booster and sustainer MIDAS.The issue most likely stems from an issue in the feather duo code itself, as running the same command in MIDAS-BASE's console yields the same issue sometimes. As both the radio and management threads run on the same core, there exists the (albeit very small) possibility that this is an issue of context switching between the radio threads, causing the same command to be consumed by both threads.
More likely though, there is a logical error in the feather duo software where commands can be sent to their respective queues regardless of if the stage matches the stage_select.
Couple useful things to look at:
main.cpp:89-153. This function is invoked by the management thread in main.cpp:163 once a new line of input is processed.Radio_Rx_Threadin main.cpp:70-74