Skip to content
This repository has been archived by the owner on Jul 1, 2018. It is now read-only.

Commit

Permalink
Controller game state control also over config port
Browse files Browse the repository at this point in the history
  • Loading branch information
cduck committed Nov 1, 2014
1 parent 578c6ec commit c2a595f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controller/src/radio_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,22 +73,27 @@ 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:
break;
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();
Expand Down

0 comments on commit c2a595f

Please sign in to comment.