diff --git a/docs/software/nrf52-TODO.md b/docs/software/nrf52-TODO.md new file mode 100644 index 000000000..2606684c5 --- /dev/null +++ b/docs/software/nrf52-TODO.md @@ -0,0 +1,7 @@ + +* make a new boarddef with a variant.h file. Fix pins in that file. In particular: +#define PIN_SPI_MISO (46) +#define PIN_SPI_MOSI (45) +#define PIN_SPI_SCK (47) +#define PIN_WIRE_SDA (26) +#define PIN_WIRE_SCL (27) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index f9a12181c..12c362b93 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -52,7 +52,7 @@ bool pmu_irq = false; meshtastic::Screen screen(SSD1306_ADDRESS, I2C_SDA, I2C_SCL); #else // Fake values for pins to keep build happy, we won't ever initialize it. -meshtastic::Screen screen(SSD1306_ADDRESS, 0, 0); +meshtastic::Screen screen(SSD1306_ADDRESS); #endif // Global power status singleton @@ -248,8 +248,11 @@ void setup() #ifdef I2C_SDA Wire.begin(I2C_SDA, I2C_SCL); - scanI2Cdevice(); +#else + Wire.begin(); #endif + scanI2Cdevice(); + // Buttons & LED #ifdef BUTTON_PIN diff --git a/src/screen.h b/src/screen.h index 45b6a694a..017e6ae88 100644 --- a/src/screen.h +++ b/src/screen.h @@ -89,7 +89,7 @@ class DebugInfo class Screen : public PeriodicTask { public: - Screen(uint8_t address, uint8_t sda, uint8_t scl); + Screen(uint8_t address, uint8_t sda = 0, uint8_t scl = 0); Screen(const Screen &) = delete; Screen &operator=(const Screen &) = delete;