The software in the main computer of the rover changes modes once the cruise portion of the mission is complete and the spacecraft begins to enter the Martian atmosphere. Upon entry into the Martian atmosphere, the software executes a control loop that monitors the status of the vehicle. It checks for the presence of commands to execute, performs communication functions, and checks the overall status of the rover. The software does similar health checks in a third mode once the rover emerges from the lander.
This main control loop essentially keeps the rover active by constantly checking itself to ensure that it is both able to communicate throughout the surface mission and that it remains thermally stable (not too hot or too cold) at all times. It does so by periodically checking temperatures, particularly in the rover body, and responding to potential overheating conditions, recording power generation and power storage data throughout the Mars sol (a Martian day), and scheduling and preparing for communication sessions.