Merge pull request from maximmbed/max32625mbed-update-leds

Add support for open drain leds
pull/6667/merge
Martin Kojtal 2018-05-03 16:25:04 +01:00 committed by GitHub
commit 1f6ded136c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions
targets
TARGET_Maxim/TARGET_MAX32625

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"],