From 29d4c86ad8b78d96c1776f0f9f1685d6d1eb945f Mon Sep 17 00:00:00 2001 From: "Michael D. M. Dryden" <mdryden@chem.utoronto.ca> Date: Fri, 5 Feb 2016 12:53:58 -0500 Subject: [PATCH] Move shutter controls to experiment. --- DSTAT/src/experiment.c | 19 +++++++++++++++++++ DSTAT/src/main.c | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/DSTAT/src/experiment.c b/DSTAT/src/experiment.c index 86db848..e9781b9 100644 --- a/DSTAT/src/experiment.c +++ b/DSTAT/src/experiment.c @@ -19,6 +19,7 @@ #include "settings.h" #include "tcs.h" #include "config/conf_board.h" +#include "shutter.h" //Public variable definitions uint16_t g_gain = POT_GAIN_30k; @@ -64,6 +65,7 @@ void experiment_handler(char command){ static uint16_t pct1, pct2; uint16_t tcs_data[] = {0,0,0,0}; uint16_t tcs_data1[] = {0,0,0,0}; + double p6; switch (command){ case 'A': //ADS Buffer/rate/PGA values from ads1255.h @@ -173,6 +175,23 @@ void experiment_handler(char command){ break; + case 'Z': //Shutter sync + scanf("%lg",&p6); + shutter_cont(p6); + break; + + case 'z': + shutter_cont_stop(); + break; + + case '1': + shutter_close(); + break; + + case '2': + shutter_open(); + break; + default: printf("#ERR: Command %c not recognized\n\r", command); } diff --git a/DSTAT/src/main.c b/DSTAT/src/main.c index 92089f1..d54995e 100644 --- a/DSTAT/src/main.c +++ b/DSTAT/src/main.c @@ -24,8 +24,6 @@ int8_t command_handler(char command){ * Calls functions in * @param command Command character input. */ - - double p1; switch (command){ case 'E': //Experiment options @@ -47,23 +45,6 @@ int8_t command_handler(char command){ printf("T%u.%u.%u.%u\n\r", tcs_data[0], tcs_data[1], tcs_data[2], tcs_data[3]); } break; - - case 'Z': //Test shutter - scanf("%lg",&p1); - shutter_cont(p1); - break; - - case 'z': - shutter_cont_stop(); - break; - - case '1': - shutter_close(); - break; - - case '2': - shutter_open(); - break; case 'V': //check version printf("V%u.%u\n\r", BOARD_VER_MAJOR, BOARD_VER_MINOR); -- GitLab