Make the IMU communications more reliable

This hooks up support for the reset line and forces the chip select line
to actually change state.

Change-Id: I41427334789e373728cbb9b4327f17540aadbc33
diff --git a/aos/linux_code/init.cc b/aos/linux_code/init.cc
index 1136d4d..47c7f35 100644
--- a/aos/linux_code/init.cc
+++ b/aos/linux_code/init.cc
@@ -155,7 +155,15 @@
   struct sched_param param;
   param.sched_priority = priority;
   if (sched_setscheduler(0, SCHED_FIFO, &param) == -1) {
-    PLOG(FATAL, "sched_setscheduler(0, SCHED_FIFO, %d) failed", priority);
+    PLOG(FATAL, "sched_setscheduler(0, SCHED_FIFO, %d) failed\n", priority);
+  }
+}
+
+void UnsetCurrentThreadRealtimePriority() {
+  struct sched_param param;
+  param.sched_priority = 0;
+  if (sched_setscheduler(0, SCHED_OTHER, &param) == -1) {
+    PLOG(FATAL, "sched_setscheduler(0, SCHED_OTHER, 0) failed\n");
   }
 }
 
diff --git a/aos/linux_code/init.h b/aos/linux_code/init.h
index e069b83..e34ecfd 100644
--- a/aos/linux_code/init.h
+++ b/aos/linux_code/init.h
@@ -30,6 +30,9 @@
 // Sets the current thread's realtime priority.
 void SetCurrentThreadRealtimePriority(int priority);
 
+// Sets the current thread back down to non-realtime priority.
+void UnsetCurrentThreadRealtimePriority();
+
 // Pins the current thread to CPU #number.
 void PinCurrentThreadToCPU(int number);