Skip to content

Commit

Permalink
Update to get correct CPU temp
Browse files Browse the repository at this point in the history
Update to get correct CPU temperature reading on Pine64 with sunxi64 based kernel. As it gives temperature multiplied by 1000 and this value is integer instead of float. Just a minor change.
  • Loading branch information
lwqcz authored Feb 17, 2019
1 parent 93e7178 commit 347644a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dietpi/func/dietpi-globals
Original file line number Diff line number Diff line change
Expand Up @@ -1922,11 +1922,11 @@ $print_logfile_info
fi

# - Boards that provide 2 digit output
# Pine
# Pine (when using sunxi64 kernel thermal_zone gives 1000*temp_value)
# NanoPi M2
# H3 3.x
# H2+ 3.x
if (( $G_HW_MODEL == 40 ||
if (( ($G_HW_MODEL == 40 && $(uname -r | awk -F '-' '{ print $2 }') != 'sunxi64') ||
$G_HW_MODEL == 61 ||
( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) ||
( $G_HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then
Expand Down

2 comments on commit 347644a

@WilburWalsh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
this introduces an error, if the Kernel Release does not contain '-' (e.g. 4.14.98+):
/DietPi/dietpi/func/dietpi-globals: line 1924: ((: (1 == 40 && != sunxi64) ||
1 == 61 ||
( 0 == 1 && 0 ) ||
( 1 == 32 && 0 ) : syntax error: operand expected (error token is "!= sunxi64) ||
1 == 61 ||
( 0 == 1 && 0 ) ||
( 1 == 32 && 0 ) ")
Probably better also use grep instead of awk.

@Fourdee
Copy link
Collaborator

@Fourdee Fourdee commented on 347644a Feb 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilburWalsh

Thanks for the heads up 👍

Will send commit to fix. 🈯️ Fourdee@30768a4

Please sign in to comment.