mirror of https://github.com/ARMmbed/mbed-os.git
MCUXpresso: In pin_function() use mask macro instead of a hard-coded value
The mask size can vary based on the platform Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>pull/9910/head
parent
a64b192081
commit
a934ba0b5a
|
@ -33,7 +33,7 @@ void pin_function(PinName pin, int function)
|
|||
IOCON->PIO[port_number][pin_number] |= IOCON_PIO_DIGIMODE_MASK;
|
||||
|
||||
reg = IOCON->PIO[port_number][pin_number];
|
||||
reg = (reg & ~0x7) | (function & 0x7);
|
||||
reg = (reg & ~0x7) | (function & IOCON_PIO_FUNC_MASK);
|
||||
IOCON->PIO[port_number][pin_number] = reg;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue