[all internal apps] add APP_VERSION

Change-Id: I0a3dfecc123551d6d9bc7ef036fe26a4ed4edc16
diff --git a/firmware/src/drivers/ams_tmd2772/ams_tmd2772.c b/firmware/src/drivers/ams_tmd2772/ams_tmd2772.c
index 5bcddcf..f37ff59 100644
--- a/firmware/src/drivers/ams_tmd2772/ams_tmd2772.c
+++ b/firmware/src/drivers/ams_tmd2772/ams_tmd2772.c
@@ -27,6 +27,8 @@
 #include <nanohubPacket.h>
 #include <eventnums.h>
 
+#define  TMD2772_APP_VERSION 1
+
 #define DRIVER_NAME                            "AMS: "
 
 #define I2C_BUS_ID                             0
@@ -608,8 +610,6 @@
 
 static bool init_app(uint32_t myTid)
 {
-    osLog(LOG_INFO, DRIVER_NAME "task starting\n");
-
     /* Set up driver private data */
     mData.tid = myTid;
     mData.alsOn = false;
@@ -673,4 +673,4 @@
     }
 }
 
-INTERNAL_APP_INIT(APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, 9), 0, init_app, end_app, handle_event);
+INTERNAL_APP_INIT(APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, 9), TMD2772_APP_VERSION, init_app, end_app, handle_event);
diff --git a/firmware/src/drivers/ams_tmd4903/ams_tmd4903.c b/firmware/src/drivers/ams_tmd4903/ams_tmd4903.c
index 32d7545..06f5d43 100644
--- a/firmware/src/drivers/ams_tmd4903/ams_tmd4903.c
+++ b/firmware/src/drivers/ams_tmd4903/ams_tmd4903.c
@@ -830,8 +830,6 @@
 
 static bool init_app(uint32_t myTid)
 {
-    INFO_PRINT("task starting\n");
-
     /* Set up driver private data */
     mTask.tid = myTid;
     mTask.alsOn = false;
@@ -906,4 +904,3 @@
 }
 
 INTERNAL_APP_INIT(AMS_TMD4903_APP_ID, AMS_TMD4903_APP_VERSION, init_app, end_app, handle_event);
-
diff --git a/firmware/src/drivers/bosch_bmi160/bosch_bmi160.c b/firmware/src/drivers/bosch_bmi160/bosch_bmi160.c
index 71687e9..cb674e2 100644
--- a/firmware/src/drivers/bosch_bmi160/bosch_bmi160.c
+++ b/firmware/src/drivers/bosch_bmi160/bosch_bmi160.c
@@ -71,6 +71,8 @@
 #define DBG_WM_CALC               0
 #define TIMESTAMP_DBG             0
 
+#define BMI160_APP_VERSION 1
+
 // fixme: to list required definitions for a slave mag
 #ifdef USE_BMM150
 #include "bosch_bmm150_slave.h"
@@ -2950,8 +2952,6 @@
 static bool startTask(uint32_t task_id)
 {
     TDECL();
-    DEBUG_PRINT("        IMU:  %ld\n", task_id);
-
     enum SensorIndex i;
     size_t slabSize;
 
@@ -3315,6 +3315,4 @@
     return watermark;
 }
 
-INTERNAL_APP_INIT(BMI160_APP_ID, 0, startTask, endTask, handleEvent);
-
-
+INTERNAL_APP_INIT(BMI160_APP_ID, BMI160_APP_VERSION, startTask, endTask, handleEvent);
diff --git a/firmware/src/drivers/bosch_bmp280/bosch_bmp280.c b/firmware/src/drivers/bosch_bmp280/bosch_bmp280.c
index 20a8913..4dd623d 100644
--- a/firmware/src/drivers/bosch_bmp280/bosch_bmp280.c
+++ b/firmware/src/drivers/bosch_bmp280/bosch_bmp280.c
@@ -29,6 +29,8 @@
 
 #define BMP280_APP_ID APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, 5)
 
+#define BMP280_APP_VERSION 1
+
 #define I2C_BUS_ID                      0
 #define I2C_SPEED                       400000
 #define I2C_ADDR                        0x76
