diff --git a/libraries/tests/mbed/analog/main.cpp b/libraries/tests/mbed/analog/main.cpp index 8d5316bbe7..87afea9aad 100644 --- a/libraries/tests/mbed/analog/main.cpp +++ b/libraries/tests/mbed/analog/main.cpp @@ -1,3 +1,5 @@ +#include "test_env.h" + #if !DEVICE_ANALOGIN #error [NOT_SUPPORTED] AnalogIn not supported #endif @@ -6,8 +8,6 @@ #error [NOT_SUPPORTED] AnalogOut not supported #endif -#include "test_env.h" - #if defined(TARGET_K64F) | defined (TARGET_K22F) AnalogIn in(A0); AnalogOut out(DAC0_OUT); diff --git a/libraries/tests/mbed/analog_pot/main.cpp b/libraries/tests/mbed/analog_pot/main.cpp index 2b141cd45e..3aed8ed1b4 100644 --- a/libraries/tests/mbed/analog_pot/main.cpp +++ b/libraries/tests/mbed/analog_pot/main.cpp @@ -1,10 +1,10 @@ +#include "mbed.h" +#include "test_env.h" + #if !DEVICE_ANALOGIN #error [NOT_SUPPORTED] AnalogIn not supported #endif -#include "mbed.h" -#include "test_env.h" - AnalogIn pot1(A0); AnalogIn pot2(A1); diff --git a/libraries/tests/mbed/can/main.cpp b/libraries/tests/mbed/can/main.cpp index 2fd716d106..4c771fa1a1 100644 --- a/libraries/tests/mbed/can/main.cpp +++ b/libraries/tests/mbed/can/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_CAN #error [NOT_SUPPORTED] CAN not supported #endif -#include "mbed.h" - Ticker ticker; DigitalOut led1(LED1); DigitalOut led2(LED2); diff --git a/libraries/tests/mbed/can_interrupt/main.cpp b/libraries/tests/mbed/can_interrupt/main.cpp index 7356bece14..e95dfbdc5c 100644 --- a/libraries/tests/mbed/can_interrupt/main.cpp +++ b/libraries/tests/mbed/can_interrupt/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_CAN #error [NOT_SUPPORTED] CAN not supported #endif -#include "mbed.h" - Ticker ticker; DigitalOut led1(LED1); DigitalOut led2(LED2); diff --git a/libraries/tests/mbed/can_loopback/main.cpp b/libraries/tests/mbed/can_loopback/main.cpp index 90664ec57b..062c2ec4ae 100644 --- a/libraries/tests/mbed/can_loopback/main.cpp +++ b/libraries/tests/mbed/can_loopback/main.cpp @@ -1,10 +1,10 @@ +#include "mbed.h" +#include "test_env.h" + #if !DEVICE_CAN #error [NOT_SUPPORTED] CAN not supported #endif -#include "mbed.h" -#include "test_env.h" - #if defined(TARGET_LPC1549) CAN can1(D9, D8); #elif defined(TARGET_LPC1768) || defined(TARGET_LPC4088) diff --git a/libraries/tests/mbed/dir/main.cpp b/libraries/tests/mbed/dir/main.cpp index 500de36e9f..bb664996d2 100644 --- a/libraries/tests/mbed/dir/main.cpp +++ b/libraries/tests/mbed/dir/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_LOCALFILESYSTEM #error [NOT_SUPPORTED] LocalFileSystem not supported #endif -#include "mbed.h" - void led_blink(PinName led) { DigitalOut myled(led); while (1) { diff --git a/libraries/tests/mbed/freopen/main.cpp b/libraries/tests/mbed/freopen/main.cpp index 3436b54482..6cb5994d83 100644 --- a/libraries/tests/mbed/freopen/main.cpp +++ b/libraries/tests/mbed/freopen/main.cpp @@ -1,8 +1,9 @@ +#include "mbed.h" + #if !DEVICE_LOCALFILESYSTEM #error [NOT_SUPPORTED] LocalFileSystem not supported #endif -#include "mbed.h" #include "TextLCD.h" int main() { diff --git a/libraries/tests/mbed/i2c_master/main.cpp b/libraries/tests/mbed/i2c_master/main.cpp index 67f23acb2c..d0902b739e 100644 --- a/libraries/tests/mbed/i2c_master/main.cpp +++ b/libraries/tests/mbed/i2c_master/main.cpp @@ -1,10 +1,10 @@ +#include "mbed.h" +#include "test_env.h" + #if !DEVICE_I2C #error [NOT_SUPPORTED] I2C is not supported #endif -#include "mbed.h" -#include "test_env.h" - #define SIZE (10) #define ADDR (0x90) diff --git a/libraries/tests/mbed/i2c_slave/main.cpp b/libraries/tests/mbed/i2c_slave/main.cpp index 7b168b7dde..922c13738e 100644 --- a/libraries/tests/mbed/i2c_slave/main.cpp +++ b/libraries/tests/mbed/i2c_slave/main.cpp @@ -1,10 +1,10 @@ +#include "mbed.h" +#include "test_env.h" + #if !DEVICE_I2CSLAVE #error [NOT_SUPPORTED] I2C Slave is not supported #endif -#include "mbed.h" -#include "test_env.h" - #define SIZE (10) #define ADDR (0x90) diff --git a/libraries/tests/mbed/interruptin/main.cpp b/libraries/tests/mbed/interruptin/main.cpp index dfe783b6ce..5a212cdd96 100644 --- a/libraries/tests/mbed/interruptin/main.cpp +++ b/libraries/tests/mbed/interruptin/main.cpp @@ -1,9 +1,9 @@ +#include "test_env.h" + #if !DEVICE_INTERRUPTIN #error [NOT_SUPPORTED] InterruptIn is not supported #endif -#include "test_env.h" - DigitalOut myled(LED1); DigitalOut led2(LED2); diff --git a/libraries/tests/mbed/interruptin_2/main.cpp b/libraries/tests/mbed/interruptin_2/main.cpp index 84d31751ef..d62519bac4 100644 --- a/libraries/tests/mbed/interruptin_2/main.cpp +++ b/libraries/tests/mbed/interruptin_2/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_INTERRUPTIN #error [NOT_SUPPORTED] InterruptIn is not supported #endif -#include "mbed.h" - #if defined(TARGET_LPC4088) InterruptIn button(p18); InterruptIn button1(p17); diff --git a/libraries/tests/mbed/portout/main.cpp b/libraries/tests/mbed/portout/main.cpp index dbf1f78d23..74bbb5a53b 100644 --- a/libraries/tests/mbed/portout/main.cpp +++ b/libraries/tests/mbed/portout/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_PORTOUT #error [NOT_SUPPORTED] PortOut is not supported #endif -#include "mbed.h" - # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC2460) # define LED_PORT Port1 # define LED1 (1 << 18) // P1.18 diff --git a/libraries/tests/mbed/portout_portin/main.cpp b/libraries/tests/mbed/portout_portin/main.cpp index 95fdb1bbd0..3f6428bdec 100644 --- a/libraries/tests/mbed/portout_portin/main.cpp +++ b/libraries/tests/mbed/portout_portin/main.cpp @@ -1,3 +1,5 @@ +#include "test_env.h" + #if !DEVICE_PORTIN #error [NOT_SUPPORTED] PortIn is not supported #endif @@ -6,8 +8,6 @@ #error [NOT_SUPPORTED] PortOut is not supported #endif -#include "test_env.h" - #if defined(TARGET_K64F) || defined(TARGET_KL05Z) #define P1_1 (1 << 16) #define P1_2 (1 << 17) diff --git a/libraries/tests/mbed/reset/main.cpp b/libraries/tests/mbed/reset/main.cpp index 36a643e31d..8891e51e59 100644 --- a/libraries/tests/mbed/reset/main.cpp +++ b/libraries/tests/mbed/reset/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_SEMIHOST #error [NOT_SUPPORTED] Semihost not supported #endif -#include "mbed.h" - Serial pc(USBTX, USBRX); extern "C" void mbed_reset(); diff --git a/libraries/tests/mbed/rtc/main.cpp b/libraries/tests/mbed/rtc/main.cpp index 8185fb1224..50168b1850 100644 --- a/libraries/tests/mbed/rtc/main.cpp +++ b/libraries/tests/mbed/rtc/main.cpp @@ -1,10 +1,10 @@ +#include "mbed.h" +#include "test_env.h" + #if !DEVICE_RTC #error [NOT_SUPPORTED] RTC is not supported #endif -#include "mbed.h" -#include "test_env.h" - #define CUSTOM_TIME 1256729737 int main() { diff --git a/libraries/tests/mbed/sleep/main.cpp b/libraries/tests/mbed/sleep/main.cpp index bde55d41aa..d77923a9f4 100644 --- a/libraries/tests/mbed/sleep/main.cpp +++ b/libraries/tests/mbed/sleep/main.cpp @@ -1,9 +1,9 @@ +#include "test_env.h" + #if !DEVICE_SLEEP #error [NOT_SUPPORTED] Sleep is not supported #endif -#include "test_env.h" - #if defined(TARGET_LPC4088) InterruptIn wkp(P2_10); #elif defined(TARGET_K22F) diff --git a/libraries/tests/mbed/sleep_timeout/main.cpp b/libraries/tests/mbed/sleep_timeout/main.cpp index 02f8975a52..440cdde6f7 100644 --- a/libraries/tests/mbed/sleep_timeout/main.cpp +++ b/libraries/tests/mbed/sleep_timeout/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_SLEEP #error [NOT_SUPPORTED] Sleep is not supported #endif -#include "mbed.h" - DigitalOut led1(LED1); DigitalOut led2(LED2); Timeout to1; diff --git a/libraries/tests/mbed/spi_master/main.cpp b/libraries/tests/mbed/spi_master/main.cpp index 821cbd2f9a..1db0424aee 100644 --- a/libraries/tests/mbed/spi_master/main.cpp +++ b/libraries/tests/mbed/spi_master/main.cpp @@ -1,10 +1,10 @@ +#include "mbed.h" +#include "test_env.h" + #if !DEVICE_SPI #error [NOT_SUPPORTED] SPI not supported #endif -#include "mbed.h" -#include "test_env.h" - #if defined(TARGET_KL25Z) SPI spi(PTD2, PTD3, PTD1); // mosi, miso, sclk DigitalOut cs(PTA13); diff --git a/libraries/tests/mbed/spi_slave/main.cpp b/libraries/tests/mbed/spi_slave/main.cpp index b676e29020..23ce4e6056 100644 --- a/libraries/tests/mbed/spi_slave/main.cpp +++ b/libraries/tests/mbed/spi_slave/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_SPISLAVE #error [NOT_SUPPORTED] SPI Slave not supported #endif -#include "mbed.h" - #if defined(TARGET_KL25Z) SPISlave device(PTD2, PTD3, PTD1, PTD0); // mosi, miso, sclk, ssel #elif defined(TARGET_nRF51822) diff --git a/libraries/tests/mbed/stdio_benchmark/main.cpp b/libraries/tests/mbed/stdio_benchmark/main.cpp index 4d4eaef31b..5658d3275d 100644 --- a/libraries/tests/mbed/stdio_benchmark/main.cpp +++ b/libraries/tests/mbed/stdio_benchmark/main.cpp @@ -1,9 +1,9 @@ +#include "mbed.h" + #if !DEVICE_LOCALFILESYSTEM #error [NOT_SUPPORTED] LocalFileSystem not supported #endif -#include "mbed.h" - #define TEST_STDIO 0 int main() {