объявляются два экземпляра wire по номеру железного I2C, по дефолту используется тот, что задан для каждой платы

This commit is contained in:
klassents committed 2025-05-26 13:07:21 +07:00
1 parent 54ec7ed9fe
commit 37b2788851
6 files changed
+19 -11

No files matched your search

+5 -3
View File
@@ -295,7 +295,9 @@ extern "C" void __attribute__((optimize("O3"))) wire_interrupt_handler(uint8_t n
}
// ----------------------------- Preinstantiate Objects ----------------------------- //
TwoWire Wire = TwoWire(1);
#if I2C_COMMON_QTY>1
TwoWire Wire1 = TwoWire(0);
TwoWire Wire1 = TwoWire(1); // I2C1 is always available
#if I2C_COMMON_QTY > 1
TwoWire Wire0 = TwoWire(0); // I2C0 is available on some boards
#endif
// default interface
TwoWire& Wire = DEFAULT_WIRE;
+4 -2
View File
@@ -90,9 +90,11 @@ class TwoWire : public Stream
void onRequest( void (*)(void) );
};
extern TwoWire Wire;
#if I2C_COMMON_QTY>1
extern TwoWire Wire1;
#if I2C_COMMON_QTY>1
extern TwoWire Wire0;
#endif
// default interface
extern TwoWire& Wire;
#endif