From 9dc54edf0061f4b881db378d1e16e9e15b9f8e45 Mon Sep 17 00:00:00 2001 From: Christoph Haberer Date: Tue, 25 Apr 2017 07:04:48 +0200 Subject: [PATCH] OTG leds removed from blink example to prevent OTG-FAULT shartcut on the boards --- .../Discovery407VG/Blink_allLeds/Blink_allLeds.ino | 7 +++---- .../Discovery429ZI/Blink_allLeds/Blink_allLeds.ino | 6 ++---- STM32/variants/DISCOVERY_F407VG/variant.h | 2 +- STM32/variants/DISCOVERY_F429ZI/variant.h | 3 ++- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/STM32/libraries/BoardExamples/examples/Discovery407VG/Blink_allLeds/Blink_allLeds.ino b/STM32/libraries/BoardExamples/examples/Discovery407VG/Blink_allLeds/Blink_allLeds.ino index 78660ce..271818a 100644 --- a/STM32/libraries/BoardExamples/examples/Discovery407VG/Blink_allLeds/Blink_allLeds.ino +++ b/STM32/libraries/BoardExamples/examples/Discovery407VG/Blink_allLeds/Blink_allLeds.ino @@ -7,16 +7,15 @@ #define LED_BLUE PD15 //58 #define LED_RED PD13 //19 #define LED_ORANGE PD13 //57 -#define LED_RED_OTG_OVERCURRENT PD5 + */ -#define NUMLEDS 5 -const uint8_t Led[] = {LED_GREEN, LED_ORANGE, LED_RED, LED_BLUE, LED_RED_OTG_OVERCURRENT}; +#define NUMLEDS 4 +const uint8_t Led[] = {LED_GREEN, LED_ORANGE, LED_RED, LED_BLUE}; void setup() { for (int n = 0; n < NUMLEDS; n++) pinMode(Led[n], OUTPUT); - //pinMode(REDLEDOTGOVERCURRENT,PULL_UP); // needed to protect STMPS2141 FAULT output from shortcutting PC5 on power fault } void setLed(uint8_t n, uint8_t state) diff --git a/STM32/libraries/BoardExamples/examples/Discovery429ZI/Blink_allLeds/Blink_allLeds.ino b/STM32/libraries/BoardExamples/examples/Discovery429ZI/Blink_allLeds/Blink_allLeds.ino index 8bc8967..92b28b2 100644 --- a/STM32/libraries/BoardExamples/examples/Discovery429ZI/Blink_allLeds/Blink_allLeds.ino +++ b/STM32/libraries/BoardExamples/examples/Discovery429ZI/Blink_allLeds/Blink_allLeds.ino @@ -2,12 +2,10 @@ // STM32F429 Discovery #define GREENLED PG13 - #define REDLED PG14 -#define OTGFSOC_LED PC5 -#define NUMLEDS 3 -const uint8_t Led[] = {GREENLED, REDLED, OTGFSOC_LED}; +#define NUMLEDS 2 +const uint8_t Led[] = {GREENLED, REDLED}; void setup() { diff --git a/STM32/variants/DISCOVERY_F407VG/variant.h b/STM32/variants/DISCOVERY_F407VG/variant.h index 3eb130d..8d487be 100644 --- a/STM32/variants/DISCOVERY_F407VG/variant.h +++ b/STM32/variants/DISCOVERY_F407VG/variant.h @@ -7,7 +7,7 @@ #define LED_BLUE PD15 // 58 #define LED_RED PD14 // 19 #define LED_ORANGE PD13 // 57 -#define LED_RED_OTG_OVERCURRENT PD5 +#define LED_RED_OTG_OVERCURRENT PD5 // be careful with this led. When using it configure the output as PULL_UP. //On-board user button #define USER_BTN PA0 // 2 diff --git a/STM32/variants/DISCOVERY_F429ZI/variant.h b/STM32/variants/DISCOVERY_F429ZI/variant.h index 6a653b6..cb76165 100644 --- a/STM32/variants/DISCOVERY_F429ZI/variant.h +++ b/STM32/variants/DISCOVERY_F429ZI/variant.h @@ -1,10 +1,11 @@ #ifndef VARIANT_H #define VARIANT_H +//On-board LED pin number PIN #define LED_BUILTIN PG13 #define LED_GREEN LED_BUILTIN #define LED_RED PG14 -#define LED_RED_OTG_OVERCURRENT PC5 +#define LED_RED_OTG_OVERCURRENT PC5 // be careful with this led. When using it configure the output as PULL_UP. //On-board user button #define USER_BTN PA0