Temperature code updates (#1814)

* Create a typedef for temperatures

* Quick parse replace temp types

* Fixup for fast/slow PWM on PinecilV2

* Update PIDThread.cpp

* Pinecil small tips need less smoothing

* Remove incorrect comment

* Remove unused function

* Update PinecilV2 Tune as well
This commit is contained in:
Ben V. Brown
2023-09-22 10:19:50 +10:00
committed by GitHub
parent f99aed5785
commit c0a5e244b9
19 changed files with 116 additions and 108 deletions

10
source/Core/Inc/Types.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef TYPES_H_
#define TYPES_H_
#include <stddef.h>
// Used for temperature represented in C or x10C.
//
typedef int32_t TemperatureType_t;
#endif

View File

@@ -2,10 +2,11 @@
#define __MAIN_H
#include "OLED.hpp"
#include "Setup.h"
#include "Types.h"
#include <stdint.h>
extern volatile uint32_t currentTempTargetDegC;
extern bool settingsWereReset;
extern bool usb_pd_available;
extern volatile TemperatureType_t currentTempTargetDegC;
extern bool settingsWereReset;
extern bool usb_pd_available;
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -23,7 +23,6 @@ const uint8_t wattHistoryFilter = 24; //
extern expMovingAverage<uint32_t, wattHistoryFilter> x10WattHistory;
uint32_t availableW10(uint8_t sample);
int32_t tempToX10Watts(int32_t rawTemp);
void setTipX10Watts(int32_t mw);
uint8_t X10WattsToPWM(int32_t milliWatts, uint8_t sample = 0);
#endif /* POWER_HPP_ */