1.1 --- a/calibrate.c Mon Oct 14 16:22:35 2013 +0000
1.2 +++ b/calibrate.c Mon Oct 14 16:50:39 2013 +0000
1.3 @@ -18,14 +18,22 @@
1.4 #include "shutdown.h"
1.5 #include "geo.h"
1.6
1.7 +vectorf vmin = {{0, 0, 0}},
1.8 + vmax = {{0, 0, 0}};
1.9 +
1.10 +void calibrate_shutdown(int signum)
1.11 +{
1.12 + printf("\n%-6.1f %-6.1f %-6.1f %-6.1f %-6.1f %-6.1f\n",
1.13 + vmin.x, vmin.y, vmin.z, vmax.x, vmax.y, vmax.z);
1.14 + init_shutdown(signum);
1.15 +}
1.16 +
1.17 /* Main program. */
1.18
1.19 int main(int argc, char *argv[])
1.20 {
1.21 uint8_t result[6];
1.22 vectorf value,
1.23 - vmin = {{1, 1, 1}},
1.24 - vmax = {{-1, -1, -1}},
1.25 valueB[IMU_ACCEL_BUFFER_SIZE];
1.26 int argno = 1, vindex = 0;
1.27 bool gyroscope = false, accelerometer = false, magnetometer = false,
1.28 @@ -64,7 +72,7 @@
1.29 normalised = true;
1.30 }
1.31
1.32 - signal(SIGINT, init_shutdown);
1.33 + signal(SIGINT, calibrate_shutdown);
1.34
1.35 /* Access the 8:10 port. */
1.36