Skip to content

Commit 0c647eb

Browse files
authored
Fix collection initializers (#276)
***NO_CI***
1 parent a635473 commit 0c647eb

File tree

8 files changed

+10
-12
lines changed

8 files changed

+10
-12
lines changed

nanoFirmwareFlasher.Library/CC13x26x2Operations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync(
127127
if (programResult == ExitCodes.OK && isApplicationBinFile)
128128
{
129129
// now program the application file
130-
programResult = ccDevice.FlashBinFiles(new[] { applicationPath }, new[] { deploymentAddress });
130+
programResult = ccDevice.FlashBinFiles(new List<string> { applicationPath }, new List<string> { deploymentAddress });
131131
}
132132

133133
if (updateFw)

nanoFirmwareFlasher.Library/Esp32Operations.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync(
450450
// check for empty flash partitions
451451
if (firmware.FlashPartitions is null)
452452
{
453-
firmware.FlashPartitions = [];
453+
firmware.FlashPartitions = new Dictionary<int, string>();
454454
}
455455

456456
// add DEPLOYMENT partition with the address provided in the command OR the address from the partition table
@@ -665,7 +665,7 @@ public static async System.Threading.Tasks.Task<ExitCodes> DeployApplicationAsyn
665665
// check for empty flash partitions
666666
if (firmware.FlashPartitions is null)
667667
{
668-
firmware.FlashPartitions = [];
668+
firmware.FlashPartitions = new Dictionary<int, string>();
669669
}
670670

671671
// add DEPLOYMENT partition with the address provided in the command OR the address from the partition table

nanoFirmwareFlasher.Library/JLinkCli.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public ExitCodes ExecuteFlashBinFiles(
179179
}
180180
}
181181

182-
List<string> shadowFiles = [];
182+
List<string> shadowFiles = new List<string>();
183183

184184
ProcessFilePaths(files, shadowFiles);
185185

@@ -335,7 +335,7 @@ public ExitCodes ExecuteFlashHexFiles(
335335
return ExitCodes.E5004;
336336
}
337337

338-
List<string> shadowFiles = [];
338+
List<string> shadowFiles = new List<string>();
339339

340340
ProcessFilePaths(files, shadowFiles);
341341

nanoFirmwareFlasher.Library/JLinkOperations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync(
161161
if (operationResult == ExitCodes.OK && isApplicationBinFile)
162162
{
163163
// now program the application file
164-
operationResult = jlinkDevice.FlashBinFiles(new[] { applicationPath }, new[] { deploymentAddress });
164+
operationResult = jlinkDevice.FlashBinFiles(new List<string> { applicationPath }, new List<string> { deploymentAddress });
165165
}
166166

167167
return operationResult;

nanoFirmwareFlasher.Library/Stm32Operations.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync(
215215
if (operationResult == ExitCodes.OK && isApplicationBinFile)
216216
{
217217
// now program the application file
218-
operationResult = dfuDevice.FlashBinFiles(new[] { applicationPath }, new[] { deploymentAddress });
218+
operationResult = dfuDevice.FlashBinFiles(new List<string> { applicationPath }, new List<string> { deploymentAddress });
219219
}
220220

221221
if (
@@ -282,7 +282,7 @@ public static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync(
282282
if (operationResult == ExitCodes.OK && isApplicationBinFile)
283283
{
284284
// now program the application file
285-
operationResult = jtagDevice.FlashBinFiles(new[] { applicationPath }, new[] { deploymentAddress });
285+
operationResult = jtagDevice.FlashBinFiles(new List<string> { applicationPath }, new List<string> { deploymentAddress });
286286
}
287287

288288
if (

nanoFirmwareFlasher.Library/nanoFirmwareFlasher.Library.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
</PropertyGroup>
2828

2929
<PropertyGroup>
30-
<LangVersion>latest</LangVersion>
3130
<GenerateDocumentationFile>True</GenerateDocumentationFile>
3231
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
3332
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' or '$(ContinuousIntegrationBuild)' == 'True'">true</RestoreLockedMode>

nanoFirmwareFlasher.Tool/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static async Task<int> Main(string[] args)
6767
// because of short-comings in CommandLine parsing
6868
// need to customize the output to provide a consistent output
6969
var parser = new Parser(config => config.HelpWriter = null);
70-
var result = parser.ParseArguments<Options>(new[] { "", "" });
70+
var result = parser.ParseArguments<Options>(new string[] { "", "" });
7171

7272
var helpText = new HelpText(
7373
new HeadingInfo(_headerInfo),
@@ -692,7 +692,7 @@ private static void DisplayNoOperationMessage()
692692
// because of short-comings in CommandLine parsing
693693
// need to customize the output to provide a consistent output
694694
var parser = new Parser(config => config.HelpWriter = null);
695-
var result = parser.ParseArguments<Options>(new[] { "", "" });
695+
var result = parser.ParseArguments<Options>(new string[] { "", "" });
696696

697697
var helpText = new HelpText(
698698
new HeadingInfo(_headerInfo),

nanoFirmwareFlasher.Tool/nanoFirmwareFlasher.Tool.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<PackageIconUrl></PackageIconUrl>
1919
<Description>.NET nanoFirmwareFlasher tool to flash firmware images to target devices.</Description>
2020
<!-- need this to allow async Main() -->
21-
<LangVersion>latest</LangVersion>
2221
<PackAsTool>true</PackAsTool>
2322
<PlatformTarget>AnyCPU</PlatformTarget>
2423
<Platforms>AnyCPU;x64</Platforms>

0 commit comments

Comments
 (0)