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, ¶m) == -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, ¶m) == -1) {
+ PLOG(FATAL, "sched_setscheduler(0, SCHED_OTHER, 0) failed\n");
}
}