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

Commit

Permalink
added a clear flag for the pedometer
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott White committed Mar 16, 2011
1 parent 1eba30c commit def59ab
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions examples/omron_720IT_test/omron_720IT_csv_dump.c
Expand Up @@ -2,6 +2,7 @@
#include <stdio.h>
#include <stdlib.h> /* atoi */
#include <time.h>
#include <unistd.h> /* getopt */

#define SECONDS_PER_DAY 86400

Expand All @@ -20,9 +21,15 @@ int main(int argc, char** argv)
char time_str[20];
struct tm *timeptr;
time_t today_secs, other_secs;
int ch, clear_flag = 0;

if (argc > 1)
bank = atoi(argv[1]);
while((ch = getopt(argc, argv, "d")) != -1) {
switch (ch) {
case 'd':
clear_flag = 1;
break;
}
}

if(test == NULL)
{
Expand Down Expand Up @@ -102,6 +109,9 @@ int main(int argc, char** argv)
free(h);
}
}
if(clear_flag) {
ret = omron_clear_pd_memory(test);
}
ret = omron_close(test);
if(ret < 0)
{
Expand Down

0 comments on commit def59ab

Please sign in to comment.