Skip to content

Commit e119a26

Browse files
committed
[BLUE_F407VE] Avoid duplicated analog pins
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 082e835 commit e119a26

File tree

2 files changed

+34
-32
lines changed

2 files changed

+34
-32
lines changed

variants/BLUE_F407VE_Mini/variant.cpp

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,28 @@ const PinName digitalPin[] = {
128128
PB_3,
129129
PB_5,
130130
PB_7,
131-
PB_9, //D79 - LED
131+
PB_9 //D79 - LED
132132
//GND
133133
//3V3
134134
//GND
135-
// Analog pins
136-
PA_0, //D80
137-
PA_1,
138-
PA_2,
139-
PA_3,
140-
PA_4,
141-
PA_5,
142-
PB_0,
143-
PB_1,
144-
PC_0,
145-
PC_1,
146-
PC_2, //D90
147-
PC_3,
148-
PC_4,
149-
PC_5
135+
};
136+
137+
// Analog (Ax) pin number array
138+
const uint32_t analogInPin[] = {
139+
7, //A0
140+
8, //A1
141+
49, //A2
142+
50, //A3
143+
9, //A4
144+
51, //A5
145+
12, //A6
146+
54, //A7
147+
5, //A8
148+
47, //A9
149+
6, //A10
150+
48, //A11
151+
11, //A12
152+
53 //A13
150153
};
151154

152155
#ifdef __cplusplus

variants/BLUE_F407VE_Mini/variant.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ extern "C" {
4747
#define PE4 2
4848
#define PE6 3
4949
#define PC14 4 // OSC32_IN
50-
#define PC0 5 // A8
51-
#define PC2 6 // A10
52-
#define PA0 7 // A0
53-
#define PA1 8 // A1
54-
#define PA4 9 // A4
50+
#define PC0 A8
51+
#define PC2 A10
52+
#define PA0 A0
53+
#define PA1 A1
54+
#define PA4 A4
5555
#define PA6 10
56-
#define PC4 11 // A12
57-
#define PB0 12 // A6
56+
#define PC4 A12
57+
#define PB0 A6
5858
#define PB2 13
5959
#define PE8 14
6060
#define PE9 15
@@ -96,14 +96,14 @@ extern "C" {
9696
#define PE5 44
9797
#define PC13 45
9898
#define PC15 46 // OSC32_OUT
99-
#define PC1 47 // A9
100-
#define PC3 48 // A11
101-
#define PA2 49 // A2
102-
#define PA3 50 // A3
103-
#define PA5 51 // A5
99+
#define PC1 A9
100+
#define PC3 A11
101+
#define PA2 A2
102+
#define PA3 A3
103+
#define PA5 A5
104104
#define PA7 52
105-
#define PC5 53 // A13
106-
#define PB1 54 // A7
105+
#define PC5 A13
106+
#define PB1 A7
107107
#define PE7 55
108108
#define PE10 56
109109
#define PE12 57
@@ -135,10 +135,9 @@ extern "C" {
135135
// GND
136136

137137
// This must be a literal
138-
#define NUM_DIGITAL_PINS 94
138+
#define NUM_DIGITAL_PINS 80
139139
// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
140140
#define NUM_ANALOG_INPUTS 14
141-
#define NUM_ANALOG_FIRST 80
142141

143142
// On-board LED pin number
144143
#define LED_BUILTIN PB9

0 commit comments

Comments
 (0)