Reduce STM32_F4_F7 pin warnings

This commit is contained in:
Scott Lahteine 2019-08-06 04:48:29 -05:00
parent fb579212ea
commit 579e4396e2

View file

@ -27,8 +27,6 @@
* These use GPIO functions instead of Direct Port Manipulation, as on AVR. * These use GPIO functions instead of Direct Port Manipulation, as on AVR.
*/ */
#define _BV(b) (1 << (b))
#define READ(IO) digitalRead(IO) #define READ(IO) digitalRead(IO)
#define WRITE(IO,V) digitalWrite(IO,V) #define WRITE(IO,V) digitalWrite(IO,V)
@ -66,6 +64,7 @@
#define _STM32_PIN(P,PN) ((PORT##P * 16) + PN) #define _STM32_PIN(P,PN) ((PORT##P * 16) + PN)
#ifndef PA0
#define PA0 _STM32_PIN(A, 0) #define PA0 _STM32_PIN(A, 0)
#define PA1 _STM32_PIN(A, 1) #define PA1 _STM32_PIN(A, 1)
#define PA2 _STM32_PIN(A, 2) #define PA2 _STM32_PIN(A, 2)
@ -82,7 +81,9 @@
#define PA13 _STM32_PIN(A, 13) #define PA13 _STM32_PIN(A, 13)
#define PA14 _STM32_PIN(A, 14) #define PA14 _STM32_PIN(A, 14)
#define PA15 _STM32_PIN(A, 15) #define PA15 _STM32_PIN(A, 15)
#endif
#ifndef PB0
#define PB0 _STM32_PIN(B, 0) #define PB0 _STM32_PIN(B, 0)
#define PB1 _STM32_PIN(B, 1) #define PB1 _STM32_PIN(B, 1)
#define PB2 _STM32_PIN(B, 2) #define PB2 _STM32_PIN(B, 2)
@ -99,7 +100,9 @@
#define PB13 _STM32_PIN(B, 13) #define PB13 _STM32_PIN(B, 13)
#define PB14 _STM32_PIN(B, 14) #define PB14 _STM32_PIN(B, 14)
#define PB15 _STM32_PIN(B, 15) #define PB15 _STM32_PIN(B, 15)
#endif
#ifndef PC0
#define PC0 _STM32_PIN(C, 0) #define PC0 _STM32_PIN(C, 0)
#define PC1 _STM32_PIN(C, 1) #define PC1 _STM32_PIN(C, 1)
#define PC2 _STM32_PIN(C, 2) #define PC2 _STM32_PIN(C, 2)
@ -116,7 +119,9 @@
#define PC13 _STM32_PIN(C, 13) #define PC13 _STM32_PIN(C, 13)
#define PC14 _STM32_PIN(C, 14) #define PC14 _STM32_PIN(C, 14)
#define PC15 _STM32_PIN(C, 15) #define PC15 _STM32_PIN(C, 15)
#endif
#ifndef PD0
#define PD0 _STM32_PIN(D, 0) #define PD0 _STM32_PIN(D, 0)
#define PD1 _STM32_PIN(D, 1) #define PD1 _STM32_PIN(D, 1)
#define PD2 _STM32_PIN(D, 2) #define PD2 _STM32_PIN(D, 2)
@ -133,7 +138,9 @@
#define PD13 _STM32_PIN(D, 13) #define PD13 _STM32_PIN(D, 13)
#define PD14 _STM32_PIN(D, 14) #define PD14 _STM32_PIN(D, 14)
#define PD15 _STM32_PIN(D, 15) #define PD15 _STM32_PIN(D, 15)
#endif
#ifndef PE0
#define PE0 _STM32_PIN(E, 0) #define PE0 _STM32_PIN(E, 0)
#define PE1 _STM32_PIN(E, 1) #define PE1 _STM32_PIN(E, 1)
#define PE2 _STM32_PIN(E, 2) #define PE2 _STM32_PIN(E, 2)
@ -150,11 +157,12 @@
#define PE13 _STM32_PIN(E, 13) #define PE13 _STM32_PIN(E, 13)
#define PE14 _STM32_PIN(E, 14) #define PE14 _STM32_PIN(E, 14)
#define PE15 _STM32_PIN(E, 15) #define PE15 _STM32_PIN(E, 15)
#endif
#ifdef STM32F7 #ifdef STM32F7
#define PORTF 5
#define PORTG 6
#ifndef PF0
#define PORTF 5
#define PF0 _STM32_PIN(F, 0) #define PF0 _STM32_PIN(F, 0)
#define PF1 _STM32_PIN(F, 1) #define PF1 _STM32_PIN(F, 1)
#define PF2 _STM32_PIN(F, 2) #define PF2 _STM32_PIN(F, 2)
@ -171,7 +179,10 @@
#define PF13 _STM32_PIN(F, 13) #define PF13 _STM32_PIN(F, 13)
#define PF14 _STM32_PIN(F, 14) #define PF14 _STM32_PIN(F, 14)
#define PF15 _STM32_PIN(F, 15) #define PF15 _STM32_PIN(F, 15)
#endif
#ifndef PG0
#define PORTG 6
#define PG0 _STM32_PIN(G, 0) #define PG0 _STM32_PIN(G, 0)
#define PG1 _STM32_PIN(G, 1) #define PG1 _STM32_PIN(G, 1)
#define PG2 _STM32_PIN(G, 2) #define PG2 _STM32_PIN(G, 2)
@ -188,5 +199,6 @@
#define PG13 _STM32_PIN(G, 13) #define PG13 _STM32_PIN(G, 13)
#define PG14 _STM32_PIN(G, 14) #define PG14 _STM32_PIN(G, 14)
#define PG15 _STM32_PIN(G, 15) #define PG15 _STM32_PIN(G, 15)
#endif
#endif // STM32GENERIC && STM32F7 #endif // STM32GENERIC && STM32F7