From ef18c558f6893b4b86c3803e3cbe1dd69417cb40 Mon Sep 17 00:00:00 2001 From: Jari Suutari Date: Sun, 21 May 2023 12:48:19 +0300 Subject: [PATCH 1/2] Added support for M5Core2 --- samples/Graphics/Primitives/Primitives.nfproj | 81 +++++++++++++++++++ samples/Graphics/Primitives/Program.cs | 7 ++ samples/Graphics/Primitives/packages.config | 27 +++++++ 3 files changed, 115 insertions(+) diff --git a/samples/Graphics/Primitives/Primitives.nfproj b/samples/Graphics/Primitives/Primitives.nfproj index 5c2afc41..df298f2a 100644 --- a/samples/Graphics/Primitives/Primitives.nfproj +++ b/samples/Graphics/Primitives/Primitives.nfproj @@ -65,6 +65,27 @@ + + packages\nanoFramework.Iot.Device.Axp192.1.2.313\lib\Iot.Device.Axp192.dll + + + packages\nanoFramework.Iot.Device.Bmm150.1.2.313\lib\Iot.Device.Bmm150.dll + + + packages\nanoFramework.Iot.Device.Button.1.2.313\lib\Iot.Device.Button.dll + + + packages\nanoFramework.Iot.Device.Common.NumberHelper.1.2.295\lib\Iot.Device.Common.NumberHelper.dll + + + packages\nanoFramework.Iot.Device.Ft6xx6x.1.2.316\lib\Iot.Device.Ft6xx6x.dll + + + packages\nanoFramework.Iot.Device.Mpu6886.1.2.313\lib\Iot.Device.Mpu6886.dll + + + packages\nanoFramework.Iot.Device.Rtc.1.2.313\lib\Iot.Device.Rtc.dll + packages\nanoFramework.CoreLibrary.1.14.2\lib\mscorlib.dll True @@ -80,6 +101,9 @@ packages\nanoFramework.Hardware.Esp32.1.6.3\lib\nanoFramework.Hardware.Esp32.dll + + packages\nanoFramework.M5Core2.1.1.142\lib\nanoFramework.M5Core2.dll + packages\nanoFramework.ResourceManager.1.2.13\lib\nanoFramework.ResourceManager.dll True @@ -96,10 +120,67 @@ packages\nanoFramework.System.Collections.1.5.18\lib\nanoFramework.System.Collections.dll True + + packages\nanoFramework.System.Text.1.2.37\lib\nanoFramework.System.Text.dll + + + packages\nanoFramework.System.Buffers.Binary.BinaryPrimitives.1.2.295\lib\System.Buffers.Binary.BinaryPrimitives.dll + + + packages\nanoFramework.System.Device.Adc.1.1.6\lib\System.Device.Adc.dll + + + packages\nanoFramework.System.Device.Dac.1.5.9\lib\System.Device.Dac.dll + + + packages\nanoFramework.System.Device.Gpio.1.1.28\lib\System.Device.Gpio.dll + + + packages\nanoFramework.System.Device.I2c.1.1.11\lib\System.Device.I2c.dll + + + packages\nanoFramework.System.Device.Model.1.2.295\lib\System.Device.Model.dll + + + packages\nanoFramework.System.Device.Pwm.1.1.6\lib\System.Device.Pwm.dll + + + packages\nanoFramework.System.Device.Spi.1.3.37\lib\System.Device.Spi.dll + + + packages\nanoFramework.System.Diagnostics.Stopwatch.1.2.295\lib\System.Diagnostics.Stopwatch.dll + + + packages\nanoFramework.System.IO.FileSystem.1.1.23\lib\System.IO.FileSystem.dll + + + packages\nanoFramework.System.IO.Ports.1.1.60\lib\System.IO.Ports.dll + + + packages\nanoFramework.System.IO.Streams.1.1.38\lib\System.IO.Streams.dll + packages\nanoFramework.System.Math.1.5.29\lib\System.Math.dll True + + packages\nanoFramework.System.Numerics.1.2.295\lib\System.Numerics.dll + + + packages\nanoFramework.System.Threading.1.1.19\lib\System.Threading.dll + + + packages\UnitsNet.nanoFramework.ElectricCurrent.5.13.0\lib\UnitsNet.ElectricCurrent.dll + + + packages\UnitsNet.nanoFramework.ElectricPotential.5.13.0\lib\UnitsNet.ElectricPotential.dll + + + packages\UnitsNet.nanoFramework.Power.5.13.0\lib\UnitsNet.Power.dll + + + packages\UnitsNet.nanoFramework.Temperature.5.13.0\lib\UnitsNet.Temperature.dll + diff --git a/samples/Graphics/Primitives/Program.cs b/samples/Graphics/Primitives/Program.cs index 5433e013..d50f5d92 100644 --- a/samples/Graphics/Primitives/Program.cs +++ b/samples/Graphics/Primitives/Program.cs @@ -4,6 +4,7 @@ // !!!----------- SAMPLE - ENSURE YOU CHOOSE THE CORRECT TARGET HERE --------------!!! //#define STM32F769I_DISCO // Comment this in if for the target! #define ESP32 // Comment this in if for the target platform! +//#define M5Core2 // Comment this in if for the target platform! // !!!-----------------------------------------------------------------------------!!! using System.Threading; @@ -11,6 +12,10 @@ using nanoFramework.UI; using Primitives.SimplePrimitives; +using nanoFramework.M5Core2; +using nanoFramework.UI; +using Stack = nanoFramework.M5Stack; + namespace Primitives { public class Program @@ -39,6 +44,8 @@ public static void Main() #elif STM32F769I_DISCO // This is an example (working) button map, work the actual pins out for your need! //WARNING: Invalid pin mappings will never be returned, and may need you to reflash the device! DisplayControl.Initialize(new SpiConfiguration(), new ScreenConfiguration()); +#elif M5Core2 + Stack.M5Core2.InitializeScreen(); #else throw new System.Exception("Unknown display mapping!"); #endif diff --git a/samples/Graphics/Primitives/packages.config b/samples/Graphics/Primitives/packages.config index ad883f4f..bcdbd921 100644 --- a/samples/Graphics/Primitives/packages.config +++ b/samples/Graphics/Primitives/packages.config @@ -3,9 +3,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 29d5deb6d0e4e0099f356d6c102a5782fe7aae0b Mon Sep 17 00:00:00 2001 From: Jari Suutari Date: Sun, 21 May 2023 13:11:18 +0300 Subject: [PATCH 2/2] removed redundant usings --- samples/Graphics/Primitives/Program.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/samples/Graphics/Primitives/Program.cs b/samples/Graphics/Primitives/Program.cs index d50f5d92..123b4406 100644 --- a/samples/Graphics/Primitives/Program.cs +++ b/samples/Graphics/Primitives/Program.cs @@ -11,9 +11,6 @@ using nanoFramework.Hardware.Esp32; using nanoFramework.UI; using Primitives.SimplePrimitives; - -using nanoFramework.M5Core2; -using nanoFramework.UI; using Stack = nanoFramework.M5Stack; namespace Primitives