fix: Engine-Grenzen für Segmente und Blink-Anzahl

This commit is contained in:
Michael Sauer
2026-09-11 13:17:21 +02:00
parent 73a7f31cb6
commit 472d2398ac
3 changed files with 18 additions and 0 deletions
+13
View File
@@ -171,6 +171,18 @@ static void test_pulse(void)
TEST_ASSERT_TRUE(nl_engine_idle());
}
static void test_blink_max_clamped(void)
{
nl_engine_blink(200); /* > NL_BLINK_MAX, should clamp to 100 */
TEST_ASSERT_FALSE(nl_engine_idle());
/* After 99 blinks (99*2 phases = 198), should still be blinking */
nl_engine_tick(300 * 99 * 2);
TEST_ASSERT_FALSE(nl_engine_idle());
/* After 2 more phases to complete the last blink (total 100 blinks), should be idle */
nl_engine_tick(300 * 2);
TEST_ASSERT_TRUE(nl_engine_idle());
}
int main(void)
{
UNITY_BEGIN();
@@ -184,5 +196,6 @@ int main(void)
RUN_TEST(test_color_interpolates);
RUN_TEST(test_blink_overrides_and_restores);
RUN_TEST(test_pulse);
RUN_TEST(test_blink_max_clamped);
return UNITY_END();
}