@@ -449,7 +451,6 @@
         case STATE_FINISH_INIT: {
             sensorRegisterInitComplete(mTask.baroHandle);
             sensorRegisterInitComplete(mTask.tempHandle);
-            osLog(LOG_INFO, "BMP280: idle\n");
             break;
         }
 
@@ -547,8 +548,6 @@
 
 static bool startTask(uint32_t taskId)
 {
-    osLog(LOG_INFO, "BMP280: task starting\n");
-
     mTask.id = taskId;
     mTask.offset = 0.0f;
 
@@ -566,4 +565,4 @@
 
 }
 
-INTERNAL_APP_INIT(BMP280_APP_ID, 0, startTask, endTask, handleEvent);
+INTERNAL_APP_INIT(BMP280_APP_ID, BMP280_APP_VERSION, startTask, endTask, handleEvent);
diff --git a/firmware/src/drivers/hall/hall.c b/firmware/src/drivers/hall/hall.c
index 030aa8a..01e8c8a 100644
--- a/firmware/src/drivers/hall/hall.c
+++ b/firmware/src/drivers/hall/hall.c
@@ -206,8 +206,6 @@
 
 static bool startTask(uint32_t taskId)
 {
-    osLog(LOG_INFO, "HALL: task starting\n");
-
     mTask.id = taskId;
     mTask.sensorHandle = sensorRegister(&mSensorInfo, &mSensorOps, NULL, true);
     mTask.prevReportedValue = -1;
diff --git a/firmware/src/drivers/hall_twopole/hall_twopole.c b/firmware/src/drivers/hall_twopole/hall_twopole.c
index 4d69d54..11c77e5 100644
--- a/firmware/src/drivers/hall_twopole/hall_twopole.c
+++ b/firmware/src/drivers/hall_twopole/hall_twopole.c
@@ -222,8 +222,6 @@
 
 static bool startTask(uint32_t taskId)
 {
-    osLog(LOG_INFO, "HALL: task starting\n");
-
     mTask.id = taskId;
     mTask.sensorHandle = sensorRegister(&mSensorInfo, &mSensorOps, NULL, true);
     mTask.prevReportedState = -1;
diff --git a/firmware/src/drivers/orientation/orientation.c b/firmware/src/drivers/orientation/orientation.c
index 00c2c5a..7bb06ef 100644
--- a/firmware/src/drivers/orientation/orientation.c
+++ b/firmware/src/drivers/orientation/orientation.c
@@ -32,6 +32,8 @@
 #include <limits.h>
 #include <slab.h>
 
+#define ORIENTATION_APP_VERSION 1
+
 #define MAX_NUM_COMMS_EVENT_SAMPLES 15 // at most 15 samples can fit in one comms_event
 #define NUM_COMMS_EVENTS_IN_FIFO    2  // This controls how often the hub needs to wake up
                                        // in batching
@@ -776,7 +778,6 @@
 
 static bool fusionStart(uint32_t tid)
 {
-    osLog(LOG_INFO, "        ORIENTATION:  %ld\n", tid);
     size_t i, slabSize;
 
     mTask.tid = tid;
@@ -827,8 +828,7 @@
 
 INTERNAL_APP_INIT(
         APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, 4),
-        0,
+        ORIENTATION_APP_VERSION,
         fusionStart,
         fusionEnd,
         fusionHandleEvent);
-
diff --git a/firmware/src/drivers/rohm_rpr0521/rohm_rpr0521.c b/firmware/src/drivers/rohm_rpr0521/rohm_rpr0521.c
index 97821a8..335ce9a 100644
--- a/firmware/src/drivers/rohm_rpr0521/rohm_rpr0521.c
+++ b/firmware/src/drivers/rohm_rpr0521/rohm_rpr0521.c
@@ -43,6 +43,8 @@
 #error "PROX_IRQ is not defined; please define in variant.h"
 #endif
 
+#define RPR0521_APP_VERSION 1
+
 #define I2C_BUS_ID                              0
 #define I2C_SPEED                               400000
 #define I2C_ADDR                                0x38
@@ -637,8 +639,6 @@
 
 static bool init_app(uint32_t myTid)
 {
-    INFO_PRINT("task starting\n");
-
     /* Set up driver private data */
     mTask.tid = myTid;
     mTask.alsOn = false;
@@ -703,5 +703,4 @@
     }
 }
 
-INTERNAL_APP_INIT(APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, 10), 0, init_app, end_app, handle_event);
-
+INTERNAL_APP_INIT(APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, 10), RPR0521_APP_VERSION, init_app, end_app, handle_event);
diff --git a/firmware/src/drivers/tilt_detection/tilt_detection.c b/firmware/src/drivers/tilt_detection/tilt_detection.c
index 85d8279..c21d5b0 100644
--- a/firmware/src/drivers/tilt_detection/tilt_detection.c
+++ b/firmware/src/drivers/tilt_detection/tilt_detection.c
@@ -29,6 +29,8 @@
 #include <sensors.h>
 #include <limits.h>
 
