From df601313abc99f19d9edaf09ebe16a3dd1724860 Mon Sep 17 00:00:00 2001 From: Michael Dryden Date: Tue, 4 Nov 2014 18:46:14 -0500 Subject: [PATCH] Adjust main.c scanf() format strings to avoid compiler warnings. --- DSTAT-temp/src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DSTAT-temp/src/main.c b/DSTAT-temp/src/main.c index bb6514f..c1c5377 100644 --- a/DSTAT-temp/src/main.c +++ b/DSTAT-temp/src/main.c @@ -30,7 +30,7 @@ int8_t command_handler(char command){ switch (command){ case 'A': //ADS Buffer/rate/PGA values from ads1255.h - scanf("%x%x%x",&o1,&o2,&o3); + scanf("%hhx%hhx%hhx",&o1,&o2,&o3); printf("#A: %x %x %x\r\n",o1,o2,o3); ads1255_setup(o1, o2, o3); break; @@ -49,7 +49,7 @@ int8_t command_handler(char command){ break; case 'C': //CV - v1, v2, start, scans, slope - scanf("%u%u%i%i%i%i%i%u%u",&pct1,&pct2,&pcv1,&pcv2,&p1,&p2,&p3,&p5,&u1); + scanf("%u%u%i%i%i%i%i%hhu%u",&pct1,&pct2,&pcv1,&pcv2,&p1,&p2,&p3,&p5,&u1); precond(pcv1,pct1,pcv2,pct2); cv_experiment(p1,p2,p3,p5,u1); break; @@ -67,7 +67,7 @@ int8_t command_handler(char command){ break; case 'R': //CA - steps, step_dac[], step_seconds[] - scanf("%u",&p5); //get number of steps + scanf("%hhu",&p5); //get number of steps printf("#Steps: %u\n\r", p5); //allocate arrays for steps -- GitLab