Skip to content

Commit 10946b6

Browse files
committed
Migrate Primites sample to VS2022
1 parent 8777908 commit 10946b6

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

samples/Graphics/Primitives/Primitives.sln

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30011.22
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.4.33213.308
54
MinimumVisualStudioVersion = 10.0.40219.1
65
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "Primitives", "Primitives.nfproj", "{3CB7ECF3-F8C0-4B5C-ACFF-9950F330277C}"
76
EndProject

samples/Graphics/Primitives/Program.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
// !!!----------- SAMPLE - ENSURE YOU CHOOSE THE CORRECT TARGET HERE --------------!!!
5-
#define STM32F769I_DISCO
5+
//#define STM32F769I_DISCO // Comment this in if for the target!
6+
//#define ESP32 // Comment this in if for the target platform!
67
// !!!-----------------------------------------------------------------------------!!!
78

89
using System.Threading;
@@ -22,15 +23,14 @@ public static void Main()
2223
int chipSelect = 14;
2324
int dataCommand = 27;
2425
int reset = 33;
25-
// Add the nanoFramework.Hardware.Esp32 to the solution
26-
Configuration.SetPinFunction(19, DeviceFunction.SPI1_MISO);
27-
Configuration.SetPinFunction(23, DeviceFunction.SPI1_MOSI);
28-
Configuration.SetPinFunction(18, DeviceFunction.SPI1_CLOCK);
26+
2927
// Adjust as well the size of your screen and the position of the screen on the driver
3028
DisplayControl.Initialize(new SpiConfiguration(1, chipSelect, dataCommand, reset, backLightPin), new ScreenConfiguration(0, 0, 320, 240));
29+
3130
// Depending on you ESP32, you may also have to use either PWM either GPIO to set the backlight pin mode on
3231
// new GpioController().OpenPin(backLightPin, PinMode.Output);
3332
// GpioController().Write(backLightPin, PinValue.High);
33+
3434
#elif STM32F769I_DISCO // This is an example (working) button map, work the actual pins out for your need!
3535
//WARNING: Invalid pin mappings will never be returned, and may need you to reflash the device!
3636
DisplayControl.Initialize(new SpiConfiguration(), new ScreenConfiguration());
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="nanoFramework.CoreLibrary" version="1.14.2" targetFramework="netnanoframework10" />
4-
<package id="nanoFramework.Graphics" version="1.1.17" targetFramework="netnanoframework10" />
5-
<package id="nanoFramework.ResourceManager" version="1.2.13" targetFramework="netnanoframework10" />
6-
<package id="nanoFramework.Runtime.Events" version="1.11.6" targetFramework="netnanoframework10" />
7-
<package id="nanoFramework.Runtime.Native" version="1.6.6" targetFramework="netnanoframework10" />
8-
<package id="nanoFramework.System.Collections" version="1.5.18" targetFramework="netnanoframework10" />
3+
<package id="nanoFramework.CoreLibrary" version="1.14.2" targetFramework="netnano1.0" />
4+
<package id="nanoFramework.Graphics" version="1.1.17" targetFramework="netnano1.0" />
5+
<package id="nanoFramework.ResourceManager" version="1.2.13" targetFramework="netnano1.0" />
6+
<package id="nanoFramework.Runtime.Events" version="1.11.6" targetFramework="netnano1.0" />
7+
<package id="nanoFramework.Runtime.Native" version="1.6.6" targetFramework="netnano1.0" />
8+
<package id="nanoFramework.System.Collections" version="1.5.18" targetFramework="netnano1.0" />
99
<package id="nanoFramework.System.Math" version="1.5.29" targetFramework="netnano1.0" />
1010
</packages>

0 commit comments

Comments
 (0)