Skip to content

Commit

Permalink
ACON/ACOF 32 bit + 1=OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
Asbelos committed May 31, 2024
1 parent fca4ea0 commit a2fb585
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 3 additions & 2 deletions EXRAIL2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,9 @@ void RMFT2::loop2() {
case OPCODE_ACON: // MERG adapter
case OPCODE_ACOF:
if ((compileFeatures & FEATURE_LCC) && LCCSerial)
StringFormatter::send(LCCSerial,F("<L x%c%h>"),
opcode==OPCODE_ACON?'1':'0',(uint16_t)operand);
StringFormatter::send(LCCSerial,F("<L x%c%h%h>"),
opcode==OPCODE_ACON?'0':'1',
(uint16_t)operand,getOperand(progCounter,1));
break;

case OPCODE_LCCX: // long form LCC
Expand Down
12 changes: 7 additions & 5 deletions EXRAIL2Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
getOperand(progCounter,0)
);
}
if (opcode==OPCODE_ACON) StringFormatter::send(stream,F("<LS x1%h>\n"),getOperand(progCounter,0));
if (opcode==OPCODE_ACOF) StringFormatter::send(stream,F("<LS x0%h>\n"),getOperand(progCounter,0));
if (opcode==OPCODE_ACON) StringFormatter::send(stream,F("<LS x0%h%h>\n"),
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
Expand All @@ -103,10 +105,10 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
}
if (opcode==OPCODE_ONACON || opcode==OPCODE_ONACOF) {
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,
opcode==OPCODE_ONACON?'1':'0',
getOperand(progCounter,0)
opcode==OPCODE_ONACON?'0':'1',
getOperand(progCounter,0),getOperand(progCounter,1)
);
eventIndex++;
}
Expand Down
8 changes: 4 additions & 4 deletions EXRAILMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup];
OPCODE_PAD,V((((uint64_t)sender)>>32)&0xFFFF),\
OPCODE_PAD,V((((uint64_t)sender)>>16)&0xFFFF),\
OPCODE_PAD,V((((uint64_t)sender)>>0)&0xFFFF),
#define ACON(eventid) OPCODE_ACON,V(eventid),
#define ACOF(eventid) OPCODE_ACOF,V(eventid),
#define ONACON(eventid) OPCODE_ONACON,V(eventid),
#define ONACOF(eventid) OPCODE_ONACOF,V(eventid),
#define ACON(eventid) OPCODE_ACON,V(((uint32_t)eventid >>16) & 0xFFFF),OPCODE_PAD,V(eventid & 0xFFFF),
#define ACOF(eventid) OPCODE_ACOF,V(((uint32_t)eventid >>16) & 0xFFFF),OPCODE_PAD,V(eventid & 0xFFFF),
#define ONACON(eventid) OPCODE_ONACON,V((uint32_t)(eventid) >>16),OPCODE_PAD,V(eventid & 0xFFFF),
#define ONACOF(eventid) OPCODE_ONACOF,V((uint32_t)(eventid) >>16),OPCODE_PAD,V(eventid & 0xFFFF),
#define LCD(id,msg) PRINT(msg)
#define SCREEN(display,id,msg) PRINT(msg)
#define STEALTH(code...) PRINT(dummy)
Expand Down

0 comments on commit a2fb585

Please sign in to comment.