Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Mcp23017 initialization resets pin values

未關閉
#1,663 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
csharp
領域
embedded-iot

研究方向

從 src/devices/Mcp23xxx/Mcp23xxx.cs 第 84 行附近開始,這裡會執行 Mcp23017 的初始化。重現建立轉接器、將一個接腳寫為 high 以及建立第二個轉接器的順序;當接腳在重新初始化後仍保留其值時即完成。

由索引模型根據 Issue 內容生成。

描述

bug Priority:2 up-for-grabs

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

            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.

主要語言
C#
星號
2.4k
分支
631
平均合併
4 天 10 小時
30 天內合併 PR
8

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

dotnet/iot 的其他 Issue

查看 dotnet/iot 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。