Next try to fix the miss behavior (keeping light on or increasing brightness on ch1).
This commit is contained in:
parent
bdf6765687
commit
cc88a0de0b
5 changed files with 12 additions and 12 deletions
Binary file not shown.
BIN
firmware/20230515_firmware.spiffs.bin
Normal file
BIN
firmware/20230515_firmware.spiffs.bin
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 MiB |
Binary file not shown.
|
@ -64,10 +64,9 @@ void lightEngine()
|
|||
//Serial.println("Reached target bri[" + (String)i + "] = " + (String)bri[i]);
|
||||
}
|
||||
|
||||
uint16_t tmp_pwm = calcPWM(current_bri[i]);
|
||||
current_pwm[i] = tmp_pwm;
|
||||
current_pwm[i] = calcPWM(current_bri[i]);
|
||||
//Serial.println("lon: pin" + (String)i + " = PWM(" + (String)tmp_pwm + ")");
|
||||
analogWrite(pins[i], tmp_pwm);
|
||||
analogWrite(pins[i], current_pwm[i]);
|
||||
}
|
||||
} else { // light state is off
|
||||
|
||||
|
@ -82,10 +81,9 @@ void lightEngine()
|
|||
//Serial.println("Reached target bri[" + (String)i + "] = " + (String)bri[i]);
|
||||
}
|
||||
|
||||
uint16_t tmp_pwm = calcPWM(current_bri[i]);
|
||||
current_pwm[i] = tmp_pwm;
|
||||
current_pwm[i] = calcPWM(current_bri[i]);
|
||||
//Serial.println("loff: pin" + (String)i + " = PWM(" + (String)tmp_pwm + ")");
|
||||
analogWrite(pins[i], tmp_pwm);
|
||||
analogWrite(pins[i], current_pwm[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -184,9 +184,9 @@ void tc_update_main()
|
|||
// disable the lights
|
||||
for (uint8_t i = 0; i < LIGHTS_COUNT; i++)
|
||||
{
|
||||
light_state[i] = false;
|
||||
bri[i] = 0;
|
||||
current_bri[i] = 0;
|
||||
current_pwm[i] = 0;
|
||||
current_bri[i] = 4; // set it to a value which forces the light wngine to switch of the pwm signal pf the gpio
|
||||
transitiontime[i] = default_transitiontime;
|
||||
process_lightdata(i, transitiontime[i]);
|
||||
}
|
||||
|
@ -206,17 +206,19 @@ void tc_update_main()
|
|||
|
||||
if (target_data_block >= NUMBER_OF_TIMER_DATA_BLOCKS)
|
||||
{
|
||||
// we are not between two valid data points, do nothing
|
||||
Serial.println("tdb is >= num data blocks, abort operation...");
|
||||
// we are not between two valid data points
|
||||
// we are at the last element of the data block list
|
||||
Serial.println("tdb is beyond data blocks length, abort operation");
|
||||
|
||||
for (uint8_t i = 0; i < LIGHTS_COUNT; i++)
|
||||
{
|
||||
light_state[i] = false;
|
||||
bri[i] = 0;
|
||||
current_bri[i] = 0;
|
||||
current_pwm[i] = 0;
|
||||
current_bri[i] = 4; // set it to a value which forces the light wngine to switch of the pwm signal pf the gpio
|
||||
transitiontime[i] = default_transitiontime;
|
||||
process_lightdata(i, transitiontime[i]);
|
||||
}
|
||||
|
||||
target_data_block = 255;
|
||||
current_target_data_block = 255;
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue