WS2812 and great rpm improvements

This commit is contained in:
2018-05-26 22:17:12 +02:00
parent d6027e093b
commit d630525841
5 changed files with 134 additions and 29 deletions

View File

@ -66,7 +66,11 @@ int fanMode = FANS_AUTO;
void setBoardOptions(uint8_t options) {
Serial.print("opt: ");
Serial.println(options, BIN);
lightActive = options & 1;
if(lightActive != options & 1) {
lightActive = options & 1;
shouldUpdateLights = true;
}
fanMode = (options >> 2) & 3;
}
@ -276,6 +280,9 @@ void setup() {
sensors.begin();
setupLights();
lightOff();
xTaskCreatePinnedToCore(
measureRpm,
"rpm task",
@ -336,4 +343,5 @@ void loop() {
checkTemperature();
checkVoltage();
if(shouldUpdateLights) updateLights();
}