Skip to content

Commit

Permalink
Fix: 9 typos (dotnet#2302)
Browse files Browse the repository at this point in the history
Signed-off-by: RoboSchmied <[email protected]>
  • Loading branch information
RoboSchmied authored Apr 4, 2024
1 parent 3d81585 commit 9f6637f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/devices/Lis3Dh/Lis3Dh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void ChangeSettings(DataRate dataRate, OperatingMode operatingMode, Acce
byte lowPowerModeBitAndAxesEnable = (byte)(operatingMode == OperatingMode.LowPowerMode ? 0b1111 : 0b0111);
this[Register.CTRL_REG1] = (byte)(dataRateBits | lowPowerModeBitAndAxesEnable);

// remainder of the bits (block data update/endianess/self-test/SPI 3 or 4-wire setting) set to default
// remainder of the bits (block data update/endianness/self-test/SPI 3 or 4-wire setting) set to default
byte fullScaleBits = (byte)((byte)accelerationScale << 4);
byte highResolutionModeBit = (byte)(operatingMode == OperatingMode.HighResolutionMode ? 0b1000 : 0b0000);
this[Register.CTRL_REG4] = (byte)(fullScaleBits | highResolutionModeBit);
Expand Down
12 changes: 6 additions & 6 deletions src/devices/Nmea0183/Sentences/ProprietaryMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract int Identifier
get;
}

private static UInt32 InverseEndianess(UInt32 value)
private static UInt32 InverseEndianness(UInt32 value)
{
return (value & 0x000000FFU) << 24 | (value & 0x0000FF00U) << 8 |
(value & 0x00FF0000U) >> 8 | (value & 0xFF000000U) >> 24;
Expand All @@ -64,15 +64,15 @@ private static UInt32 InverseEndianess(UInt32 value)
/// <param name="input">Input string</param>
/// <param name="start">Start offset of required number</param>
/// <param name="length">Length of required number. Must be 2, 4 or 8</param>
/// <param name="inverseEndianess">True to inverse the endianess of the number (reverse the partial string)</param>
/// <param name="inverseEndianness">True to inverse the endianness of the number (reverse the partial string)</param>
/// <param name="value">The output value</param>
/// <returns>True on success, false otherwise</returns>
/// <exception cref="ArgumentException">Length is not 2, 4 or 8</exception>
/// <remarks>
/// Other erroneous inputs don't throw an exception but return false, e.g. string shorter than expected or
/// value is not a hex number. This is to prevent an exception in case of a malformed message.
/// </remarks>
protected bool ReadFromHexString(string input, int start, int length, bool inverseEndianess, out int value)
protected bool ReadFromHexString(string input, int start, int length, bool inverseEndianness, out int value)
{
if (length != 2 && length != 4 && length != 8)
{
Expand All @@ -94,11 +94,11 @@ protected bool ReadFromHexString(string input, int start, int length, bool inver
return false;
}

if (length == 8 && inverseEndianess)
if (length == 8 && inverseEndianness)
{
result = InverseEndianess(result);
result = InverseEndianness(result);
}
else if (length == 4 && inverseEndianess)
else if (length == 4 && inverseEndianness)
{
result = result >> 8 | ((result & 0xFF) << 8);
}
Expand Down
2 changes: 1 addition & 1 deletion tools/ArduinoCsCompiler/Runtime/MiniBitConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace ArduinoCsCompiler.Runtime
[ArduinoReplacement(typeof(BitConverter), true)]
internal class MiniBitConverter
{
// This must be set to the endianess of the target platform, but currently all Microcontrollers that are supported seem to use little endian
// This must be set to the endianness of the target platform, but currently all Microcontrollers that are supported seem to use little endian
public static readonly bool IsLittleEndian = true;

[ArduinoImplementation("BitConverterSingleToInt32Bits")]
Expand Down

0 comments on commit 9f6637f

Please sign in to comment.