Skip to content

Commit

Permalink
Merge pull request #38 from RussellSenior/rationalize-bit-operations
Browse files Browse the repository at this point in the history
  • Loading branch information
Twilight-Logic authored Nov 22, 2023
2 parents f5c948f + 87a0f95 commit ec4343b
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 130 deletions.
13 changes: 5 additions & 8 deletions src/AR488/AR488.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1399,11 +1399,9 @@ void loc_h(char *params) {
*/
void ifc_h() {
if (gpibBus.cfg.cmode==2) {
// Assert IFC
gpibBus.setControlVal(0b00000000, 0b00000001, 0);
assertCtrl(IFC_BIT);
delayMicroseconds(150);
// De-assert IFC
gpibBus.setControlVal(0b00000001, 0b00000001, 0);
clearCtrl(IFC_BIT);
if (isVerb) dataPort.println(F("IFC signal asserted for 150 microseconds"));
}
}
Expand Down Expand Up @@ -1824,8 +1822,7 @@ void ppoll_h() {
gpibBus.setControls(CIDS);
delayMicroseconds(20);
// Assert ATN and EOI
gpibBus.setControlVal(0b00000000, 0b10010000, 0);
// setGpibState(0b10010000, 0b00000000, 0b10010000);
assertCtrl(ATN_BIT | EOI_BIT);
delayMicroseconds(20);
// Read data byte from GPIB bus without handshake
sb = readGpibDbus();
Expand Down Expand Up @@ -2089,8 +2086,8 @@ void xdiag_h(char *params){
break;
case 1:
// Set to required state
gpibBus.setControlVal(0xFF, 0xFF, 1); // Set direction (all pins as outputs)
gpibBus.setControlVal(~byteval, 0xFF, 0); // Set state (asserted=LOW so must invert value)
outputCtrl(ALL_BITS);
assertCtrl(ALL_BITS);
// Reset after 10 seconds
delay(10000);
if (gpibBus.cfg.cmode==2) {
Expand Down
Loading

0 comments on commit ec4343b

Please sign in to comment.