Hello,
I'm a beginner using the nRF52840 DK, sdk v16.0, and Keil on Windows. I'm currently working on the provided pwr_mgmt example. My first goal was to display the CPU Usage percentage as a float number, which I accomplished by editing the nrf_pwr_mgmt.c file (inside the pwr_mgmt_cpu_usage_monitor_update function), such that:
I was wondering if this was an accurate way of doing so?
Additionally, I edited the main.c file , such that I included my own function to test the CPU Usage:
I call this inside the main() function and receive ~12.335% CPU Usage. For simple addition, I expected the CPU usage to be somewhat lower for the chip...so, I'm wondering if this is accurate or if I'm potentially missing something in my thinking?
In summary:
1.) What's the best way to display the CPU usage as a percentage with 3 decimal places?
2.) Why am I seeing ~12% usage for addition arithmetic?
Thanks.