Skip to content

Commit 07219e2

Browse files
committed
Code style fixes
***NO_CI***
1 parent 602ef30 commit 07219e2

12 files changed

+38
-38
lines changed

nanoFirmwareFlasher/CC13x26x2Device.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public ExitCodes FlashBinFiles(IList<string> files, IList<string> addresses)
133133
// check address(es)
134134

135135
// need to match files count
136-
if(files.Count != addresses.Count)
136+
if (files.Count != addresses.Count)
137137
{
138138
return ExitCodes.E5009;
139139
}
@@ -279,7 +279,7 @@ private static string RunUniflashCli(string arguments)
279279
// collect output messages
280280
return uniflashCli.StandardOutput.ReadToEnd();
281281
}
282-
catch(Exception ex)
282+
catch (Exception ex)
283283
{
284284
throw new UniflashCliExecutionException(ex.Message);
285285
}

nanoFirmwareFlasher/CC13x26x2Firmware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public CC13x26x2Firmware(
1919
string targetName,
2020
string fwVersion,
2121
bool preview)
22-
:base(
22+
: base(
2323
targetName,
2424
fwVersion,
2525
preview)

nanoFirmwareFlasher/CC13x26x2Operations.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ internal static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync
8484

8585
// find Uniflash configuration file
8686
string configFile;
87-
88-
if(targetName.Contains("CC1352R"))
87+
88+
if (targetName.Contains("CC1352R"))
8989
{
9090
configFile = Path.Combine(Program.ExecutingPath, "uniflash", "CC1352R1F3.ccxml");
9191
}
@@ -99,21 +99,21 @@ internal static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync
9999
return ExitCodes.E7000;
100100
}
101101

102-
var ccDevice = new CC13x26x2Device(configFile) {Verbosity = verbosity};
102+
var ccDevice = new CC13x26x2Device(configFile) { Verbosity = verbosity };
103103

104104
// set verbosity
105105

106106
ExitCodes programResult = ExitCodes.OK;
107107
// write HEX files to flash
108-
if ( filesToFlash.Any(f => f.EndsWith(".hex")) )
108+
if (filesToFlash.Any(f => f.EndsWith(".hex")))
109109
{
110110
programResult = ccDevice.FlashHexFiles(filesToFlash);
111111
}
112112

113113
if (programResult == ExitCodes.OK && isApplicationBinFile)
114114
{
115115
// now program the application file
116-
programResult = ccDevice.FlashBinFiles(new [] { applicationPath }, new [] { deploymentAddress });
116+
programResult = ccDevice.FlashBinFiles(new[] { applicationPath }, new[] { deploymentAddress });
117117
}
118118

119119
if (updateFw)

