Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 5771586

Browse files
chiararuggerisergiotomasello
authored andcommitted
Tured LEDs off after pinMode set to output because of the reverse logic on LEDs
1 parent 07a446c commit 5771586

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cores/arduino/wiring_digital.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,19 @@ void pinMode( uint32_t ulPin, uint32_t ulMode )
279279

280280
case OUTPUT:
281281
// Set pin to output mode
282-
nrf_gpio_pin_dir_set(g_APinDescription[ulPin].ulPin, NRF_GPIO_PIN_DIR_OUTPUT);
283-
break ;
282+
nrf_gpio_pin_dir_set(g_APinDescription[ulPin].ulPin, NRF_GPIO_PIN_DIR_OUTPUT);
283+
284+
#ifdef ARDUINO_NRF52_PRIMO_CORE
285+
// LEDs on Core work with reverse logic. Turn them off if output mode is selected
286+
if(ulPin == 10 || ulPin == 11 || ulPin == 12 || ulPin == 13)
287+
digitalWrite(ulPin, LOW);
288+
#endif //ARDUINO_NRF52_PRIMO_CORE
289+
break ;
284290

285291
default:
286292
// do nothing
287293
break ;
294+
288295
}
289296
}
290297

0 commit comments

Comments
 (0)