summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Jacobs <davejacobs@google.com>2019-12-16 18:36:44 -0500
committerDavid Jacobs <davejacobs@google.com>2019-12-17 11:50:53 -0500
commitba4f3429b63d1bcb0cb2c72e10ed465022949cf3 (patch)
tree04b2c82b349ce9ea62d2fb0acb5b48b5c2ec4a56
parenta5bae3891051662ff615dfe076e05df705b39293 (diff)
downloadcontexthub-ba4f3429b63d1bcb0cb2c72e10ed465022949cf3.tar.gz
[ImuCal] Minimal calibration info logging
- With NANO_SENSOR_CAL_DBG_ENABLED not defined, all log messages are disabled except LOGI in nano_calibration.cc. This reduces the ImuCal's nanoapp memory footprint to reach the padding limits while still providing our minimal calibration logging updates useful for device verification. text data bss dec hex 27316 2600 18712 48628 bdf4 MemSize:0x7fe8 Align:0x1000 Padded:0x8000 Padding:88 MemSize:0x4af0 Align:0x1000 Padded:0x5000 Padding:1296 Total Padded MemSize: 0xd000 (53248) --Original--------------------------- MemSize:0x8288 Align:0x1000 Padded:0x9000 Padding:3448 MemSize:0x4af0 Align:0x1000 Padded:0x5000 Padding:1296 Total Padded MemSize: 0xe000 (57344) Bug: 146219309 Test: Built firmware. Change-Id: I476e04be50b8f324cab5fc0ccd72a825db514e42
-rw-r--r--firmware/os/algos/calibration/nano_calibration/nano_calibration.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/os/algos/calibration/nano_calibration/nano_calibration.cc b/firmware/os/algos/calibration/nano_calibration/nano_calibration.cc
index feabbd6a..a8daaeb8 100644
--- a/firmware/os/algos/calibration/nano_calibration/nano_calibration.cc
+++ b/firmware/os/algos/calibration/nano_calibration/nano_calibration.cc
@@ -53,21 +53,24 @@ using ::online_calibration::SensorIndex;
using ::online_calibration::SensorType;
// NanoSensorCal logging macros.
-#ifdef NANO_SENSOR_CAL_DBG_ENABLED
#ifndef LOG_TAG
#define LOG_TAG "[ImuCal]"
#endif
+
+#ifdef NANO_SENSOR_CAL_DBG_ENABLED
#define NANO_CAL_LOGD(tag, format, ...) LOGD("%s " format, tag, ##__VA_ARGS__)
-#define NANO_CAL_LOGI(tag, format, ...) LOGI("%s " format, tag, ##__VA_ARGS__)
#define NANO_CAL_LOGW(tag, format, ...) LOGW("%s " format, tag, ##__VA_ARGS__)
#define NANO_CAL_LOGE(tag, format, ...) LOGE("%s " format, tag, ##__VA_ARGS__)
#else
#define NANO_CAL_LOGD(tag, format, ...) CHRE_LOG_NULL(format, ##__VA_ARGS__)
-#define NANO_CAL_LOGI(tag, format, ...) CHRE_LOG_NULL(format, ##__VA_ARGS__)
#define NANO_CAL_LOGW(tag, format, ...) CHRE_LOG_NULL(format, ##__VA_ARGS__)
#define NANO_CAL_LOGE(tag, format, ...) CHRE_LOG_NULL(format, ##__VA_ARGS__)
#endif // NANO_SENSOR_CAL_DBG_ENABLED
+// NOTE: LOGI is defined to ensure calibration updates are always logged for
+// field diagnosis and verification.
+#define NANO_CAL_LOGI(tag, format, ...) LOGI("%s " format, tag, ##__VA_ARGS__)
+
} // namespace
void NanoSensorCal::Initialize(OnlineCalibrationThreeAxis *accel_cal,