From c2a595f0f0c79faa29242ecb65c23c46d611a24a Mon Sep 17 00:00:00 2001 From: Casey Duckering Date: Sat, 25 Oct 2014 22:08:02 -0700 Subject: [PATCH] Controller game state control also over config port --- controller/src/radio_config.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/controller/src/radio_config.c b/controller/src/radio_config.c index e41b6b7b..5cde87a4 100644 --- a/controller/src/radio_config.c +++ b/controller/src/radio_config.c @@ -23,6 +23,7 @@ #include "inc/task.h" #include "inc/queue.h" #include "inc/smartsensor/ssutil.h" +#include "inc/runtime.h" typedef struct { config_port *port; @@ -72,7 +73,7 @@ static portTASK_FUNCTION_PROTO(radioConfigTask, pvParameters) { while (1) { ConfigMessage msg; while (xQueueReceive(configMessageQueue, &msg, portMAX_DELAY) == pdTRUE) { - switch (msg.port->id) { + switch (msg.port->id) { // TODO(vdonato): Implement the rest case ID_START_VM: break; case ID_STOP_VM: @@ -80,14 +81,19 @@ static portTASK_FUNCTION_PROTO(radioConfigTask, pvParameters) { case ID_LOAD_MAIN_THREAD: break; case ID_CONTROL_UNFREEZE: + // TODO(vdonato): Figure out what to do break; case ID_CONTROL_STOP: + setGameMode(RuntimeModePaused); break; case ID_CONTROL_UNPOWERED: + setGameMode(RuntimeModeDisabled); break; case ID_CONTROL_SET_AUTON: + setGameMode(RuntimeModeAutonomous); break; case ID_CONTROL_SET_TELEOP: + setGameMode(RuntimeModeTeleop); break; case ID_DEVICE_GET_LIST: { config_port *deviceList = getDeviceList();