From 23de7828683717f6987e7a07d069bf68be54dfa9 Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Thu, 16 Mar 2017 17:47:44 +0100 Subject: [PATCH] OS2 tests minor updates for STM32 Some pin configuration are now aligned with ci-shield --- .../tests/mbed/digitalin_digitalout/main.cpp | 3 +- .../tests/mbed/digitalinout/main.cpp | 2 +- .../tests/mbed/interruptin/main.cpp | 2 +- .../unsupported/tests/mbed/portinout/main.cpp | 32 +++++++++++++++---- .../tests/mbed/portout_portin/main.cpp | 28 ++++++++++++---- 5 files changed, 51 insertions(+), 16 deletions(-) diff --git a/features/unsupported/tests/mbed/digitalin_digitalout/main.cpp b/features/unsupported/tests/mbed/digitalin_digitalout/main.cpp index 1e1de891bb..eb5ffd9b7d 100644 --- a/features/unsupported/tests/mbed/digitalin_digitalout/main.cpp +++ b/features/unsupported/tests/mbed/digitalin_digitalout/main.cpp @@ -9,11 +9,12 @@ DigitalIn in(dp2); // port pin), D1 is used as USBTX DigitalOut out(D7); DigitalIn in(D2); + #elif defined(TARGET_STM) && defined(TARGET_FF_ARDUINO) // TARGET_FF_ARDUINO cannot be used // D0 is used as USBRX for some NUCLEO64 // D7 is not used for some NUCLEO32 -DigitalOut out(D9); +DigitalOut out(D3); DigitalIn in(D2); #elif defined(TARGET_DISCO_L053C8) || \ diff --git a/features/unsupported/tests/mbed/digitalinout/main.cpp b/features/unsupported/tests/mbed/digitalinout/main.cpp index 22a1fad2af..9cfa01a1f9 100644 --- a/features/unsupported/tests/mbed/digitalinout/main.cpp +++ b/features/unsupported/tests/mbed/digitalinout/main.cpp @@ -14,7 +14,7 @@ DigitalInOut d2(D7); // TARGET_FF_ARDUINO cannot be used // D0 is used as USBRX for some NUCLEO64 // D7 is not used for some NUCLEO32 -DigitalInOut d1(D9); +DigitalInOut d1(D3); DigitalInOut d2(D2); #elif defined(TARGET_DISCO_L053C8) || \ diff --git a/features/unsupported/tests/mbed/interruptin/main.cpp b/features/unsupported/tests/mbed/interruptin/main.cpp index cf49d86653..8792c87890 100644 --- a/features/unsupported/tests/mbed/interruptin/main.cpp +++ b/features/unsupported/tests/mbed/interruptin/main.cpp @@ -44,7 +44,7 @@ void in_handler() { // D0 is used as USBRX for some NUCLEO64 // D7 is not used for some NUCLEO32 #define PIN_OUT D2 -#define PIN_IN D9 +#define PIN_IN D3 #elif defined(TARGET_DISCO_L053C8) || \ defined(TARGET_DISCO_F334C8) diff --git a/features/unsupported/tests/mbed/portinout/main.cpp b/features/unsupported/tests/mbed/portinout/main.cpp index bdc09e3369..06a1fc2792 100644 --- a/features/unsupported/tests/mbed/portinout/main.cpp +++ b/features/unsupported/tests/mbed/portinout/main.cpp @@ -1,5 +1,9 @@ #include "test_env.h" +#if !DEVICE_PORTINOUT + #error [NOT_SUPPORTED] PortInOut is not supported +#endif + #if defined(TARGET_K64F) #define P1_1 (1 << 16) #define P1_2 (1 << 17) @@ -103,14 +107,28 @@ defined(TARGET_NUCLEO_F411RE) || \ defined(TARGET_NUCLEO_L053R8) || \ defined(TARGET_NUCLEO_L073RZ) || \ + defined(TARGET_NUCLEO_L476RG) || \ + defined(TARGET_NUCLEO_F446RE) || \ defined(TARGET_NUCLEO_L152RE) -#define P1_1 (1 << 6) // PC_6 -#define P1_2 (1 << 5) // PC_5 -#define PORT_1 PortC +#define P1_1 (1 << 3) // PB_3 (D3) +#define P1_2 (1 << 10) // PB_10 (D6) +#define PORT_1 PortB -#define P2_1 (1 << 8) // PB_8 -#define P2_2 (1 << 9) // PB_9 -#define PORT_2 PortB +#define P2_1 (1 << 10) // PA_10 (D2) +#define P2_2 (1 << 8) // PA_8 (D7) +#define PORT_2 PortA + +#elif defined(TARGET_NUCLEO_F767ZI) || \ + defined(TARGET_NUCLEO_F303ZE) || \ + defined(TARGET_NUCLEO_F207ZG) || \ + defined(TARGET_NUCLEO_F746ZG) +#define P1_1 (1 << 13) // PE_13 (D3) +#define P1_2 (1 << 11) // PE_11 (D5) +#define PORT_1 PortE + +#define P2_1 (1 << 15) // PF_15 (D2) +#define P2_2 (1 << 14) // PF_14 (D4) +#define PORT_2 PortF #elif defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32GG_STK3700) || defined(TARGET_EFM32WG_STK3800) #define P1_1 (1 << 0) // PD0 @@ -193,6 +211,8 @@ #define P2_2 (1 << 1) /*P5_1*/ #define PORT_2 Port5 +#else +#error [NOT_SUPPORTED] This test is not defined on this target #endif #define MASK_1 (P1_1 | P1_2) diff --git a/features/unsupported/tests/mbed/portout_portin/main.cpp b/features/unsupported/tests/mbed/portout_portin/main.cpp index b2336d0820..83b5d8ad58 100644 --- a/features/unsupported/tests/mbed/portout_portin/main.cpp +++ b/features/unsupported/tests/mbed/portout_portin/main.cpp @@ -121,14 +121,28 @@ defined(TARGET_NUCLEO_F411RE) || \ defined(TARGET_NUCLEO_L053R8) || \ defined(TARGET_NUCLEO_L073RZ) || \ + defined(TARGET_NUCLEO_L476RG) || \ + defined(TARGET_NUCLEO_F446RE) || \ defined(TARGET_NUCLEO_L152RE) -#define P1_1 (1 << 6) // PC_6 -#define P1_2 (1 << 5) // PC_5 -#define PORT_1 PortC +#define P1_1 (1 << 3) // PB_3 (D3) +#define P1_2 (1 << 10) // PB_10 (D6) +#define PORT_1 PortB -#define P2_1 (1 << 8) // PB_8 -#define P2_2 (1 << 9) // PB_9 -#define PORT_2 PortB +#define P2_1 (1 << 10) // PA_10 (D2) +#define P2_2 (1 << 8) // PA_8 (D7) +#define PORT_2 PortA + +#elif defined(TARGET_NUCLEO_F767ZI) || \ + defined(TARGET_NUCLEO_F303ZE) || \ + defined(TARGET_NUCLEO_F207ZG) || \ + defined(TARGET_NUCLEO_F746ZG) +#define P1_1 (1 << 13) // PE_13 (D3) +#define P1_2 (1 << 11) // PE_11 (D5) +#define PORT_1 PortE + +#define P2_1 (1 << 15) // PF_15 (D2) +#define P2_2 (1 << 14) // PF_14 (D4) +#define PORT_2 PortF #elif defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32GG_STK3700) || defined(TARGET_EFM32WG_STK3800) #define P1_1 (1 << 0) // PD0 @@ -212,7 +226,7 @@ #define PORT_2 Port5 #else -#error [NOT_SUPPORTED] This test is not supported on this target +#error [NOT_SUPPORTED] This test is not defined on this target #endif #define MASK_1 (P1_1 | P1_2)