nanoFirmwareFlasher/CloudsmithPackageInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal class CloudsmithPackageInfo
1313
{
1414
[JsonProperty("version")]
1515
public string Version { get; set; }
16-
16+
1717
[JsonProperty("cdn_url")]
1818
public string DownloadUrl { get; set; }
1919

nanoFirmwareFlasher/Esp32DeviceInfo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal class Esp32DeviceInfo
2727
/// ESP32 chip features
2828
/// </summary>
2929
internal string Features { get; }
30-
30+
3131
/// <summary>
3232
/// Crystal fitted in ESP32.
3333
/// </summary>
@@ -76,12 +76,12 @@ internal class Esp32DeviceInfo
7676
/// <param name="flashSize">The size of the flash in bytes</param>
7777
internal Esp32DeviceInfo(
7878
string chipType,
79-
string chipName,
79+
string chipName,
8080
string features,
8181
string crystal,
8282
string macAddress,
83-
byte flashManufacturerId,
84-
short flashDeviceModelId,
83+
byte flashManufacturerId,
84+
short flashDeviceModelId,
8585
int flashSize,
8686
PSRamAvailability psramAvailability)
8787
{
@@ -126,7 +126,7 @@ public override string ToString()
126126
deviceInfo.AppendLine($"Features { Features }");
127127
deviceInfo.AppendLine($"Flash size { GetFlashSizeAsString() } { GetFlashDeviceId() } from { GetFlashManufacturer() } (manufacturer 0x{ FlashManufacturerId } device 0x{ FlashDeviceId })");
128128

129-
switch(PSRamAvailable)
129+
switch (PSRamAvailable)
130130
{
131131
case PSRamAvailability.Undetermined:
132132
deviceInfo.AppendLine($"PSRAM: undetermined");

nanoFirmwareFlasher/Esp32Firmware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public Esp32Firmware(
4242
string fwVersion,
4343
bool stable,
4444
PartitionTableSize? partitionTableSize)
45-
:base(
45+
: base(
4646
targetName,
4747
fwVersion,
4848
stable)
@@ -76,7 +76,7 @@ internal async System.Threading.Tasks.Task<ExitCodes> DownloadAndExtractAsync(in
7676
if (executionResult == ExitCodes.OK)
7777
{
7878
BootloaderPath = "bootloader.bin";
79-
79+
8080
// get ESP32 partitions
8181
FlashPartitions = new Dictionary<int, string>
8282
{

nanoFirmwareFlasher/Esp32Operations.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace nanoFramework.Tools.FirmwareFlasher
1414
internal class Esp32Operations
1515
{
1616
public static ExitCodes BackupFlash(
17-
EspTool tool,
17+
EspTool tool,
1818
Esp32DeviceInfo device,
1919
string backupPath,
2020
string fileName,
@@ -42,7 +42,7 @@ public static ExitCodes BackupFlash(
4242
}
4343

4444
// file name specified
45-
if(string.IsNullOrEmpty(fileName))
45+
if (string.IsNullOrEmpty(fileName))
4646
{
4747
fileName = $"{device.ChipName}_0x{device.MacAddress}_{DateTime.UtcNow.ToShortDateString()}.bin";
4848
}
@@ -62,7 +62,7 @@ public static ExitCodes BackupFlash(
6262
}
6363
}
6464

65-
if(verbosity >= VerbosityLevel.Normal)
65+
if (verbosity >= VerbosityLevel.Normal)
6666
{
6767
Console.ForegroundColor = ConsoleColor.Yellow;
6868
Console.WriteLine($"Backing up the firmware to \r\n{backupFilePath}...");
@@ -81,12 +81,12 @@ public static ExitCodes BackupFlash(
8181
}
8282

8383
internal static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync(
84-
EspTool espTool,
85-
Esp32DeviceInfo esp32Device,
84+
EspTool espTool,
85+
Esp32DeviceInfo esp32Device,
8686
string targetName,
8787
bool updateFw,
88-
string fwVersion,
89-
bool preview,
88+
string fwVersion,
89+
bool preview,
9090
string applicationPath,
9191
string deploymentAddress,
9292
string clrFile,
@@ -197,8 +197,8 @@ internal static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync
197197
}
198198

199199
Esp32Firmware firmware = new Esp32Firmware(
200-
targetName,
201-
fwVersion,
200+
targetName,
201+
fwVersion,
202202
preview,
203203
partitionTableSize)
204204
{
@@ -227,7 +227,7 @@ internal static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync
227227
if (updateFw)
228228
{
229229
operationResult = await firmware.DownloadAndExtractAsync(esp32Device.FlashSize);
230-
230+
231231
if (operationResult != ExitCodes.OK)
232232
{
233233
return operationResult;
@@ -236,7 +236,7 @@ internal static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync
236236
}
237237

238238
// if updating with a CRL file, need to have a new fw package
239-
if(updateCLRfile)
239+
if (updateCLRfile)
240240
{
241241
// remove the CLR file from the image
242242
firmware.FlashPartitions.Remove(Esp32Firmware.CLRAddress);
@@ -307,7 +307,7 @@ internal static async System.Threading.Tasks.Task<ExitCodes> UpdateFirmwareAsync
307307

308308
if (operationResult == ExitCodes.OK)
309309
{
310-
Console.ForegroundColor = ConsoleColor.White;
310+
Console.ForegroundColor = ConsoleColor.White;
311311

312312
if (verbosity >= VerbosityLevel.Normal)
313313
{

nanoFirmwareFlasher/EspTool.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ internal EspTool(
114114
test.Open();
115115
test.Close();
116116
}
117-
catch(Exception ex)
117+
catch (Exception ex)
118118
{
119119
if (Verbosity >= VerbosityLevel.Detailed)
120120
{
121121
Console.ForegroundColor = ConsoleColor.DarkRed;
122-
122+
123123
Console.WriteLine("");
124124
Console.WriteLine("******************** EXCEPTION ******************");
125125
Console.WriteLine($"Exception occurred while trying to open <{serialPort}>:");
@@ -310,7 +310,7 @@ private PSRamAvailability FindPSRamAvailable()
310310
if (WriteFlash(bootloaderPartition, true) == ExitCodes.OK)
311311
{
312312
// check if the
313-
if(_esptoolMessage.Contains("esptool.py can not exit the download mode over USB"))
313+
if (_esptoolMessage.Contains("esptool.py can not exit the download mode over USB"))
314314
{
315315
// this board was put on download mode manually, can't run the test app...
316316

@@ -686,16 +686,16 @@ private bool RunEspTool(
686686
// save output messages
687687
_esptoolMessage = messages;
688688

689-
if(espTool.ExitCode == 0)
689+
if (espTool.ExitCode == 0)
690690
{
691691
// exit code was 0 (success), all good
692692
return true;
693693
}
694694
else
695695
{
696696
// need to look for specific error messages to do a safe guess if execution is as expected
697-
if(messages.Contains("esptool.py can not exit the download mode over USB") ||
698-
messages.Contains("Staying in bootloader.") )
697+
if (messages.Contains("esptool.py can not exit the download mode over USB") ||
698+
messages.Contains("Staying in bootloader."))
699699
{
700700
// we are probably good with this as we can't do much about it...
701701
return true;

nanoFirmwareFlasher/FirmwarePackage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static List<CloudSmithPackageDetail> GetTargetList(
9898
// NOTE: the query seems to be the oposite, it should be LESS THAN.
9999
// this has been reported to Cloudsmith and it's being checked. Maybe need to revisit this if changes are made in their API.
100100
string requestUri = $"{repoName}/?page_size=500&q=uploaded:'>1 month ago' AND tag:{platform}";
101-
101+
102102
List<CloudSmithPackageDetail> targetPackages = new();
103103

104104
if (verbosity > VerbosityLevel.Normal)

nanoFirmwareFlasher/Stm32Firmware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public Stm32Firmware(
2828
string targetName,
2929
string fwVersion,
3030
bool preview)
31-
:base(
31+
: base(
3232
targetName,
3333
fwVersion,
3434
preview)

0 commit comments

Comments
 (0)