Fix nullable

This commit is contained in:
BlubbFish 2019-12-08 11:43:12 +01:00
parent b469c4ed6e
commit 902fdd9b25
6 changed files with 51 additions and 46 deletions

View File

@ -7,7 +7,11 @@ namespace Unosquare.RaspberryIO.Abstractions {
public static class Definitions { public static class Definitions {
private static readonly Int32[] GpioToPhysR1 = { 3, 5, -1, -1, 7, -1, -1, 26, 24, 21, 19, 23, -1, -1, 8, 10, -1, 11, 12, -1, -1, 13, 15, 16, 18, 22, -1, -1, -1, -1, -1, -1 }; private static readonly Int32[] GpioToPhysR1 = { 3, 5, -1, -1, 7, -1, -1, 26, 24, 21, 19, 23, -1, -1, 8, 10, -1, 11, 12, -1, -1, 13, 15, 16, 18, 22, -1, -1, -1, -1, -1, -1 };
private static readonly Int32[] GpioToPhysR2 = { 27, 28, 3, 5, 7, 29, 31, 26, 24, 21, 19, 23, 32, 33, 8, 10, 36, 11, 12, 35, 38, 40, 15, 16, 18, 22, 37, 13, /*P1*/ 3, 4, 5, 6 /*P5*/ }; private static readonly Int32[] GpioToPhysR2 =
{
27, 28, 3, 5, 7, 29, 31, 26, 24, 21, 19, 23, 32, 33, 8, 10, 36, 11, 12, 35, 38, 40, 15, 16, 18, 22, 37, 13, // P1
3, 4, 5, 6, // P5
};
/// <summary> /// <summary>
/// BCMs to physical pin number. /// BCMs to physical pin number.

View File

@ -1,3 +1,5 @@
#nullable enable
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;

View File

@ -16,7 +16,7 @@ namespace Unosquare.RaspberryIO.Abstractions.Native {
/// </summary> /// </summary>
/// <param name="error">The error.</param> /// <param name="error">The error.</param>
/// <returns>The error string.</returns> /// <returns>The error string.</returns>
public static String? Strerror(Int32 error) { public static String Strerror(Int32 error) {
if(Type.GetType("Mono.Runtime") == null) { if(Type.GetType("Mono.Runtime") == null) {
return Marshal.PtrToStringAnsi(StrError(error)); return Marshal.PtrToStringAnsi(StrError(error));
} }

View File

@ -16,7 +16,6 @@ This library enables developers to use the various Raspberry Pi's hardware modul
<PackageLicenseUrl>https://raw.githubusercontent.com/unosquare/raspberryio/master/LICENSE</PackageLicenseUrl> <PackageLicenseUrl>https://raw.githubusercontent.com/unosquare/raspberryio/master/LICENSE</PackageLicenseUrl>
<PackageTags>Raspberry Pi GPIO Camera SPI I2C Embedded IoT Mono C# .NET</PackageTags> <PackageTags>Raspberry Pi GPIO Camera SPI I2C Embedded IoT Mono C# .NET</PackageTags>
<LangVersion>8.0</LangVersion> <LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
</Project> </Project>