albsod / pinetime-hypnos

Zephyr firmware for the nRF52832 PineTime smartwatch
Apache License 2.0
72 stars 21 forks source link

Enable logging only when needed #8

Closed endian-albin closed 4 years ago

endian-albin commented 4 years ago

We currently use printk() or printf() for debug output. We should really switch to something like LOG_DBG and LOG_INF though to have better control.

From a power-management standpoint it also makes sense to build different sets of images (debug/production) where JLink logging, etc. are either enabled or disabled. This can be done from cmake I think. From the PineTime wiki:

Do not use logging (JLink RTT, SWO, semihosting,...), it uses a lot of power.
Lukas-Berglund commented 4 years ago

Okay, I can take a closer look at this. I think we can use a script to run Cmake with different parameters depending on if debugging should be enabled or not.

endian-albin commented 4 years ago

I reopened the issue since only the first part has been done.

endian-albin commented 4 years ago

I've now completed the second part.