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

Function handle_fastled

ci/tools/led_timing_conversions.py:587–608  ·  view source on GitHub ↗

Handle 3-phase to datasheet conversion. Args: T1: High time for '0' bit (nanoseconds) T2: Additional high time for '1' bit (nanoseconds) T3: Low tail duration (nanoseconds) verbose: Whether to show verbose output

(T1: int, T2: int, T3: int, verbose: bool)

Source from the content-addressed store, hash-verified

585
586
587def handle_fastled(T1: int, T2: int, T3: int, verbose: bool) -> None:
588 """Handle 3-phase to datasheet conversion.
589
590 Args:
591 T1: High time for '0' bit (nanoseconds)
592 T2: Additional high time for '1' bit (nanoseconds)
593 T3: Low tail duration (nanoseconds)
594 verbose: Whether to show verbose output
595 """
596 fl = Timing3Phase(T1, T2, T3)
597 ds = phase3_to_datasheet(fl)
598
599 if ds is None:
600 print("ERROR: Invalid timing (negative values in datasheet format)")
601 sys.exit(1)
602 assert ds is not None
603
604 if verbose:
605 print(f"3-Phase Format: {fl}")
606 print(f"Datasheet Format: {ds}")
607 else:
608 print(f"T0H={ds.T0H} T0L={ds.T0L} T1H={ds.T1H} T1L={ds.T1L}")
609
610
611@dataclass

Callers 1

mainFunction · 0.85

Calls 3

Timing3PhaseClass · 0.85
phase3_to_datasheetFunction · 0.85
printFunction · 0.50

Tested by

no test coverage detected