Skip to content

Rename variable names for LED effects customs in the driver #314

@Kanuan

Description

@Kanuan

Apparently this is incorrect for how LED effects work:

1st byte -> Duration
2nd byte -> IntervalDuration
3rd byte -> EnableEffects (0x10 -> ON // 0x00 -> off)
4th byte -> Interval OFF
5th byte -> Interval ON

The correct seems to be:

- 1st byte: Duration
    - 0 = effect is off
    - 0xFE = effect runs for ~5s then LED is turned off
    - 0xFF = effect repeats forever
- 2nd AND 3rd byte: Cycle duration
    - Cycle duration is probably (ClockTicks * tick duration) 
- 4th byte: Off period cycles
- 5th byte: On period cycles

The effect the goes like this:

OffPeriodCycles * CycleDuration + OffPeriodCycles * CycleDuration

Example: by setting everything to the max (0xFF) we have:

  1. LED starts off and stays off for ~16s
    • (OffPeriodCycles * CycleDuration) = (0xFF * 0xFFFF)
  2. LED turns ON for ~16s
    • (OffPeriodCycles * CycleDuration) = (0xFF * 0xFFFF)
  3. Repeat forever

Based on this, at max cycle duration (0xFFFF), the On/Off period durations will be ~1s for 0x10, ~2s to 0x20 and so forth.

Based on this, I recommend renaming dshidmini driver's fields related to led customs to:

1st byte -> Duration
2nd byte -> CycleDuration1
3rd byte -> CycleDuration0
4th byte -> OffPeriodCycles
5th byte -> OnPeriodCycles

Metadata

Metadata

Assignees

Labels

CoreCore/Common Driver TopicenhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions