Skip to content

Commit bd69ede

Browse files
committed
Atmel: Cope correctly with NC GPIO
1 parent fd68691 commit bd69ede

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

targets/TARGET_Atmel/TARGET_SAM_CortexM0P/gpio_api.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ uint32_t gpio_set(PinName pin)
2828

2929
void gpio_init(gpio_t *obj, PinName pin)
3030
{
31-
MBED_ASSERT(pin != (PinName)NC);
3231
struct port_config pin_conf;
3332
PortGroup *const port_base = (PortGroup*)port_get_group_from_gpio_pin(pin);
3433

targets/TARGET_Atmel/TARGET_SAM_CortexM4/gpio_api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ uint32_t gpio_set(PinName pin)
3030

3131
void gpio_init(gpio_t *obj, PinName pin)
3232
{
33-
MBED_ASSERT(pin != (PinName)NC);
3433
if (g_sys_init == 0) {
3534
sysclk_init();
3635
system_board_init();
3736
g_sys_init = 1;
3837
}
3938
obj->pin = pin;
39+
if (pin == NC) {
40+
return;
41+
}
4042

4143
ioport_set_pin_dir(pin, IOPORT_DIR_INPUT);
4244
ioport_set_pin_mode(pin, IOPORT_MODE_PULLUP);

0 commit comments

Comments
 (0)