diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-05-06 21:10:00 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-05-06 21:10:00 +0000 |
commit | bbbdceb9d13441f4b96257718ed090b8998759f7 (patch) | |
tree | 6bb4e7cbc0c05dc47f8d7de2848b67b189bd5279 /nuttx/configs/vsn/src | |
parent | 4c3a7673e9a391302a0e2417d8846bfdf7d9171f (diff) | |
download | px4-nuttx-bbbdceb9d13441f4b96257718ed090b8998759f7.tar.gz px4-nuttx-bbbdceb9d13441f4b96257718ed090b8998759f7.tar.bz2 px4-nuttx-bbbdceb9d13441f4b96257718ed090b8998759f7.zip |
More timer changes from Uros
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3572 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/vsn/src')
-rw-r--r-- | nuttx/configs/vsn/src/sif.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/nuttx/configs/vsn/src/sif.c b/nuttx/configs/vsn/src/sif.c index 2d5351e87..4be214444 100644 --- a/nuttx/configs/vsn/src/sif.c +++ b/nuttx/configs/vsn/src/sif.c @@ -508,8 +508,9 @@ int sif_main(int argc, char *argv[]) return 0; } else if (!strcmp(argv[1], "time") && argc == 3) { - int val = atoi(argv[2]); - up_rtc_settime(val); + struct timespec t_set; + t_set.tv_sec = atoi(argv[2]); + clock_settime(CLOCK_REALTIME, &t_set); } else if (!strcmp(argv[1], "i2c") && argc == 3) { int val = atoi(argv[2]); @@ -551,7 +552,13 @@ int sif_main(int argc, char *argv[]) } fprintf(stderr, "%s:\tinit\n\tgpio\tA B\n\tpwr\tval\n", argv[0]); - fprintf(stderr, "time = %d / %d, time = %d\n", - up_rtc_gettime(), up_rtc_getclock(), time(NULL) ); + + struct timespec t_active; + clock_gettime(CLOCK_ACTIVETIME, &t_active); + + fprintf(stderr, "rtc time = %u / %u, active = %u / %u, time / systick = %u / %u\n", + up_rtc_gettime(), up_rtc_getclock(), + t_active.tv_sec, t_active.tv_nsec, + time(NULL), clock_systimer() ); return -1; } |