+#define TILT_APP_VERSION 1
+
 #define EVT_SENSOR_ANY_MOTION sensorGetMyEventType(SENS_TYPE_ANY_MOTION)
 #define EVT_SENSOR_NO_MOTION sensorGetMyEventType(SENS_TYPE_NO_MOTION)
 #define EVT_SENSOR_ACCEL sensorGetMyEventType(SENS_TYPE_ACCEL)
@@ -227,7 +229,6 @@
 
     switch (evtType) {
     case EVT_APP_START:
-        osLog(LOG_INFO, "[Tilt] idle\n");
         osEventUnsubscribe(mTask.taskId, EVT_APP_START);
         sensorFind(SENS_TYPE_ANY_MOTION, 0, &mTask.anyMotionHandle);
         sensorFind(SENS_TYPE_NO_MOTION, 0, &mTask.noMotionHandle);
@@ -289,8 +290,7 @@
 
 INTERNAL_APP_INIT(
         APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, 8),
-        0,
+        TILT_APP_VERSION,
         tiltDetectionStart,
         tiltDetectionEnd,
         tiltDetectionHandleEvent);
-
diff --git a/firmware/src/drivers/vsync/vsync.c b/firmware/src/drivers/vsync/vsync.c
index de5663d..e423494 100644
--- a/firmware/src/drivers/vsync/vsync.c
+++ b/firmware/src/drivers/vsync/vsync.c
@@ -157,8 +157,6 @@
 
 static bool startTask(uint32_t taskId)
 {
-    INFO_PRINT("task starting\n");
-
     mTask.id = taskId;
     mTask.sensorHandle = sensorRegister(&mSensorInfo, &mSensorOps, NULL, true);
     mTask.pin = gpioRequest(VSYNC_PIN);
diff --git a/firmware/src/drivers/window_orientation/window_orientation.c b/firmware/src/drivers/window_orientation/window_orientation.c
index 6232adb..e5cab76 100644
--- a/firmware/src/drivers/window_orientation/window_orientation.c
+++ b/firmware/src/drivers/window_orientation/window_orientation.c
@@ -30,6 +30,8 @@
 #include <sensors.h>
 #include <limits.h>
 
+#define WINDOW_ORIENTATION_APP_VERSION  1
+
 #define ACCEL_MIN_RATE_HZ                  SENSOR_HZ(15) // 15 HZ
 #define ACCEL_MAX_LATENCY_NS               40000000ull   // 40 ms in nsec
 
@@ -574,8 +576,6 @@
 
 static bool window_orientation_start(uint32_t tid)
 {
-    osLog(LOG_INFO, "        WINDOW ORIENTATION:  %ld\n", tid);
-
     mTask.tid = tid;
 
     mTask.current_rotation = -1;
@@ -593,8 +593,7 @@
 
 INTERNAL_APP_INIT(
         APP_ID_MAKE(APP_ID_VENDOR_GOOGLE, 3),
-        0,
+        WINDOW_ORIENTATION_APP_VERSION,
         window_orientation_start,
         windowOrientationEnd,
         windowOrientationHandleEvent);
-