1
0
forked from me/IronOS

Pinecil uart (#830)

* Creating uart debug handler

* Simpler get raw uV tip

* Update Setup.cpp

* Debug out working. Moved Logo

Need to update docs around logos before merging this in

* Add in current pwm level + fix signed int

* Update moving logo page for pinecil by 64k

* Update TipThermoModel.h
This commit is contained in:
Ben V. Brown
2021-02-02 19:53:19 +11:00
committed by GitHub
parent 15e51f9faa
commit 1f6a3ad167
17 changed files with 136 additions and 17 deletions

View File

@@ -28,7 +28,7 @@
* This was bought to my attention by <Kuba Sztandera>
*/
uint32_t TipThermoModel::convertTipRawADCTouV(uint16_t rawADC) {
uint32_t TipThermoModel::convertTipRawADCTouV(uint16_t rawADC, bool skipCalOffset) {
// This takes the raw ADC samples, converts these to uV
// Then divides this down by the gain to convert to the uV on the input to the op-amp (A+B terminals)
// Then remove the calibration value that is stored as a tip offset
@@ -41,9 +41,9 @@ uint32_t TipThermoModel::convertTipRawADCTouV(uint16_t rawADC) {
// Now to divide this down by the gain
valueuV /= OP_AMP_GAIN_STAGE;
if (systemSettings.CalibrationOffset) {
if (systemSettings.CalibrationOffset && skipCalOffset == false) {
// Remove uV tipOffset
if (valueuV >= systemSettings.CalibrationOffset)
if (valueuV > systemSettings.CalibrationOffset)
valueuV -= systemSettings.CalibrationOffset;
else
valueuV = 0;

View File

@@ -21,7 +21,7 @@ public:
static uint32_t convertTipRawADCToDegC(uint16_t rawADC);
static uint32_t convertTipRawADCToDegF(uint16_t rawADC);
// Returns the uV of the tip reading before the op-amp compensating for pullups
static uint32_t convertTipRawADCTouV(uint16_t rawADC);
static uint32_t convertTipRawADCTouV(uint16_t rawADC,bool skipCalOffset=false);
static uint32_t convertCtoF(uint32_t degC);
static uint32_t convertFtoC(uint32_t degF);