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
Mahesh Mahadevan 2019-02-11 15:58:04 -06:00
parent a64b192081
commit a934ba0b5a
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}