From b8d1c682ea333a10a58abbcfe51014275f2d4b18 Mon Sep 17 00:00:00 2001 From: FranziHH <45534937+FranziHH@users.noreply.github.com> Date: Thu, 31 Aug 2023 10:08:23 +0200 Subject: [PATCH] FastClock is working for Me Fast Clock can be easily activated without complicated adjustments in config.h: Serial: simply comment out the required port: e.g. #define SERIAL1_COMMANDS OR for I2C //#define FAST_CLOCK_I2C 0x55 and define the address --- IO_EXFastclock.h | 5 +++-- config.example.h | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/IO_EXFastclock.h b/IO_EXFastclock.h index 06d546f..54d4cf1 100644 --- a/IO_EXFastclock.h +++ b/IO_EXFastclock.h @@ -95,7 +95,8 @@ void _loop(unsigned long currentMicros) override{ if (FAST_CLOCK_EXISTS==true) { uint8_t readBuffer[3]; byte a,b; - #ifdef EXRAIL_ACTIVE + // I would like to use the FastClock without EXRAIL + // #ifdef EXRAIL_ACTIVE I2CManager.read(_I2CAddress, readBuffer, 3); // XXXX change this to save a few bytes a = readBuffer[0]; @@ -110,7 +111,7 @@ void _loop(unsigned long currentMicros) override{ // Clock interval is 60/ clockspeed i.e 60/b seconds delayUntil(currentMicros + ((60/b) * 1000000)); - #endif + // #endif } } diff --git a/config.example.h b/config.example.h index 0f136f9..505d2b7 100644 --- a/config.example.h +++ b/config.example.h @@ -239,7 +239,10 @@ The configuration file for DCC-EX Command Station // SAMD/SAMC and STM32 have up to 6.) // To monitor a throttle on one or more serial ports, uncomment the defines below. // NOTE: do not define here the WiFi shield serial port or your wifi will not work. -// +// ------------------------------------- +// For Use with FastClock serial: uncomment the needed serial Port and +// FastClock will work, no further actions are needed +// ------------------------------------- //#define SERIAL1_COMMANDS //#define SERIAL2_COMMANDS //#define SERIAL3_COMMANDS @@ -247,6 +250,12 @@ The configuration file for DCC-EX Command Station //#define SERIAL5_COMMANDS //#define SERIAL6_COMMANDS // +// ------------------------------------- +// FastClock with I2C +// uncomment the following Line and Set the used I2C Address +//#define FAST_CLOCK_I2C 0x55 // default is 0x55 +// ------------------------------------- +// // BLUETOOTH SERIAL ON ESP32 // On ESP32 you have the possibility to use the builtin BT serial to connect to // the CS.