From bcf3d9f8826c1dd863eefe206f35fa404fa83cfb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 22 May 2024 23:39:07 -0400 Subject: [PATCH] Update main.c add interrupt --- main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.c b/main.c index e6853255..c9ae62b3 100644 --- a/main.c +++ b/main.c @@ -21,6 +21,7 @@ #include "main.h" +void read_adc_process(int sig_num); //#define HAB // uncomment to change APRS icon from Satellite to Balloon and only BAT telemetry @@ -44,6 +45,9 @@ int main(int argc, char * argv[]) { } read_adc(); + + signal(SIGALRM, alarmWakeup); + ualarm(125, 125); printf("\n\nCubeSatSim v1.3.2 starting...\n\n"); @@ -2215,3 +2219,13 @@ void read_adc() printf("Digital value of analog input: %d in %d us\n", raw_adc, (time_stop - time_start)/10); // millis() - time_start); } + +void read_adc_process(int sig_num) +{ + if(sig_num == SIGALRM) + { +// read ADC + printf("read_adc_process\n"); + } + +}