Skip to content

Commit 90d3e4f

Browse files
Fix samples that rely on deprecated namespaces (#209)
1 parent f18145e commit 90d3e4f

File tree

104 files changed

+276
-461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+276
-461
lines changed

samples/ADC/ADC.nfproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
<HintPath>packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll</HintPath>
3030
<Private>True</Private>
3131
</Reference>
32-
<Reference Include="Windows.Devices.Adc, Version=1.5.3.2, Culture=neutral, PublicKeyToken=c07d481e9758c731">
33-
<HintPath>packages\nanoFramework.Windows.Devices.Adc.1.5.3\lib\Windows.Devices.Adc.dll</HintPath>
32+
<Reference Include="System.Device.Adc, Version=1.0.2.4, Culture=neutral, PublicKeyToken=c07d481e9758c731">
33+
<HintPath>packages\nanoFramework.System.Device.Adc.1.0.2\lib\System.Device.Adc.dll</HintPath>
3434
<Private>True</Private>
3535
</Reference>
3636
</ItemGroup>

samples/ADC/Program.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@
66
using System;
77
using System.Diagnostics;
88
using System.Threading;
9-
using Windows.Devices.Adc;
9+
using System.Device.Adc;
1010

1111
namespace TestAdc
1212
{
1313
public class Program
1414
{
1515
public static void Main()
1616
{
17-
string devs = AdcController.GetDeviceSelector();
1817

19-
Debug.WriteLine("devs=" + devs);
20-
21-
AdcController adc1 = AdcController.GetDefault();
18+
AdcController adc1 = new AdcController();
2219

2320
int max1 = adc1.MaxValue;
2421
int min1 = adc1.MinValue;

samples/ADC/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="nanoFramework.CoreLibrary" version="1.12.0" targetFramework="netnanoframework10" />
4-
<package id="nanoFramework.Windows.Devices.Adc" version="1.5.3" targetFramework="netnanoframework10" />
4+
<package id="nanoFramework.System.Device.Adc" version="1.0.2" targetFramework="netnanoframework10" />
55
</packages>

samples/Blinky/Blinky.sln

Lines changed: 2 additions & 3 deletions
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.30503.244
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.1.32414.318
54
MinimumVisualStudioVersion = 10.0.40219.1
65
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "Blinky", "Blinky\Blinky.nfproj", "{29BACBB9-C5B6-4BEF-AEEF-9AFE39B678D9}"
76
EndProject

samples/CAN/Can.TestApp/Can.TestApp.nfproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
<HintPath>..\packages\nanoFramework.Runtime.Events.1.10.0\lib\nanoFramework.Runtime.Events.dll</HintPath>
3838
<Private>True</Private>
3939
</Reference>
40-
<Reference Include="Windows.Devices.Gpio, Version=1.5.5.4, Culture=neutral, PublicKeyToken=c07d481e9758c731">
41-
<HintPath>..\packages\nanoFramework.Windows.Devices.Gpio.1.5.5\lib\Windows.Devices.Gpio.dll</HintPath>
40+
<Reference Include="System.Device.Gpio">
41+
<HintPath>..\packages\nanoFramework.System.Device.Gpio.1.0.1\lib\System.Device.Gpio.dll</HintPath>
4242
<Private>True</Private>
4343
</Reference>
4444
</ItemGroup>

samples/CAN/Can.TestApp/Program.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System;
33
using System.Diagnostics;
44
using System.Threading;
5-
using Windows.Devices.Gpio;
5+
using System.Device.Gpio;
66

77
namespace Can.TestApp
88
{
@@ -15,12 +15,11 @@ public class Program
1515
public static void Main()
1616
{
1717
// PJ5 is LD2 in STM32F769I_DISCO
18-
//_led = GpioController.GetDefault().OpenPin(PinNumber('J', 5));
18+
//_led = new GpioController().OpenPin(PinNumber('J', 5), PinMode.Output);
1919
// PG14 is LEDLD4 in F429I_DISCO
20-
//_led = GpioController.GetDefault().OpenPin(PinNumber('G', 14));
20+
//_led = new GpioController().OpenPin(PinNumber('G', 14), PinMode.Output);
2121
// PD13 is LED3 in DISCOVERY4
22-
_led = GpioController.GetDefault().OpenPin(PinNumber('D', 13));
23-
_led.SetDriveMode(GpioPinDriveMode.Output);
22+
_led = new GpioController().OpenPin(PinNumber('D', 13), PinMode.Output);
2423

2524
// set settings for CAN controller
2625
CanSettings canSettings = new CanSettings(6, 8, 1, 0);
@@ -74,7 +73,7 @@ private static void CanController_DataReceived(object sender, CanMessageReceived
7473
static void BlinkLED()
7574
{
7675
// blink led for each message received
77-
_led.Write(GpioPinValue.High);
76+
_led.Write(PinValue.High);
7877
Thread.Sleep(500);
7978
_led.Toggle();
8079
}

samples/CAN/Can.TestApp/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
<package id="nanoFramework.CoreLibrary" version="1.12.0" targetFramework="netnanoframework10" />
44
<package id="nanoFramework.Devices.Can" version="1.2.4" targetFramework="netnanoframework10" />
55
<package id="nanoFramework.Runtime.Events" version="1.10.0" targetFramework="netnanoframework10" />
6-
<package id="nanoFramework.Windows.Devices.Gpio" version="1.5.5" targetFramework="netnanoframework10" />
6+
<package id="nanoFramework.System.Device.Gpio" version="1.0.1" targetFramework="netnanoframework10" />
77
</packages>

samples/Collections/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This sample is coded to use the STM32F769IDiscovery target board, but can be eas
1111

1212
### Reference
1313

14-
- [Windows.Devices.SerialCommunication](http://docs.nanoframework.net/api/nanoFramework.System.Collection.Hashtable.html)
14+
- [System.Collections.Hastable](http://docs.nanoframework.net/api/nanoFramework.System.Collection.Hashtable.html).
1515

1616
## Build the sample
1717

samples/DebugGC.Test/DebugGC.Test.sln

Lines changed: 2 additions & 3 deletions
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 15
4-
VisualStudioVersion = 15.0.27004.2010
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.1.32414.318
54
MinimumVisualStudioVersion = 10.0.40219.1
65
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "DebugGC.Test", "DebugGC.Test.nfproj", "{AAC17F43-C085-4A4F-B546-14F777549E1B}"
76
EndProject

samples/GCStressTest/GCStressTest.nfproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
<HintPath>packages\nanoFramework.System.Text.1.1.3\lib\nanoFramework.System.Text.dll</HintPath>
3838
<Private>True</Private>
3939
</Reference>
40-
<Reference Include="Windows.Devices.Gpio, Version=1.5.5.4, Culture=neutral, PublicKeyToken=c07d481e9758c731">
41-
<HintPath>packages\nanoFramework.Windows.Devices.Gpio.1.5.5\lib\Windows.Devices.Gpio.dll</HintPath>
40+
<Reference Include="System.Device.Gpio, Version=1.0.4.3, Culture=neutral, PublicKeyToken=c07d481e9758c731">
41+
<HintPath>packages\nanoFramework.System.Device.Gpio.1.0.4\lib\System.Device.Gpio.dll</HintPath>
4242
<Private>True</Private>
4343
</Reference>
4444
</ItemGroup>

0 commit comments

Comments
 (0)