You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Mega-0 OUTSET and OUTCLR registers are atomic by nature, so interrupts do not need to be disabled in the digitalWrite() code that manipulates them. (code that does &= or |= still needs such wrappers, since all the IOREGes are now outside the SBI/CBI range and will result in non-atomic access.)
/* Output direction */
if(port->DIR & bit_mask){
//OMIT /* Save system status and disable interrupts */
//OMIT uint8_t status = SREG;
//OMIT cli();
/* Set output to value */
if (val == LOW) { /* If LOW */
port->OUTCLR = bit_mask;
} else if (val == TOGGLE) { /* If TOGGLE */
port->OUTTGL = bit_mask;
/* If HIGH OR > TOGGLE */
} else {
port->OUTSET = bit_mask;
}
//OMIT /* Restore system status */
//OMIT SREG = status;
/* Input direction */
} else {
The text was updated successfully, but these errors were encountered:
The Mega-0 OUTSET and OUTCLR registers are atomic by nature, so interrupts do not need to be disabled in the digitalWrite() code that manipulates them. (code that does &= or |= still needs such wrappers, since all the IOREGes are now outside the SBI/CBI range and will result in non-atomic access.)
The text was updated successfully, but these errors were encountered: