dotnet / dotnet/iot

Mcp23017 initialization resets pin values

Abierto
#1,663 4 comentarios 0 reacciones 0 asignados Ver en GitHub
bug Priority:2 up-for-grabs
Lenguaje dominante
C#
Estrellas
2.4k
Forks
630
Merge medio
11 d 3 h
PR fusionados (30 d)
2

Descripción

**Describe the bug**

Every time a new instance of Mcp23017() is being created the pins are being reset to low. This is an issue when the written software reboots, eg when updating the software version.

**Steps to reproduce**

```csharp
var pinNumber = 0;

var i2cConnectionSettings = new I2cConnectionSettings(1, 0x20);

var i2cDevice = I2cDevice.Create(i2cConnectionSettings);

var device = new Mcp23017(i2cDevice);

var controller = new GpioController(PinNumberingScheme.Logical, Mcp23017Device);

controller.Write(pinNumber, PinValue.High);

var device2 = new Mcp23017(i2cDevice);

var pinValue = controller.Read(pinNumber);
```

**Expected behavior**

Pins need to keep their value after re-initializing the Mcp23017() adapter.

**Actual behavior**

Pins are being reset every time a new instance of Mcp23017() is being declared. Looks like it is embedded in the init code here:
https://github.com/dotnet/iot/blob/main/src/devices/Mcp23xxx/Mcp23xxx.cs - starting at line 84.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.