Is the disabling of the robot, when the disable switch is triggered, handled through the code or the hardware? My guess is that it is through the hardware, based on the fact that the code still runs when the robot is disabled, which we can see through Dashboard, but none of the outputs output anything, obviously. However, if my memory serves me correctly, if the robot is disabled while in autonomous mode, execution of the code stops, which goes against what it does in normal mode. I suppose this could be done through the hardware, but it could go either way.
The command to Disable starts in code. The Master micro-processor then disables hardware (ICs on the board) to kill the PWM Outputs and Relay Outputs. The User micro-processor continues run code regardless of whether the RC is in Autonomous or normal mode. If your code stops executing while in Autonomous and Disabled, may have problem with your code. If you do have a problem with your code, the Program state LED would be flashing Red.
When programming and testing our autonomous function on the practice field, our autonomous routine worked flawlessly. the robot was tethered and we were using a switch on the competition port to activate the autonomous routine.
On the playing field, the autonomous routine did not behave the same. It seemed that it only ran for a few seconds. It was almost as if the autonomous mode was activated before the disabled mode was switched to enabled?
Should I be testing the disabled bit as well as autonomous mode bit?
Yes. We do not control the field or the sequence of event that leads to the Autonomous Mode. I would suggest that your code can handle any sequence that leads to Autonomous Mode.