Add support for open drain leds

pull/6778/head
Keyur Hariya 2018-04-30 15:27:07 -05:00
parent b2f409c652
commit ca4937d40d
2 changed files with 8 additions and 1 deletions

View File

@ -67,6 +67,13 @@ void gpio_init(gpio_t *obj, PinName name)
void gpio_mode(gpio_t *obj, PinMode mode)
{
#ifdef OPEN_DRAIN_LEDS
if ((obj->name == LED1) || (obj->name == LED2) ||
(obj->name == LED3) || (obj->name == LED4)) {
mode = OpenDrain;
}
#endif
obj->mode = mode;
pin_mode(obj->name, mode);
}

View File

@ -2782,7 +2782,7 @@
"MAX32625MBED": {
"inherits": ["Target"],
"core": "Cortex-M4F",
"macros": ["__SYSTEM_HFX=96000000","TARGET=MAX32625","TARGET_REV=0x4132"],
"macros": ["__SYSTEM_HFX=96000000","TARGET=MAX32625","TARGET_REV=0x4132", "OPEN_DRAIN_LEDS"],
"extra_labels": ["Maxim", "MAX32625"],
"supported_toolchains": ["GCC_ARM", "IAR", "ARM"],
"device_has": ["ANALOGIN", "I2C", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "STDIO_MESSAGES"],