From a261cdb05bddfce9a921e948eb93f948212df241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=B6nius?= Date: Fri, 19 Jan 2024 07:52:49 +0100 Subject: [PATCH] Bugfix: An array with a length of 1 cannot be accessed at index 1 but only at 0. --- .../ICs.IOExpanders.Pcx857x/Driver/Drivers/Extras/Pcx8574.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Pcx857x/Driver/Drivers/Extras/Pcx8574.cs b/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Pcx857x/Driver/Drivers/Extras/Pcx8574.cs index 480249e8f3..0329dcdf2c 100644 --- a/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Pcx857x/Driver/Drivers/Extras/Pcx8574.cs +++ b/Source/Meadow.Foundation.Peripherals/ICs.IOExpanders.Pcx857x/Driver/Drivers/Extras/Pcx8574.cs @@ -158,7 +158,7 @@ protected byte ReadState8() { Span buffer = stackalloc byte[1]; i2cComms.Read(buffer); - return buffer[1]; + return buffer[0]; } ///