Skip to content

Commit

Permalink
Update the Arduino Runtime to .NET 8.0
Browse files Browse the repository at this point in the history
Implemented support of static virtual calls (for interfaces with implementations)

Implement RuntimeInformation, fix a bug causing IndexOf and LastIndexOf to fail on char.
Reason was that "ref T" fields where declared as of Object type, while they should be AddressOfVariable instead.

Transmit locals and arguments with their correct size
Don't suppress the last bits, or short and byte will
not behave as expected

Add performance optimization

SetEvent/ResetEvent where incorrectly implemented

WeatherStation sample now also builds and runs
Not sure when all those methods that now
only have dummy implementations are actually required.
And a test on real hardware is still open.

Disable a flaky test
Async methods don't work reliably yet.

Update firmware to prevent a crash in Span<T> ctor
... when T is an array type.
  • Loading branch information
pgrawehr committed Jan 28, 2025
1 parent 60e11cc commit 837de39
Show file tree
Hide file tree
Showing 60 changed files with 1,881 additions and 3,887 deletions.
4 changes: 2 additions & 2 deletions eng/ArduinoCsCI.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ REM Second argument is either "Debug" or "Release"
if %1!==! goto :usage

REM Defines the revision to check out in the ExtendedConfigurableFirmata repo
set FIRMATA_SIMULATOR_CHECKOUT_REVISION=18ef6b3a890b34904904663fb2cece9141600849
set FIRMATA_SIMULATOR_CHECKOUT_REVISION=a354343cebc35964450dfa01dba2cd996065fd5c
set RUN_COMPILER_TESTS=FALSE

choco install -y --no-progress arduino-cli
Expand All @@ -22,7 +22,7 @@ powershell -ExecutionPolicy ByPass -command "%~dp0common\Build.ps1" -restore -bu
set ArduinoRootDir=%1\Documents\Arduino
set acspath=%~dp0\..\artifacts\bin\Frontend\%2\net8.0\acs.exe

git clone https://github.com/firmata/ConfigurableFirmata %ArduinoRootDir%\libraries\ConfigurableFirmata --branch BuildIssueEsp
git clone https://github.com/firmata/ConfigurableFirmata %ArduinoRootDir%\libraries\ConfigurableFirmata
git clone https://github.com/pgrawehr/ExtendedConfigurableFirmata %ArduinoRootDir%\ExtendedConfigurableFirmata
arduino-cli core install esp32:esp32

Expand Down
664 changes: 0 additions & 664 deletions src/Iot.Device.Bindings/CompatibilitySuppressions.xml

Large diffs are not rendered by default.

313 changes: 6 additions & 307 deletions src/System.Device.Gpio/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,316 +2,15 @@
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Alt0</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
<DiagnosticId>PKV006</DiagnosticId>
<Target>.NETStandard,Version=v2.0</Target>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Alt1</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
<DiagnosticId>PKV006</DiagnosticId>
<Target>net6.0</Target>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Alt2</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Alt3</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Alt4</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Alt5</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Input</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Output</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.Unknown</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinEventTypes.Falling</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinEventTypes.None</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinEventTypes.Rising</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinMode.Input</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinMode.InputPullDown</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinMode.InputPullUp</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinMode.Output</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinNumberingScheme.Board</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Gpio.PinNumberingScheme.Logical</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Spi.DataFlow.LsbFirst</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Spi.DataFlow.MsbFirst</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Spi.SpiMode.Mode0</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Spi.SpiMode.Mode1</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Spi.SpiMode.Mode2</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:System.Device.Spi.SpiMode.Mode3</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.Drivers.LibGpiodDriverVersion.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.GpioDriver.Finalize</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.PinEventTypes.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.PinMode.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.PinNumberingScheme.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.PinValue.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.PinValuePair.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Gpio.WaitForEventResult.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Spi.DataFlow.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:System.Device.Spi.SpiMode.#ctor</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:System.Device.Gpio.GpioPin</Target>
<Left>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:System.Device.Gpio.GpioPin</Target>
<Left>lib/net6.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:System.Device.Gpio.GpioPin</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/netstandard2.0/System.Device.Gpio.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Gpio.Drivers.GpiodException</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Gpio.Drivers.LibGpiodDriverVersion</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Gpio.Drivers.RaspberryPi3Driver.AltMode</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Gpio.PinChangeEventHandler</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Gpio.PinEventTypes</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Gpio.PinMode</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Gpio.PinNumberingScheme</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Spi.DataFlow</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:System.Device.Spi.SpiMode</Target>
<Left>lib/netstandard2.0/System.Device.Gpio.dll</Left>
<Right>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP1003</DiagnosticId>
<Target>lib/net6.0-windows10.0.17763/System.Device.Gpio.dll</Target>
<DiagnosticId>PKV006</DiagnosticId>
<Target>net6.0-windows10.0.17763</Target>
</Suppression>
</Suppressions>
Loading

0 comments on commit 837de39

Please sign in to comment.