Float and better 3rd party library compatibility (#2534)

* define as float (not double)

* Avoid #define of 1 or 2 char symbols

Having this file define 'A' and 'C' pollutes
the global namespace, and causes conflicts
with other libraries that also pollute the
global namespace with short #defines.
It's easier to fix this header.

* unused variable warning
This commit is contained in:
Henry Gabryjelski
2022-02-09 00:46:54 -08:00
committed by GitHub
parent 00b0193a43
commit 38bc618ee5
4 changed files with 29 additions and 26 deletions

View File

@@ -22,12 +22,12 @@
// 10 bits
#ifndef USERMOD_SN_PHOTORESISTOR_ADC_PRECISION
#define USERMOD_SN_PHOTORESISTOR_ADC_PRECISION 1024.0
#define USERMOD_SN_PHOTORESISTOR_ADC_PRECISION 1024.0f
#endif
// resistor size 10K hms
#ifndef USERMOD_SN_PHOTORESISTOR_RESISTOR_VALUE
#define USERMOD_SN_PHOTORESISTOR_RESISTOR_VALUE 10000.0
#define USERMOD_SN_PHOTORESISTOR_RESISTOR_VALUE 10000.0f
#endif
// only report if differance grater than offset value