mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-22 23:56:13 +01:00
Added a reset pin option for the OLED driver and cleaned up a bit.
This commit is contained in:
parent
09c2c032cc
commit
c0886ebea3
|
@ -72,9 +72,6 @@ void setup()
|
|||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
|
||||
while(!Serial)
|
||||
delay(100);
|
||||
|
||||
// Responsibility 1: Start the usb connection for diagnostics
|
||||
// This is normally Serial but uses SerialUSB on a SAMD processor
|
||||
SerialManager::init();
|
||||
|
|
|
@ -159,7 +159,14 @@ SSD1306AsciiWire::SSD1306AsciiWire(I2CAddress address, int width, int height) {
|
|||
|
||||
bool SSD1306AsciiWire::begin() {
|
||||
I2CManager.begin();
|
||||
I2CManager.setClock(400000L); // Set max supported I2C speede
|
||||
I2CManager.setClock(400000L); // Set max supported I2C speed
|
||||
|
||||
#if defined(OLED_HAS_RESET_PIN)
|
||||
pinMode(OLED_HAS_RESET_PIN, OUTPUT);
|
||||
digitalWrite(OLED_HAS_RESET_PIN, LOW);
|
||||
delay(1);
|
||||
digitalWrite(OLED_HAS_RESET_PIN, HIGH);
|
||||
#endif
|
||||
|
||||
if (m_i2cAddr == 0) {
|
||||
// Probe for I2C device on 0x3c and 0x3d.
|
||||
|
|
|
@ -76,6 +76,11 @@ Stream * WifiInterface::wifiStream;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(ARDUINO_ARCH_RP2040)
|
||||
#define NUM_SERIAL 2
|
||||
#define SERIAL1 Serial2
|
||||
#endif
|
||||
|
||||
#ifndef NUM_SERIAL
|
||||
#define NUM_SERIAL 1
|
||||
#define SERIAL1 Serial1
|
||||
|
|
|
@ -160,6 +160,9 @@ The configuration file for DCC-EX Command Station
|
|||
// 128x32 or 128x64 I2C SSD1306-based devices are supported.
|
||||
// Use 132,64 for a SH1106-based I2C device with a 128x64 display.
|
||||
// #define OLED_DRIVER 0x3c,128,32
|
||||
// Some OLED displays have an external reset pin that needs to be managed. Set the following
|
||||
// macro to point to that pin.
|
||||
// #define OLED_HAS_RESET_PIN 5
|
||||
|
||||
// Define scroll mode as 0, 1 or 2
|
||||
// * #define SCROLLMODE 0 is scroll continuous (fill screen if poss),
|
||||
|
|
|
@ -208,6 +208,7 @@
|
|||
// Currently only devices which can communicate at 115200 are supported.
|
||||
//
|
||||
#define WIFI_SERIAL_LINK_SPEED 115200
|
||||
#define WIFI_SERIAL_PORT Serial2
|
||||
|
||||
#if __has_include ( "myAutomation.h")
|
||||
#if defined(HAS_ENOUGH_MEMORY) || defined(DISABLE_EEPROM) || defined(DISABLE_PROG)
|
||||
|
|
Loading…
Reference in New Issue
Block a user