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

Commit

Permalink
Pi.Info fix
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos.solorzano authored and geoperez committed Sep 26, 2019
1 parent bfc3870 commit 627bea7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Unosquare.RaspberryIO/Pi.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Unosquare.RaspberryIO
namespace Unosquare.RaspberryIO
{
using Abstractions;
using Camera;
Expand All @@ -16,6 +16,7 @@ public static class Pi
private const string MissingDependenciesMessage = "You need to load a valid assembly (WiringPi or PiGPIO).";
private static readonly object SyncLock = new object();
private static bool _isInit;
private static SystemInfo _info;

/// <summary>
/// Initializes static members of the <see cref="Pi" /> class.
Expand All @@ -24,7 +25,6 @@ static Pi()
{
lock (SyncLock)
{
Info = SystemInfo.Instance;
Camera = CameraController.Instance;
PiDisplay = DsiDisplay.Instance;
Audio = AudioSettings.Instance;
Expand All @@ -35,7 +35,16 @@ static Pi()
/// <summary>
/// Provides information on this Raspberry Pi's CPU and form factor.
/// </summary>
public static SystemInfo Info { get; }
public static SystemInfo Info
{
get
{
if (_info == null)
_info = SystemInfo.Instance;

return _info;
}
}

/// <summary>
/// Provides access to the Raspberry Pi's GPIO as a collection of GPIO Pins.
Expand Down

0 comments on commit 627bea7

Please sign in to comment.