IR: Fix crash on duty_cycle=1 (#3568)

* IR: Fix crash on duty_cycle=1
* Infrared: use float around duty_cycle

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
WillyJL
2024-04-07 14:21:25 +01:00
committed by GitHub
parent 5431257470
commit c31b60c7b7
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -612,7 +612,7 @@ void infrared_worker_set_raw_signal(
furi_check(timings);
furi_check(timings_cnt > 0);
furi_check((frequency <= INFRARED_MAX_FREQUENCY) && (frequency >= INFRARED_MIN_FREQUENCY));
furi_check((duty_cycle < 1.0f) && (duty_cycle > 0.0f));
furi_check((duty_cycle <= 1.0f) && (duty_cycle > 0.0f));
size_t max_copy_num = COUNT_OF(instance->signal.raw.timings) - 1;
furi_check(timings_cnt <= max_copy_num);