Removed debugging (FAN_ENABLED)

This commit is contained in:
Ollo 2024-12-07 11:42:04 +01:00
parent da8045e7de
commit 8a8e6f547b

View File

@ -25,7 +25,6 @@
/****************************************************************************** /******************************************************************************
* DEFINES * DEFINES
******************************************************************************/ ******************************************************************************/
#define FAN_ENABLED
#define DELAY_TIME 1000 /**< time between measurements [ms] */ #define DELAY_TIME 1000 /**< time between measurements [ms] */
#define MIN_FAN_SPEED_PERCENT 24 /**< minimum fan speed [%] */ #define MIN_FAN_SPEED_PERCENT 24 /**< minimum fan speed [%] */
@ -57,7 +56,6 @@ static int mAutomaticTargetRPM = RPM_CONTROL_DEACTIVATED;
* LOCAL FUNCTIONS * LOCAL FUNCTIONS
******************************************************************************/ ******************************************************************************/
#ifdef FAN_ENABLED
/** /**
* @brief Get the Fan Speed in round per minutes * @brief Get the Fan Speed in round per minutes
* *
@ -83,9 +81,6 @@ void setFanSpeedPercent(int p) {
int value = (p / 100.0) * 255; int value = (p / 100.0) * 255;
analogWrite(FAN_PIN, value); analogWrite(FAN_PIN, value);
} }
#else
uint8_t mRainbowIndex;
#endif
float readTemperature(void) float readTemperature(void)
{ {
@ -125,14 +120,9 @@ void setup()
SerialCmd_clearCmdArray(); SerialCmd_clearCmdArray();
#ifdef FAN_ENABLED
/* Setup FAN Control */ /* Setup FAN Control */
pinMode(FAN_PIN, OUTPUT); pinMode(FAN_PIN, OUTPUT);
pinMode(SIGNAL_PIN, INPUT); pinMode(SIGNAL_PIN, INPUT);
#else
Serial.println(F("\nFAN NOT enabled"));
mRainbowIndex = 0;
#endif
pixels->begin(); pixels->begin();
pixels->clear(); pixels->clear();
@ -185,7 +175,6 @@ void loop()
fanSpeedPercent = (100 - MIN_FAN_SPEED_PERCENT) * (temp - MIN_TEMP) / (MAX_TEMP - MIN_TEMP) + MIN_FAN_SPEED_PERCENT; fanSpeedPercent = (100 - MIN_FAN_SPEED_PERCENT) * (temp - MIN_TEMP) / (MAX_TEMP - MIN_TEMP) + MIN_FAN_SPEED_PERCENT;
} }
#ifdef FAN_ENABLED
if ((actualFanSpeedRpm >= 0) && (actualFanSpeedRpm < LOW_FAN_SPEED)) if ((actualFanSpeedRpm >= 0) && (actualFanSpeedRpm < LOW_FAN_SPEED))
{ {
if (i > FAN_RPM_READLEVEL) if (i > FAN_RPM_READLEVEL)
@ -231,22 +220,12 @@ void loop()
} }
pixels->show(); pixels->show();
#else
RainbowCycle(pixels, &mRainbowIndex);
Serial.print(mRainbowIndex);
#endif
#ifdef FAN_ENABLED
Serial.print(fanSpeedPercent); Serial.print(fanSpeedPercent);
Serial.print("%;"); Serial.print("%;");
setFanSpeedPercent(fanSpeedPercent); setFanSpeedPercent(fanSpeedPercent);
Serial.print(actualFanSpeedRpm); Serial.print(actualFanSpeedRpm);
Serial.println("RPM"); Serial.println("RPM");
#else
Serial.println("");
#endif
singleLed->fill(Color(0,128,128)); singleLed->fill(Color(0,128,128));
singleLed->setBrightness(fanSpeedPercent); singleLed->setBrightness(fanSpeedPercent);