未验证 提交 e84b2bd3 编写于 作者: H HumphreyJ 提交者: GitHub

Remove ILI9341 SPI buffer range limit (#1802)

上级 737bc93e
......@@ -53,9 +53,9 @@ namespace Iot.Device.Ili9341
/// <param name="shouldDispose">True to dispose the Gpio Controller</param>
public Ili9341(SpiDevice spiDevice, int dataCommandPin, int resetPin, int backlightPin = -1, int spiBufferSize = DefaultSPIBufferSize, GpioController? gpioController = null, bool shouldDispose = true)
{
if (!InRange((uint)spiBufferSize, 0x1000, 0x10000))
if (spiBufferSize <= 0)
{
throw new ArgumentException(nameof(spiBufferSize), "Value must be between 4096 and 65536.");
throw new ArgumentException(nameof(spiBufferSize), "Buffer size must be larger than 0.");
}
_spiDevice = spiDevice;
......@@ -230,18 +230,6 @@ namespace Iot.Device.Ili9341
SendCommand(Ili9341Command.MemoryWrite);
}
/// <summary>
/// Verifies value is within a specific range.
/// </summary>
/// <param name="value">Value to check.</param>
/// <param name="start">Starting value of range.</param>
/// <param name="end">Ending value of range.</param>
/// <returns>Determines if value is within range.</returns>
internal static bool InRange(uint value, uint start, uint end)
{
return value >= start && value <= end;
}
/// <summary>
/// Send a command to the the display controller along with associated parameters.
/// </summary>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册