1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-30 03:26:13 +01:00

ACON/ACOF 32 bit + 1=OFF

This commit is contained in:
Asbelos 2024-05-31 19:49:39 +01:00
parent fca4ea052e
commit a2fb58584f
3 changed files with 14 additions and 11 deletions

View File

@ -1004,8 +1004,9 @@ void RMFT2::loop2() {
case OPCODE_ACON: // MERG adapter case OPCODE_ACON: // MERG adapter
case OPCODE_ACOF: case OPCODE_ACOF:
if ((compileFeatures & FEATURE_LCC) && LCCSerial) if ((compileFeatures & FEATURE_LCC) && LCCSerial)
StringFormatter::send(LCCSerial,F("<L x%c%h>"), StringFormatter::send(LCCSerial,F("<L x%c%h%h>"),
opcode==OPCODE_ACON?'1':'0',(uint16_t)operand); opcode==OPCODE_ACON?'0':'1',
(uint16_t)operand,getOperand(progCounter,1));
break; break;
case OPCODE_LCCX: // long form LCC case OPCODE_LCCX: // long form LCC

View File

@ -78,8 +78,10 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
getOperand(progCounter,0) getOperand(progCounter,0)
); );
} }
if (opcode==OPCODE_ACON) StringFormatter::send(stream,F("<LS x1%h>\n"),getOperand(progCounter,0)); if (opcode==OPCODE_ACON) StringFormatter::send(stream,F("<LS x0%h%h>\n"),
if (opcode==OPCODE_ACOF) StringFormatter::send(stream,F("<LS x0%h>\n"),getOperand(progCounter,0)); getOperand(progCounter,0),getOperand(progCounter,1));
if (opcode==OPCODE_ACOF) StringFormatter::send(stream,F("<LS x1%h%h>\n"),
getOperand(progCounter,0),getOperand(progCounter,1));
} }
// we stream the hex events we wish to listen to // we stream the hex events we wish to listen to
@ -103,10 +105,10 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
} }
if (opcode==OPCODE_ONACON || opcode==OPCODE_ONACOF) { if (opcode==OPCODE_ONACON || opcode==OPCODE_ONACOF) {
onLCCLookup[eventIndex]=progCounter; // TODO skip... onLCCLookup[eventIndex]=progCounter; // TODO skip...
StringFormatter::send(stream,F("<LL %d x%c%h>\n"), StringFormatter::send(stream,F("<LL %d x%c%h%h>\n"),
eventIndex, eventIndex,
opcode==OPCODE_ONACON?'1':'0', opcode==OPCODE_ONACON?'0':'1',
getOperand(progCounter,0) getOperand(progCounter,0),getOperand(progCounter,1)
); );
eventIndex++; eventIndex++;
} }

View File

@ -541,10 +541,10 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup];
OPCODE_PAD,V((((uint64_t)sender)>>32)&0xFFFF),\ OPCODE_PAD,V((((uint64_t)sender)>>32)&0xFFFF),\
OPCODE_PAD,V((((uint64_t)sender)>>16)&0xFFFF),\ OPCODE_PAD,V((((uint64_t)sender)>>16)&0xFFFF),\
OPCODE_PAD,V((((uint64_t)sender)>>0)&0xFFFF), OPCODE_PAD,V((((uint64_t)sender)>>0)&0xFFFF),
#define ACON(eventid) OPCODE_ACON,V(eventid), #define ACON(eventid) OPCODE_ACON,V(((uint32_t)eventid >>16) & 0xFFFF),OPCODE_PAD,V(eventid & 0xFFFF),
#define ACOF(eventid) OPCODE_ACOF,V(eventid), #define ACOF(eventid) OPCODE_ACOF,V(((uint32_t)eventid >>16) & 0xFFFF),OPCODE_PAD,V(eventid & 0xFFFF),
#define ONACON(eventid) OPCODE_ONACON,V(eventid), #define ONACON(eventid) OPCODE_ONACON,V((uint32_t)(eventid) >>16),OPCODE_PAD,V(eventid & 0xFFFF),
#define ONACOF(eventid) OPCODE_ONACOF,V(eventid), #define ONACOF(eventid) OPCODE_ONACOF,V((uint32_t)(eventid) >>16),OPCODE_PAD,V(eventid & 0xFFFF),
#define LCD(id,msg) PRINT(msg) #define LCD(id,msg) PRINT(msg)
#define SCREEN(display,id,msg) PRINT(msg) #define SCREEN(display,id,msg) PRINT(msg)
#define STEALTH(code...) PRINT(dummy) #define STEALTH(code...) PRINT(dummy)