Compare commits

...

2 commits

Author SHA1 Message Date
Kai Lauterbach
a9e8e2a778 Added main firmware and updated develop firmware bin file. 2023-05-12 12:25:31 +02:00
Kai Lauterbach
7452882ea7 process_lightdata function fixed - division by 0 was possible. 2023-05-12 12:23:45 +02:00
4 changed files with 5 additions and 1 deletions

Binary file not shown.

View file

@ -116,6 +116,10 @@ void apply_scene(uint8_t new_scene, uint8_t light)
void process_lightdata(uint8_t light, float tt)
{
if (tt <= 0)
{
tt = default_transitiontime;
}
if (light_state[light])
{
step_level[light] = (bri[light] - current_bri[light]) / tt;

View file

@ -187,7 +187,7 @@ void tc_update_main()
bri[i] = 0;
current_bri[i] = 0;
current_pwm[i] = 0;
transitiontime[i] = 0;
transitiontime[i] = default_transitiontime;
process_lightdata(i, transitiontime[i]);
}