summaryrefslogtreecommitdiff
path: root/nuttx/configs/vsn
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-07 19:22:15 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-07 19:22:15 +0000
commitca700d2e3c06a80de37c5ef8383ca550fe20c750 (patch)
treed486856c6dafe9c6271b7808caaa4920bef63474 /nuttx/configs/vsn
parentb238002998250df997560fac2b0f18550f998855 (diff)
downloadpx4-nuttx-ca700d2e3c06a80de37c5ef8383ca550fe20c750.tar.gz
px4-nuttx-ca700d2e3c06a80de37c5ef8383ca550fe20c750.tar.bz2
px4-nuttx-ca700d2e3c06a80de37c5ef8383ca550fe20c750.zip
Mostly cosmetic changes from Uros
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3575 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/vsn')
-rw-r--r--nuttx/configs/vsn/src/sif.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/nuttx/configs/vsn/src/sif.c b/nuttx/configs/vsn/src/sif.c
index 2cd807138..5b86db77a 100644
--- a/nuttx/configs/vsn/src/sif.c
+++ b/nuttx/configs/vsn/src/sif.c
@@ -77,7 +77,7 @@
#include <nuttx/progmem.h>
#include <nuttx/i2c.h>
-#include <nuttx/sensors/st_lis331dl.h>
+#include <nuttx/sensors/lis331dl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -285,7 +285,7 @@ int sif_gpios_unlock(vsn_sif_state_t peripheral)
* Analog Outputs
****************************************************************************/
-static volatile int test = 0, test_irq;
+static volatile int test = 0, teirq;
static int sif_anout_isr(int irq, void *context)
@@ -293,7 +293,7 @@ static int sif_anout_isr(int irq, void *context)
STM32_TIM_ACKINT(vsn_sif.tim8, 0);
test++;
- test_irq = irq;
+ teirq = irq;
return OK;
}
@@ -531,10 +531,12 @@ int sif_main(int argc, char *argv[])
}
}
while (status >= 0);
+ return 0;
}
else if (!strcmp(argv[1], "erase") && argc == 3 ) {
int page = atoi(argv[2]);
printf("Erase result: %d\n", up_progmem_erasepage(page) );
+ return 0;
}
else if (!strcmp(argv[1], "flash") && argc == 3 ) {
uint16_t page = atoi(argv[2]);
@@ -542,27 +544,28 @@ int sif_main(int argc, char *argv[])
printf("Write result: %d (writing to address %xh)\n",
up_progmem_write( addr, "Test", 4 ), addr);
+ return 0;
}
else if (!strcmp(argv[1], "i2c") && argc == 3) {
int val = atoi(argv[2]);
I2C_SETFREQUENCY(vsn_sif.i2c1, 100000);
- struct st_lis331dl_dev_s * lis = st_lis331dl_init(vsn_sif.i2c1, val);
+ struct lis331dl_dev_s * lis = lis331dl_init(vsn_sif.i2c1, val);
if (lis) {
- const struct st_lis331dl_vector_s * a;
+ const struct lis331dl_vector_s * a;
int i;
uint32_t time_stamp = clock_systimer();
/* Set to 400 Hz : 3 = 133 Hz/axis */
- st_lis331dl_setconversion(lis, false, true);
+ lis331dl_setconversion(lis, false, true);
/* Sample some values */
for (i=0; i<1000; ) {
- if ( (a = st_lis331dl_getreadings(lis)) ) {
+ if ( (a = lis331dl_getreadings(lis)) ) {
i++;
printf("%d %d %d\n", a->x, a->y, a->z);
}
@@ -574,7 +577,7 @@ int sif_main(int argc, char *argv[])
printf("Time diff = %d\n", clock_systimer() - time_stamp);
- st_lis331dl_deinit(lis);
+ lis331dl_deinit(lis);
}
else printf("Exit point: errno=%d\n", errno);