MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_asymmetric_cycles

Method test_asymmetric_cycles

ci/test_led_timing_conversion.py:323–340  ·  view source on GitHub ↗

Test chipsets where T0H+T0L ≠ T1H+T1L.

(self)

Source from the content-addressed store, hash-verified

321 # (though mathematically valid)
322
323 def test_asymmetric_cycles(self) -> None:
324 """Test chipsets where T0H+T0L ≠ T1H+T1L."""
325 # This happens when duration = max(cycle_0, cycle_1)
326 ds = TimingDatasheet(
327 T0H=250,
328 T0L=500, # cycle_0 = 750
329 T1H=875,
330 T1L=875, # cycle_1 = 1750
331 name="Asymmetric",
332 )
333
334 fl = datasheet_to_phase3(ds)
335
336 # Duration should be max(750, 1750) = 1750
337 self.assertEqual(fl.duration, 1750)
338 self.assertEqual(fl.T1, 250)
339 self.assertEqual(fl.T2, 625)
340 self.assertEqual(fl.T3, 875) # 1750 - 875
341
342 def test_invalid_inverse_conversion(self) -> None:
343 """Test inverse conversion with invalid inputs."""

Callers

nothing calls this directly

Calls 2

TimingDatasheetClass · 0.90
datasheet_to_phase3Function · 0.90

Tested by

no test coverage detected