1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 08:06:13 +01:00

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
This commit is contained in:
FranziHH 2023-08-31 10:08:23 +02:00
parent fb8cca8d35
commit b8d1c682ea
2 changed files with 13 additions and 3 deletions

View File

@ -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
}
}

View File

@ -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.