Remove unnecessary checking of bit before setting GPIO

pull/1501/head
Steven Cooreman 2016-01-05 13:45:20 +01:00
parent f4133b8d36
commit 1631aac5aa
1 changed files with 2 additions and 6 deletions

View File

@ -104,18 +104,14 @@ void gpio_mode(gpio_t *obj, PinMode mode)
#ifdef _GPIO_P_DOUTSET_MASK
GPIO->P[port].DOUTSET = pin;
#else
if(!(GPIO->P[port].DOUT & pin)) {
GPIO->P[port].DOUTTGL = pin;
}
GPIO->P[port].DOUT |= pin;
#endif
} else {
//Clear DOUT
#ifdef _GPIO_P_DOUTCLR_MASK
GPIO->P[port].DOUTCLR = pin;
#else
if(GPIO->P[port].DOUT & pin) {
GPIO->P[port].DOUTTGL = pin;
}
GPIO->P[port].DOUT &= ~pin;
#endif
}
} else {