diff --git a/AtomCommon/AtomBase.cs b/AtomCommon/AtomBase.cs index a193e969..fe855f7b 100644 --- a/AtomCommon/AtomBase.cs +++ b/AtomCommon/AtomBase.cs @@ -43,7 +43,7 @@ public static GpioButton Button { if (_button == null) { - _button = new(39, _gpio, false); + _button = new(39, GpioController, false); } return _button; diff --git a/nanoFramework.Fire/Fire.cs b/nanoFramework.Fire/Fire.cs index 8e67d69a..b956b933 100644 --- a/nanoFramework.Fire/Fire.cs +++ b/nanoFramework.Fire/Fire.cs @@ -53,7 +53,7 @@ public static GpioButton ButtonLeft { if (_left == null) { - _left = new(39, _gpio, false); + _left = new(39, GpioController, false); } return _left; @@ -69,7 +69,7 @@ public static GpioButton ButtonCenter { if (_center == null) { - _center = new(38, _gpio, false); + _center = new(38, GpioController, false); } return _center; @@ -85,7 +85,7 @@ public static GpioButton ButtonRight { if (_right == null) { - _right = new(37, _gpio, false); + _right = new(37, GpioController, false); } return _right; @@ -166,9 +166,7 @@ static Fire() _power.ChargingCutOffCurrent = ChargingCutOffCurrent.C500mA; _power.ChargingCuttOffVoltage = ChargingCutOffVoltage.V4_2; - // Setup buttons - _gpio = new(); - + // Config GPIOs for SPI (screen and SD Card) Configuration.SetPinFunction(23, DeviceFunction.SPI1_MOSI); Configuration.SetPinFunction(19, DeviceFunction.SPI1_MISO); diff --git a/nanoFramework.M5Core/M5Core.cs b/nanoFramework.M5Core/M5Core.cs index 7fdbebc3..4cd3f1e9 100644 --- a/nanoFramework.M5Core/M5Core.cs +++ b/nanoFramework.M5Core/M5Core.cs @@ -34,7 +34,7 @@ public static GpioButton ButtonLeft { if (_left == null) { - _left = new(39, _gpio, false); + _left = new(39, GpioController, false); } return _left; @@ -50,7 +50,7 @@ public static GpioButton ButtonCenter { if (_center == null) { - _center = new(38, _gpio, false); + _center = new(38, GpioController, false); } return _center; @@ -66,7 +66,7 @@ public static GpioButton ButtonRight { if (_right == null) { - _right = new(37, _gpio, false); + _right = new(37, GpioController, false); } return _right; @@ -151,9 +151,7 @@ static M5Core() _power.ChargingCutOffCurrent = ChargingCutOffCurrent.C500mA; _power.ChargingCuttOffVoltage = ChargingCutOffVoltage.V4_2; - // Setup buttons - _gpio = new(); - + // Config GPIOs for SPI (screen and SD Card) Configuration.SetPinFunction(23, DeviceFunction.SPI1_MOSI); Configuration.SetPinFunction(19, DeviceFunction.SPI1_MISO); diff --git a/nanoFramework.M5StickCommon/M5StickCBase.cs b/nanoFramework.M5StickCommon/M5StickCBase.cs index 8b76037f..005b2134 100644 --- a/nanoFramework.M5StickCommon/M5StickCBase.cs +++ b/nanoFramework.M5StickCommon/M5StickCBase.cs @@ -52,7 +52,7 @@ public static GpioButton ButtonM5 { if (_buttonM5 == null) { - _buttonM5 = new(37, _gpio, false); + _buttonM5 = new(37, GpioController, false); } return _buttonM5; @@ -68,7 +68,7 @@ public static GpioButton ButtonRight { if (_buttonRight == null) { - _buttonRight = new(39, _gpio, false); + _buttonRight = new(39, GpioController, false); } return _buttonRight; @@ -84,7 +84,7 @@ public static GpioPin Led { if (_led == null) { - _led = _gpio.OpenPin(10, PinMode.Output); + _led = GpioController.OpenPin(10, PinMode.Output); } return _led;