Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Release v1.0.5 #73

Merged
merged 9 commits into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

| Component | Build Status | NuGet Package |
|:-|---|---|
| Windows.Devices.Gpio | [![Build status](https://ci.appveyor.com/api/projects/status/rx2hrsucsn1p0ohd/branch/master?svg=true)](https://ci.appveyor.com/project/nfbot/lib-windows-devices-gpio/branch/master) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Windows.Devices.Gpio.svg)](https://www.nuget.org/packages/nanoFramework.Windows.Devices.Gpio/) |
| Windows.Devices.Gpio (preview) | [![Build Status](https://dev.azure.com/nanoframework/Windows.Devices.Gpio/_apis/build/status/nanoframework.lib-Windows.Devices.Gpio)](https://dev.azure.com/nanoframework/Windows.Devices.Gpio/_build/latest?definitionId=16) | [![MyGet Pre Release](https://img.shields.io/myget/nanoframework-dev/vpre/nanoFramework.Windows.Devices.Gpio.svg)](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Windows.Devices.Gpio) |
| Windows.Devices.Gpio | [![Build Status](https://dev.azure.com/nanoframework/Windows.Devices.Gpio/_apis/build/status/nanoframework.lib-Windows.Devices.Gpio?branchName=develop)](https://dev.azure.com/nanoframework/Windows.Devices.Gpio/_build/latest?definitionId=16?branchName=master) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Windows.Devices.Gpio.svg)](https://www.nuget.org/packages/nanoFramework.Windows.Devices.Gpio/) |
| Windows.Devices.Gpio (preview) | [![Build Status](https://dev.azure.com/nanoframework/Windows.Devices.Gpio/_apis/build/status/nanoframework.lib-Windows.Devices.Gpio?branchName=develop)](https://dev.azure.com/nanoframework/Windows.Devices.Gpio/_build/latest?definitionId=16?branchName=develop) | [![MyGet Pre Release](https://img.shields.io/myget/nanoframework-dev/vpre/nanoFramework.Windows.Devices.Gpio.svg)](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Windows.Devices.Gpio) |

## Feedback and documentation

Expand Down
7 changes: 6 additions & 1 deletion source/Windows.Devices.Gpio/GpioController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class Gpio​Controller : IGpioController
{
// this is used as the lock object
// a lock is required because multiple threads can access the I2C controller
readonly static object _syncLock = new object();
static object _syncLock;

// we can have only one instance of the GpioController
// need to do a lazy initialization of this field to make sure it exists when called elsewhere.
Expand Down Expand Up @@ -56,6 +56,11 @@ public extern int PinCount
{
if (s_instance == null)
{
if (_syncLock == null)
{
_syncLock = new object();
}

lock (_syncLock)
{
if (s_instance == null)
Expand Down
7 changes: 5 additions & 2 deletions source/Windows.Devices.Gpio/GpioPin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public delegate void GpioPinValueChangedEventHandler(
/// </summary>
public sealed class Gpio​Pin : IGpioPin, IDisposable
{
private static GpioPinEventListener s_eventListener = new GpioPinEventListener();
private static GpioPinEventListener s_eventListener;

// this is used as the lock object
// a lock is required because multiple threads can access the GpioPin
private object _syncLock = new object();
private object _syncLock;

private readonly int _pinNumber;
private GpioPinDriveMode _driveMode = GpioPinDriveMode.Input;
Expand All @@ -40,6 +40,9 @@ public sealed class Gpio​Pin : IGpioPin, IDisposable
internal Gpio​Pin(int pinNumber)
{
_pinNumber = pinNumber;

s_eventListener = new GpioPinEventListener();
_syncLock = new object();
}

internal bool Init()
Expand Down
8 changes: 2 additions & 6 deletions source/Windows.Devices.Gpio/Windows.Devices.Gpio.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@
<ProjectConfigurationsDeclaredAsItems />
</ProjectCapabilities>
</ProjectExtensions>
<Import Project="..\packages\Nerdbank.GitVersioning.3.0.4-beta\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\packages\Nerdbank.GitVersioning.3.0.4-beta\build\Nerdbank.GitVersioning.targets')" />
<Import Project="..\packages\Nerdbank.GitVersioning.3.0.6-beta\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\packages\Nerdbank.GitVersioning.3.0.6-beta\build\Nerdbank.GitVersioning.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Nerdbank.GitVersioning.3.0.4-beta\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Nerdbank.GitVersioning.3.0.4-beta\build\Nerdbank.GitVersioning.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion source/Windows.Devices.Gpio/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<packages>
<package id="nanoFramework.CoreLibrary" version="1.1.1" targetFramework="netnanoframework10" />
<package id="nanoFramework.Runtime.Events" version="1.0.4" targetFramework="netnanoframework10" />
<package id="Nerdbank.GitVersioning" version="3.0.4-beta" developmentDependency="true" targetFramework="netnanoframework10" />
<package id="Nerdbank.GitVersioning" version="3.0.6-beta" developmentDependency="true" targetFramework="netnanoframework10" />
</packages>
13 changes: 7 additions & 6 deletions source/version.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0.4",
"version": "1.0.5",
"assemblyVersion": {
"precision": "revision"
},
"semVer1NumericIdentifierPadding": 3,
"nugetPackageVersion": {
"semVer": 1
},
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"setVersionVariables": true,
"setAllVariables": true
"setAllVariables": true,
"buildNumber": null
},
"release": {
"branchName": "release-v{version}",
"firstUnstableTag": "preview"
}
}