microbit: PortOut/PortIn now respects bit mask
The mbed PortOut and PortIn abstractions require the definition of a mask that specifies which pins in the given port are to be used. The nrf51822 implementation did not respect this funcitonality, and would overwrite all pins defined as an output, regardless of whether they were defined as part of the mask.
This commit is contained in:
parent
5678d944fe
commit
4618870501
2 changed files with 2 additions and 2 deletions
Binary file not shown.
|
@ -75,10 +75,10 @@ void port_dir(port_t *obj, PinDirection dir)
|
|||
|
||||
void port_write(port_t *obj, int value)
|
||||
{
|
||||
*obj->reg_out = value;
|
||||
*obj->reg_out = (*obj->reg_out & ~obj->mask) | (value & obj->mask);
|
||||
}
|
||||
|
||||
int port_read(port_t *obj)
|
||||
{
|
||||
return (*obj->reg_in);
|
||||
return (*obj->reg_in & obj->mask);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue