summaryrefslogtreecommitdiff
path: root/tests/adc-power/adc-power.c
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2018-02-25 22:46:21 +0000
committerKarl Palsson <karlp@tweak.net.au>2018-02-25 22:46:21 +0000
commitda729ec6915c0094f111609d9f9b7e46162b8c13 (patch)
tree43488e4cec0ed4cc148c7227dc0eabc36e04f405 /tests/adc-power/adc-power.c
parent9d0983c38662358d9f509487ea9b85cec8480475 (diff)
downloadolsndot-da729ec6915c0094f111609d9f9b7e46162b8c13.tar.gz
olsndot-da729ec6915c0094f111609d9f9b7e46162b8c13.tar.bz2
olsndot-da729ec6915c0094f111609d9f9b7e46162b8c13.zip
adc-power: add parallel parent makefile
and fix the bugs it shows from me not maintaining this code!
Diffstat (limited to 'tests/adc-power/adc-power.c')
-rw-r--r--tests/adc-power/adc-power.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/adc-power/adc-power.c b/tests/adc-power/adc-power.c
index 0904bb3..bcd9c87 100644
--- a/tests/adc-power/adc-power.c
+++ b/tests/adc-power/adc-power.c
@@ -147,6 +147,7 @@ static float adc_calc_tempf(unsigned int ts_v, unsigned int vref) {
float slope = (110-30) * 1.0f / (ST_TSENSE_CAL2_110C - ST_TSENSE_CAL1_30C) * 1.0f;
return slope * (adjusted_vtemp - ST_TSENSE_CAL1_30C) + 30;
#else
+ (void)vref;
return ts_v * 1.0;
#endif
}
@@ -157,6 +158,7 @@ static int adc_calc_tempi(unsigned int ts, unsigned int vref) {
int slope = (110-30) / (ST_TSENSE_CAL2_110C - ST_TSENSE_CAL1_30C);
return slope * (adjusted_vtemp - ST_TSENSE_CAL1_30C) + 30;
#else
+ (void)vref;
return ts * 1.00;
#endif
}