Skip to content

Commit 5a5acb5

Browse files
authored
[Adc128D818] Fix channel encoding (#1411)
1 parent 9f6de40 commit 5a5acb5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

devices/Adc128D818/Adc128D818.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,12 @@ private byte GetIndexForChannel(Channel channel)
395395
else if (channel >= Channel.In4 && channel <= Channel.In6 && (_adcMode == Mode.Mode0 || _adcMode == Mode.Mode1))
396396
{
397397
// IN4, IN5, IN6 single-ended readings
398-
return (byte)((byte)channel - 4);
398+
return (byte)channel;
399+
}
400+
else if (channel == Channel.In7 && _adcMode == Mode.Mode1)
401+
{
402+
// IN7 single-ended reading
403+
return (byte)channel;
399404
}
400405
else if (channel == Channel.Temperature && (_adcMode == Mode.Mode0 || _adcMode == Mode.Mode2 || _adcMode == Mode.Mode3))
401406
{

0 commit comments

Comments
 (0)