Skip to content

OutputShiftRegister changed in behavior #2839

@DocMoebiuz

Description

@DocMoebiuz

Describe the bug
A user reported that outputshiftregister don't turn on LEDs when the value is non-0.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Create an output config with outputshiftregister
  2. Add modifier and set value to static 0,.15
  3. Run
  4. See error

Expected behavior
Output Shift Register should turn high because of using Max Brightness (255)

Actual behavior
Output Shift Register stays at 0.

Details

  • MobiFlight Version: 11.0.0

Additional context

10.5.3 code

case MobiFlightShiftRegister.TYPE:
      if (serial != null)
      {
          string outputValueShiftRegister = value;

          if (outputValueShiftRegister != "0" && !cfg.Pin.DisplayPinPWM)
              outputValueShiftRegister = cfg.Pin.DisplayPinBrightness.ToString();
        
          mobiFlightCache.SetShiftRegisterOutput(
              serial,
              cfg.ShiftRegister.Address,
              cfg.ShiftRegister.Pin,
              outputValueShiftRegister);
      }
      break;

11.0

if (serial != null)
{
    string outputValueShiftRegister = value;
    var shiftRegister = cfg.Device as ShiftRegister;

    if (outputValueShiftRegister != "0" && shiftRegister.PWM)
    {
        outputValueShiftRegister = shiftRegister.Brightness.ToString();
    }

    mobiFlightCache.SetShiftRegisterOutput(
        serial,
        shiftRegister.Address,
        shiftRegister.Pin,
        outputValueShiftRegister);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions