File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ bool TwoWire::cfg_pins(int max_index) {
230
230
ioport_peripheral_t ioport_scl;
231
231
232
232
if (IS_SCI (cfg_sda)) {
233
- if (channel >= TWOWIRE_MAX_SCI_CHANNELS) {
233
+ if (channel >= TWOWIRE_MAX_SCI_CHANNELS) { // channels are 0 index based
234
234
return false ;
235
235
}
236
236
is_sci = true ;
@@ -242,7 +242,7 @@ bool TwoWire::cfg_pins(int max_index) {
242
242
243
243
}
244
244
else {
245
- if (channel >= TWOWIRE_MAX_I2C_CHANNELS) {
245
+ if (channel >= TWOWIRE_MAX_I2C_CHANNELS) { // channels are 0 index based
246
246
return false ;
247
247
}
248
248
is_sci = false ;
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ using I2C_onTxCallback_f = void (*)(void);
58
58
59
59
#define I2C_BUFFER_LENGTH 256
60
60
61
- #define TWOWIRE_MAX_I2C_CHANNELS 2
62
- #define TWOWIRE_MAX_SCI_CHANNELS 9
61
+ #define TWOWIRE_MAX_I2C_CHANNELS ( 3 ) // IIC0 to IIC2
62
+ #define TWOWIRE_MAX_SCI_CHANNELS ( 10 ) // SCI0 to SCI9
63
63
64
64
#ifdef __cplusplus
65
65
You can’t perform that action at this time.
0 commit comments