Skip to content

Commit 18dee8f

Browse files
authored
Merge pull request #3953 from jeromecoutant/PR_LOOP_TESTS
OS2 tests minor updates for STM32
2 parents 2ec6ee4 + 23de782 commit 18dee8f

File tree

5 files changed

+51
-16
lines changed

5 files changed

+51
-16
lines changed

features/unsupported/tests/mbed/digitalin_digitalout/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ DigitalIn in(dp2);
99
// port pin), D1 is used as USBTX
1010
DigitalOut out(D7);
1111
DigitalIn in(D2);
12+
1213
#elif defined(TARGET_STM) && defined(TARGET_FF_ARDUINO)
1314
// TARGET_FF_ARDUINO cannot be used
1415
// D0 is used as USBRX for some NUCLEO64
1516
// D7 is not used for some NUCLEO32
16-
DigitalOut out(D9);
17+
DigitalOut out(D3);
1718
DigitalIn in(D2);
1819

1920
#elif defined(TARGET_DISCO_L053C8) || \

features/unsupported/tests/mbed/digitalinout/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DigitalInOut d2(D7);
1414
// TARGET_FF_ARDUINO cannot be used
1515
// D0 is used as USBRX for some NUCLEO64
1616
// D7 is not used for some NUCLEO32
17-
DigitalInOut d1(D9);
17+
DigitalInOut d1(D3);
1818
DigitalInOut d2(D2);
1919

2020
#elif defined(TARGET_DISCO_L053C8) || \

features/unsupported/tests/mbed/interruptin/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void in_handler() {
4444
// D0 is used as USBRX for some NUCLEO64
4545
// D7 is not used for some NUCLEO32
4646
#define PIN_OUT D2
47-
#define PIN_IN D9
47+
#define PIN_IN D3
4848

4949
#elif defined(TARGET_DISCO_L053C8) || \
5050
defined(TARGET_DISCO_F334C8)

features/unsupported/tests/mbed/portinout/main.cpp

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include "test_env.h"
22

3+
#if !DEVICE_PORTINOUT
4+
#error [NOT_SUPPORTED] PortInOut is not supported
5+
#endif
6+
37
#if defined(TARGET_K64F)
48
#define P1_1 (1 << 16)
59
#define P1_2 (1 << 17)
@@ -103,14 +107,28 @@
103107
defined(TARGET_NUCLEO_F411RE) || \
104108
defined(TARGET_NUCLEO_L053R8) || \
105109
defined(TARGET_NUCLEO_L073RZ) || \
110+
defined(TARGET_NUCLEO_L476RG) || \
111+
defined(TARGET_NUCLEO_F446RE) || \
106112
defined(TARGET_NUCLEO_L152RE)
107-
#define P1_1 (1 << 6) // PC_6
108-
#define P1_2 (1 << 5) // PC_5
109-
#define PORT_1 PortC
113+
#define P1_1 (1 << 3) // PB_3 (D3)
114+
#define P1_2 (1 << 10) // PB_10 (D6)
115+
#define PORT_1 PortB
110116

111-
#define P2_1 (1 << 8) // PB_8
112-
#define P2_2 (1 << 9) // PB_9
113-
#define PORT_2 PortB
117+
#define P2_1 (1 << 10) // PA_10 (D2)
118+
#define P2_2 (1 << 8) // PA_8 (D7)
119+
#define PORT_2 PortA
120+
121+
#elif defined(TARGET_NUCLEO_F767ZI) || \
122+
defined(TARGET_NUCLEO_F303ZE) || \
123+
defined(TARGET_NUCLEO_F207ZG) || \
124+
defined(TARGET_NUCLEO_F746ZG)
125+
#define P1_1 (1 << 13) // PE_13 (D3)
126+
#define P1_2 (1 << 11) // PE_11 (D5)
127+
#define PORT_1 PortE
128+
129+
#define P2_1 (1 << 15) // PF_15 (D2)
130+
#define P2_2 (1 << 14) // PF_14 (D4)
131+
#define PORT_2 PortF
114132

115133
#elif defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32GG_STK3700) || defined(TARGET_EFM32WG_STK3800)
116134
#define P1_1 (1 << 0) // PD0
@@ -193,6 +211,8 @@
193211
#define P2_2 (1 << 1) /*P5_1*/
194212
#define PORT_2 Port5
195213

214+
#else
215+
#error [NOT_SUPPORTED] This test is not defined on this target
196216
#endif
197217

198218
#define MASK_1 (P1_1 | P1_2)

features/unsupported/tests/mbed/portout_portin/main.cpp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,28 @@
121121
defined(TARGET_NUCLEO_F411RE) || \
122122
defined(TARGET_NUCLEO_L053R8) || \
123123
defined(TARGET_NUCLEO_L073RZ) || \
124+
defined(TARGET_NUCLEO_L476RG) || \
125+
defined(TARGET_NUCLEO_F446RE) || \
124126
defined(TARGET_NUCLEO_L152RE)
125-
#define P1_1 (1 << 6) // PC_6
126-
#define P1_2 (1 << 5) // PC_5
127-
#define PORT_1 PortC
127+
#define P1_1 (1 << 3) // PB_3 (D3)
128+
#define P1_2 (1 << 10) // PB_10 (D6)
129+
#define PORT_1 PortB
128130

129-
#define P2_1 (1 << 8) // PB_8
130-
#define P2_2 (1 << 9) // PB_9
131-
#define PORT_2 PortB
131+
#define P2_1 (1 << 10) // PA_10 (D2)
132+
#define P2_2 (1 << 8) // PA_8 (D7)
133+
#define PORT_2 PortA
134+
135+
#elif defined(TARGET_NUCLEO_F767ZI) || \
136+
defined(TARGET_NUCLEO_F303ZE) || \
137+
defined(TARGET_NUCLEO_F207ZG) || \
138+
defined(TARGET_NUCLEO_F746ZG)
139+
#define P1_1 (1 << 13) // PE_13 (D3)
140+
#define P1_2 (1 << 11) // PE_11 (D5)
141+
#define PORT_1 PortE
142+
143+
#define P2_1 (1 << 15) // PF_15 (D2)
144+
#define P2_2 (1 << 14) // PF_14 (D4)
145+
#define PORT_2 PortF
132146

133147
#elif defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32GG_STK3700) || defined(TARGET_EFM32WG_STK3800)
134148
#define P1_1 (1 << 0) // PD0
@@ -212,7 +226,7 @@
212226
#define PORT_2 Port5
213227

214228
#else
215-
#error [NOT_SUPPORTED] This test is not supported on this target
229+
#error [NOT_SUPPORTED] This test is not defined on this target
216230
#endif
217231

218232
#define MASK_1 (P1_1 | P1_2)

0 commit comments

Comments
 (0)