Skip to content

Commit a934ba0

Browse files
committed
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 <[email protected]>
1 parent a64b192 commit a934ba0

File tree

1 file changed

+1
-1
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC

1 file changed

+1
-1
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/pinmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void pin_function(PinName pin, int function)
3333
IOCON->PIO[port_number][pin_number] |= IOCON_PIO_DIGIMODE_MASK;
3434

3535
reg = IOCON->PIO[port_number][pin_number];
36-
reg = (reg & ~0x7) | (function & 0x7);
36+
reg = (reg & ~0x7) | (function & IOCON_PIO_FUNC_MASK);
3737
IOCON->PIO[port_number][pin_number] = reg;
3838
}
3939

0 commit comments

Comments
 (0)