Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Config File with JIT on by default to all Project Templates #89

Merged
merged 2 commits into from
Oct 23, 2022
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
7 changes: 6 additions & 1 deletion Meadow.CSharp.Template/Meadow.CSharp.Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
<ItemGroup>
<None Update="meadow.config.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Meadow.CSharp.Template/Meadow.CSharp.Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="meadow.config.yaml" />
<None Include="MeadowApp.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
100 changes: 50 additions & 50 deletions Meadow.CSharp.Template/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,65 @@

namespace $safeprojectname$
{
// Change F7FeatherV2 to F7FeatherV1 for V1.x boards
// Change F7FeatherV2 to F7FeatherV1 for V1.x boards
public class MeadowApp : App<F7FeatherV2>
{
RgbPwmLed onboardLed;
RgbPwmLed onboardLed;

public override Task Run()
{
Console.WriteLine("Run...");
public override Task Run()
{
Console.WriteLine("Run...");

CycleColors(TimeSpan.FromMilliseconds(1000));
return base.Run();
}
CycleColors(TimeSpan.FromMilliseconds(1000));
return base.Run();
}

public override Task Initialize()
{
Console.WriteLine("Initialize...");
public override Task Initialize()
{
Console.WriteLine("Initialize...");

onboardLed = new RgbPwmLed(device: Device,
redPwmPin: Device.Pins.OnboardLedRed,
greenPwmPin: Device.Pins.OnboardLedGreen,
bluePwmPin: Device.Pins.OnboardLedBlue,
CommonType.CommonAnode);
onboardLed = new RgbPwmLed(device: Device,
redPwmPin: Device.Pins.OnboardLedRed,
greenPwmPin: Device.Pins.OnboardLedGreen,
bluePwmPin: Device.Pins.OnboardLedBlue,
CommonType.CommonAnode);

return base.Initialize();
}
return base.Initialize();
}

void CycleColors(TimeSpan duration)
{
Console.WriteLine("Cycle colors...");
void CycleColors(TimeSpan duration)
{
Console.WriteLine("Cycle colors...");

while (true)
{
ShowColorPulse(Color.Blue, duration);
ShowColorPulse(Color.Cyan, duration);
ShowColorPulse(Color.Green, duration);
ShowColorPulse(Color.GreenYellow, duration);
ShowColorPulse(Color.Yellow, duration);
ShowColorPulse(Color.Orange, duration);
ShowColorPulse(Color.OrangeRed, duration);
ShowColorPulse(Color.Red, duration);
ShowColorPulse(Color.MediumVioletRed, duration);
ShowColorPulse(Color.Purple, duration);
ShowColorPulse(Color.Magenta, duration);
ShowColorPulse(Color.Pink, duration);
}
}
while (true)
{
ShowColorPulse(Color.Blue, duration);
ShowColorPulse(Color.Cyan, duration);
ShowColorPulse(Color.Green, duration);
ShowColorPulse(Color.GreenYellow, duration);
ShowColorPulse(Color.Yellow, duration);
ShowColorPulse(Color.Orange, duration);
ShowColorPulse(Color.OrangeRed, duration);
ShowColorPulse(Color.Red, duration);
ShowColorPulse(Color.MediumVioletRed, duration);
ShowColorPulse(Color.Purple, duration);
ShowColorPulse(Color.Magenta, duration);
ShowColorPulse(Color.Pink, duration);
}
}

void ShowColorPulse(Color color, TimeSpan duration)
{
onboardLed.StartPulse(color, duration / 2);
Thread.Sleep(duration);
onboardLed.Stop();
}
void ShowColorPulse(Color color, TimeSpan duration)
{
onboardLed.StartPulse(color, duration / 2);
Thread.Sleep(duration);
onboardLed.Stop();
}

void ShowColor(Color color, TimeSpan duration)
{
onboardLed.SetColor(color);
Thread.Sleep(duration);
onboardLed.Stop();
}
}
void ShowColor(Color color, TimeSpan duration)
{
onboardLed.SetColor(color);
Thread.Sleep(duration);
onboardLed.Stop();
}
}
}
2 changes: 2 additions & 0 deletions Meadow.CSharp.Template/meadow.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MonoControl:
Options: --jit
7 changes: 6 additions & 1 deletion Meadow.FSharp.Template/Meadow.FSharp.Application.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
<ItemGroup>
<None Update="meadow.config.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Meadow.FSharp.Template/Meadow.FSharp.Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<Content Include="meadow_icon.png" />
</ItemGroup>
<ItemGroup>
<None Include="meadow.config.yaml" />
<None Include="Meadow.FSharp.Application.fsproj" />
<None Include="Program.fs" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Meadow.FSharp.Template/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ open Meadow.Foundation
open Meadow.Peripherals.Leds

type MeadowApp() =
// Change F7MicroV2 to F7Micro for V1.x boards
// Change F7FeatherV2 to F7FeatherV1 for V1.x boards
inherit App<F7FeatherV2>()

let mutable led : RgbPwmLed =
Expand Down
2 changes: 2 additions & 0 deletions Meadow.FSharp.Template/meadow.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MonoControl:
Options: --jit
7 changes: 6 additions & 1 deletion Meadow.VBNet.Template/Meadow.VBNet.Application.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation" Version="0.*" />
</ItemGroup>
</Project>
<ItemGroup>
<None Update="meadow.config.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Meadow.VBNet.Template/Meadow.VBNet.Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<Content Include="meadow_icon.png" />
</ItemGroup>
<ItemGroup>
<None Include="meadow.config.yaml" />
<None Include="Meadow.VBNet.Application.vbproj" />
<None Include="MeadowApp.vb" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Meadow.VBNet.Template/MeadowApp.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Imports Meadow.Foundation.Leds
Imports Meadow.Peripherals.Leds

Public Class MeadowApp
'Change F7MicroV2 to F7Micro for V1.x boards'
'Change F7FeatherV2 to F7FeatherV1 for V1.x boards'
Inherits App(Of F7FeatherV2)

Private onboardLed As RgbPwmLed
Expand Down
2 changes: 2 additions & 0 deletions Meadow.VBNet.Template/meadow.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MonoControl:
Options: --jit