Skip to content

Commit

Permalink
Merge pull request #512 from WildernessLabs/develop
Browse files Browse the repository at this point in the history
RC2
  • Loading branch information
jorgedevs authored Dec 31, 2022
2 parents 7fa37d1 + 2aa668a commit 1987f4a
Show file tree
Hide file tree
Showing 311 changed files with 1,134 additions and 409 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nuget-level1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

env:
version: '0.90.0'
version: '0.92.5'
token: ${{ secrets.NUGET_TOKEN }}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nuget-level2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

env:
version: '0.90.0'
version: '0.92.5'
token: ${{ secrets.NUGET_TOKEN }}

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public override Task Initialize()
new PwmLed(Device.CreatePwmPort(Device.Pins.D02, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D03, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D04, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D05, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D06, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue), // This pin throws an exception as PWM Port
//new PwmLed(Device.CreatePwmPort(Device.Pins.D05, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
//new PwmLed(Device.CreatePwmPort(Device.Pins.D06, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue), // This pin throws an exception as PWM Port
new PwmLed(Device.CreatePwmPort(Device.Pins.D07, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D08, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D09, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
Expand All @@ -51,8 +51,6 @@ public override async Task Run()
{
Console.WriteLine("TestPwmLeds...");

pwmLeds[0].Brightness = 2;

while (true)
{
Console.WriteLine("Turning on and off each led for 1 second");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,25 @@ public override Task Initialize()
{
Console.WriteLine("Initializing...");

led = new RgbPwmLed(
Device,
Device.Pins.OnboardLedRed,
Device.Pins.OnboardLedGreen,
Device.Pins.OnboardLedBlue);
led.SetColor(Color.Red);

//TestAllResistorTypes();
TestMultiplePorts();

Console.WriteLine("PushButton(s) ready!!!");

led.SetColor(Color.Green);

return Task.CompletedTask;
}

void TestAllResistorTypes()
{
led = new RgbPwmLed(
Device,
Device.Pins.D12,
Device.Pins.D11,
Device.Pins.D10);
led.SetColor(Color.Red);

pushButtons = new List<PushButton>();

var inputInternalPullUp = Device.CreateDigitalInputPort(
Expand Down Expand Up @@ -91,29 +93,34 @@ void TestMultiplePorts()
// Important note: You can only use on Push Button per Group Set (GSXX)
pushButtons = new List<PushButton>
{
new PushButton(Device, Device.Pins.D06), // <- GS00
new PushButton(Device, Device.Pins.A03), // <- GS00
//new PushButton(Device, Device.Pins.A05), // <- GS00

new PushButton(Device, Device.Pins.D09), // <- GS01
new PushButton(Device, Device.Pins.A04), // <- GS01

new PushButton(Device, Device.Pins.D14), // <- GS03
new PushButton(Device, Device.Pins.A02), // <- GS03

new PushButton(Device, Device.Pins.A00), // <- GS04
//new PushButton(Device, Device.Pins.A00), // <- GS04
new PushButton(Device, Device.Pins.D05), // <- GS04

new PushButton(Device, Device.Pins.COPI), // <- GS05
new PushButton(Device, Device.Pins.A01), // <- GS05
//new PushButton(Device, Device.Pins.COPI), // <- GS05

new PushButton(Device, Device.Pins.D02), // <- GS06
new PushButton(Device, Device.Pins.D08), // <- GS06
//new PushButton(Device, Device.Pins.D09), // <- GS06

new PushButton(Device, Device.Pins.D05), // <- GS07
new PushButton(Device, Device.Pins.D07), // <- GS07
//new PushButton(Device, Device.Pins.D10), // <- GS07

new PushButton(Device, Device.Pins.D03), // <- GS08

new PushButton(Device, Device.Pins.D00), // <- GS09
//new PushButton(Device, Device.Pins.D04), // <- GS09

new PushButton(Device, Device.Pins.SCK), // <- GS10
new PushButton(Device, Device.Pins.CIPO), // <- GS11

new PushButton(Device, Device.Pins.CIPO), // <- GS11

new PushButton(Device, Device.Pins.D01), // <- GS13
//new PushButton(Device, Device.Pins.D06), // <- GS13

new PushButton(Device, Device.Pins.D12), // <- GS14

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<PackageReference Include="Meadow.F7" Version="0.*" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
10 changes: 10 additions & 0 deletions Source/Meadow.Foundation.Core/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,16 @@ public override bool Equals(object obj)
return base.Equals(obj);
}

/// <summary>
/// Compare two color structs for equality
/// </summary>
/// <param name="other"></param>
/// <returns>true if equals</returns>
public readonly bool Equals(Color other)
{
return EqualsInner(this, other);
}

static bool EqualsInner(Color color1, Color color2)
{
return color1.R == color2.R && color1.G == color2.G && color1.B == color2.B && color1.A == color2.A;
Expand Down
12 changes: 12 additions & 0 deletions Source/Meadow.Foundation.Core/Displays/IPixelBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,17 @@ public interface IPixelBuffer
/// Clears the buffer (writes 0s to the byte array)
/// </summary>
void Clear();

/// <summary>
/// Clears a region of the buffer (writes 0s to the byte array)
/// </summary>
/// <param name="originX">The X coord to start</param>
/// <param name="originY">The Y coord to start</param>
/// <param name="width">The width of the region to clear</param>
/// <param name="height">The height of the region to clear</param>
void Clear(int originX, int originY, int width, int height)
{
Fill(originX, originY, width, height, Color.Black);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\..\icon.png" Pack="true" PackagePath="" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<PackageReference Include="Meadow.Foundation.DataLoggers.SensorReading" Version="0.*" />
<ProjectReference Include="..\..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
<ProjectReference Include="..\..\DataLoggers.SensorReading\Driver\DataLoggers.SensorReading.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\..\icon.png" Pack="true" PackagePath="" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\..\icon.png" Pack="true" PackagePath="" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
<ProjectReference Include="..\..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
</Project>
Loading

0 comments on commit 1987f4a

Please sign in to comment.