serial pins experiment

This commit is contained in:
folkert van heusden 2024-05-08 19:59:34 +02:00
parent 98dcea11cd
commit 72e2635220
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1
3 changed files with 8 additions and 8 deletions

View file

@ -18,5 +18,5 @@
// #define HEARTBEAT_PIN LED_BUILTIN // #define HEARTBEAT_PIN LED_BUILTIN
#define HEARTBEAT_PIN 25 #define HEARTBEAT_PIN 25
// #define CONSOLE_SERIAL_RX 16 // #define TTY_SERIAL_RX 16
// #define CONSOLE_SERIAL_TX 17 // #define TTY_SERIAL_TX 17

View file

@ -54,8 +54,8 @@ constexpr const char SERIAL_CFG_FILE[] = "/serial.json";
#if defined(BUILD_FOR_RP2040) #if defined(BUILD_FOR_RP2040)
#define Serial_RS232 Serial1 #define Serial_RS232 Serial1
#elif defined(CONSOLE_SERIAL_RX) #elif defined(TTY_SERIAL_RX)
HardwareSerial Serial_RS232(1); HardwareSerial Serial_RS232(2);
#endif #endif
bus *b = nullptr; bus *b = nullptr;
@ -212,7 +212,7 @@ void start_network(console *const c)
dc11 *dc11_ = new dc11(1100, b); dc11 *dc11_ = new dc11(1100, b);
b->add_DC11(dc11_); b->add_DC11(dc11_);
#if !defined(BUILD_FOR_RP2040) && defined(CONSOLE_SERIAL_RX) #if !defined(BUILD_FOR_RP2040) && defined(TTY_SERIAL_RX)
constexpr uint32_t hwSerialConfig = SERIAL_8N1; constexpr uint32_t hwSerialConfig = SERIAL_8N1;
uint32_t bitrate = load_serial_speed_configuration(); uint32_t bitrate = load_serial_speed_configuration();
@ -220,7 +220,7 @@ void start_network(console *const c)
Serial.print(bitrate); Serial.print(bitrate);
Serial.println(F("bps")); Serial.println(F("bps"));
Serial_RS232.begin(bitrate, hwSerialConfig, CONSOLE_SERIAL_RX, CONSOLE_SERIAL_TX); Serial_RS232.begin(bitrate, hwSerialConfig, TTY_SERIAL_RX, TTY_SERIAL_TX);
Serial_RS232.setHwFlowCtrlMode(0); Serial_RS232.setHwFlowCtrlMode(0);
dc11_->set_serial(&Serial_RS232); dc11_->set_serial(&Serial_RS232);
@ -243,7 +243,7 @@ void recall_configuration(console *const cnsl)
} }
#endif #endif
#if defined(CONSOLE_SERIAL_RX) #if defined(TTY_SERIAL_RX)
void set_tty_serial_speed(console *const c, const uint32_t bps) void set_tty_serial_speed(console *const c, const uint32_t bps)
{ {
Serial_RS232.begin(bps); Serial_RS232.begin(bps);

View file

@ -47,7 +47,7 @@ board_build.filesystem = littlefs
lib_deps = greiman/SdFat@^2.1.2 lib_deps = greiman/SdFat@^2.1.2
adafruit/Adafruit NeoPixel adafruit/Adafruit NeoPixel
bblanchon/ArduinoJson@^6.19.4 bblanchon/ArduinoJson@^6.19.4
build_flags = -std=gnu++17 -DESP32=1 -ggdb3 -D_GLIBCXX_USE_C99 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DCONFIG_SPIRAM_USE_MALLOC build_flags = -std=gnu++17 -DESP32=1 -ggdb3 -D_GLIBCXX_USE_C99 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DCONFIG_SPIRAM_USE_MALLOC -DTTY_SERIAL_RX=4 -DTTY_SERIAL_TX=15
build_unflags = -std=gnu++11 build_unflags = -std=gnu++11
extra_scripts = pre:prepare.py extra_scripts = pre:prepare.py