From 8c70f4412d7e55f22cffa60e0ea953751780f462 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 8 Apr 2013 23:29:24 -0700 Subject: [PATCH 1/2] Fixed axis in L3GD20 driver --- apps/drivers/l3gd20/l3gd20.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/drivers/l3gd20/l3gd20.cpp b/apps/drivers/l3gd20/l3gd20.cpp index 6227df72aa..c7f433dd47 100644 --- a/apps/drivers/l3gd20/l3gd20.cpp +++ b/apps/drivers/l3gd20/l3gd20.cpp @@ -684,9 +684,10 @@ L3GD20::measure() * 74 from all measurements centers them around zero. */ report->timestamp = hrt_absolute_time(); - /* XXX adjust for sensor alignment to board here */ - report->x_raw = raw_report.x; - report->y_raw = raw_report.y; + + /* swap x and y and negate y */ + report->x_raw = raw_report.y; + report->y_raw = ((raw_report.x == -32768) ? 32767 : -raw_report.x); report->z_raw = raw_report.z; report->x = ((report->x_raw * _gyro_range_scale) - _gyro_scale.x_offset) * _gyro_scale.x_scale; From d7178fb8339d94ce119a190a076eb931b8a265e0 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 17 Apr 2013 10:10:08 -0700 Subject: [PATCH 2/2] Play SOS if the SD card can't be mounted --- ROMFS/scripts/rcS | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ROMFS/scripts/rcS b/ROMFS/scripts/rcS index 89a7678797..c0a70f7ddc 100755 --- a/ROMFS/scripts/rcS +++ b/ROMFS/scripts/rcS @@ -21,9 +21,9 @@ set MODE autostart set USB autoconnect # -# Start playing the startup tune + # -tone_alarm start + # # Try to mount the microSD card. @@ -32,8 +32,12 @@ echo "[init] looking for microSD..." if mount -t vfat /dev/mmcsd0 /fs/microsd then echo "[init] card mounted at /fs/microsd" + # Start playing the startup tune + tone_alarm start else echo "[init] no microSD card found" + # Play SOS + tone_alarm 2 fi #