1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

ONACTIVATE catchers etc

UNTESTED SO FAR
This commit is contained in:
Asbelos
2021-11-25 11:36:05 +00:00
parent ef1719f6fc
commit 92d6a15ee5
4 changed files with 73 additions and 7 deletions

View File

@@ -25,6 +25,7 @@
#include "version.h"
#include "FSH.h"
#include "IODevice.h"
#include "RMFT2.h"
// This module is responsible for converting API calls into
// messages to be sent to the waveform generator.
@@ -253,6 +254,9 @@ void DCC::setAccessory(int address, byte number, bool activate) {
b[1] = ((((address / 64) % 8) << 4) + (number % 4 << 1) + activate % 2) ^ 0xF8; // second byte is of the form 1AAACDDD, where C should be 1, and the least significant D represent activate/deactivate
DCCWaveform::mainTrack.schedulePacket(b, 2, 4); // Repeat the packet four times
#if defined(RMFT_ACTIVE)
RMFT2::activateEvent(address<<2|number,activate);
#endif
}
//