Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions uc_tronics_display/lcd_display/rpiInfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ uint8_t get_cpu_message(void)
int usCpu = 0;
int syCpu = 0;

fp=popen("top -bn1 | grep %Cpu | awk '{printf \"%.2f\", $(2)}'","r"); //Gets the load on the CPU
fp=popen("top -bn1 | grep -m 1 -e CPU | awk '{printf \"%d\", $(2)}'","r"); //Gets the load on the CPU
fgets(usCpuBuff, sizeof(usCpuBuff),fp); //Read the user CPU load
pclose(fp);

fp=popen("top -bn1 | grep %Cpu | awk '{printf \"%.2f\", $(4)}'","r"); //Gets the load on the CPU
fp=popen("top -bn1 | grep -m 1 -e CPU | awk '{printf \"%d\", $(4)}'","r"); //Gets the load on the CPU
fgets(syCpubuff, sizeof(syCpubuff),fp); //Read the system CPU load
pclose(fp);
usCpu = atoi(usCpuBuff);
Expand Down