mirror of https://github.com/ARMmbed/mbed-os.git
Adding NOT_SUPPORTED errors to tests
parent
a6c986e60e
commit
9db9ede4a6
|
@ -1,3 +1,11 @@
|
||||||
|
#if !DEVICE_ANALOGIN
|
||||||
|
#error [NOT_SUPPORTED] AnalogIn not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !DEVICE_ANALOGOUT
|
||||||
|
#error [NOT_SUPPORTED] AnalogOut not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "test_env.h"
|
#include "test_env.h"
|
||||||
|
|
||||||
#if defined(TARGET_K64F) | defined (TARGET_K22F)
|
#if defined(TARGET_K64F) | defined (TARGET_K22F)
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_ANALOGIN
|
||||||
|
#error [NOT_SUPPORTED] AnalogIn not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
#include "test_env.h"
|
#include "test_env.h"
|
||||||
|
|
||||||
|
@ -15,11 +19,11 @@ int main(void) {
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
float val1, val2;
|
float val1, val2;
|
||||||
|
|
||||||
for (int i = 0; i < TEST_ITERATIONS; i++) {
|
for (int i = 0; i < TEST_ITERATIONS; i++) {
|
||||||
val1 = pot1.read();
|
val1 = pot1.read();
|
||||||
val2 = pot2.read();
|
val2 = pot2.read();
|
||||||
|
|
||||||
const char *succes_str = val1 > MEASURE_MIN || val2 > MEASURE_MIN ? "[OK]" : "[FAIL]";
|
const char *succes_str = val1 > MEASURE_MIN || val2 > MEASURE_MIN ? "[OK]" : "[FAIL]";
|
||||||
result = result || (val1 > MEASURE_MIN || val2 > MEASURE_MIN);
|
result = result || (val1 > MEASURE_MIN || val2 > MEASURE_MIN);
|
||||||
printf("Pot values %f, %f\r\n", val1, val2);
|
printf("Pot values %f, %f\r\n", val1, val2);
|
||||||
|
|
|
@ -13,23 +13,26 @@ BusOut bus2(PB03, PB22, PB02, PB23);
|
||||||
BusOut bus1(PA02, PA03, PA04, PA05, PA06, PA07, PA08, PA09, PA10, PA11, PA16, PA17);
|
BusOut bus1(PA02, PA03, PA04, PA05, PA06, PA07, PA08, PA09, PA10, PA11, PA16, PA17);
|
||||||
BusOut bus2(PB10, PB11, PB12, PB13);
|
BusOut bus2(PB10, PB11, PB12, PB13);
|
||||||
|
|
||||||
#else
|
#elif defined(TARGET_FF_ARDUINO)
|
||||||
BusOut bus1(D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15);
|
BusOut bus1(D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15);
|
||||||
BusOut bus2(A5, A4, A3, A2, A1, A0);
|
BusOut bus2(A5, A4, A3, A2, A1, A0);
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error [NOT_SUPPORTED] This test is not supported on this target
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
notify_start();
|
notify_start();
|
||||||
|
|
||||||
for (i=0; i<=65535; i++) {
|
for (i=0; i<=65535; i++) {
|
||||||
bus1 = i;
|
bus1 = i;
|
||||||
bus2 = i;
|
bus2 = i;
|
||||||
wait(0.0001);
|
wait(0.0001);
|
||||||
}
|
}
|
||||||
|
|
||||||
notify_completion(true);
|
notify_completion(true);
|
||||||
}
|
}
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_CAN
|
||||||
|
#error [NOT_SUPPORTED] CAN not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
Ticker ticker;
|
Ticker ticker;
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_CAN
|
||||||
|
#error [NOT_SUPPORTED] CAN not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
Ticker ticker;
|
Ticker ticker;
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_CAN
|
||||||
|
#error [NOT_SUPPORTED] CAN not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
#include "test_env.h"
|
#include "test_env.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_LOCALFILESYSTEM
|
||||||
|
#error [NOT_SUPPORTED] LocalFileSystem not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
void led_blink(PinName led) {
|
void led_blink(PinName led) {
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_LOCALFILESYSTEM
|
||||||
|
#error [NOT_SUPPORTED] LocalFileSystem not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
#include "TextLCD.h"
|
#include "TextLCD.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_I2C
|
||||||
|
#error [NOT_SUPPORTED] I2C is not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
#include "test_env.h"
|
#include "test_env.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_I2CSLAVE
|
||||||
|
#error [NOT_SUPPORTED] I2C Slave is not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
#include "test_env.h"
|
#include "test_env.h"
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#elif defined(TARGET_SAML21J18A)
|
#elif defined(TARGET_SAML21J18A)
|
||||||
#define TIMER_IRQ TC0_IRQn
|
#define TIMER_IRQ TC0_IRQn
|
||||||
#else
|
#else
|
||||||
#error This test can't run on this target.
|
#error [NOT_SUPPORTED] This test can't run on this target.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Serial pc(USBTX, USBRX);
|
Serial pc(USBTX, USBRX);
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_PORTOUT
|
||||||
|
#error [NOT_SUPPORTED] PortOut is not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
# if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC2460)
|
# if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC2460)
|
||||||
|
@ -27,8 +31,8 @@
|
||||||
# elif defined(TARGET_SAMR21G18A)
|
# elif defined(TARGET_SAMR21G18A)
|
||||||
# define LED_PORT PortA
|
# define LED_PORT PortA
|
||||||
# define LED1 (1 << 19) /*PA19*/
|
# define LED1 (1 << 19) /*PA19*/
|
||||||
# define LED2 0
|
# define LED2 0
|
||||||
# define LED3 0
|
# define LED3 0
|
||||||
# define LED4 0
|
# define LED4 0
|
||||||
# elif defined(TARGET_SAMD21J18A)
|
# elif defined(TARGET_SAMD21J18A)
|
||||||
# define LED_PORT PortB
|
# define LED_PORT PortB
|
||||||
|
@ -48,7 +52,9 @@
|
||||||
# define LED2 0
|
# define LED2 0
|
||||||
# define LED3 0
|
# define LED3 0
|
||||||
# define LED4 0
|
# define LED4 0
|
||||||
# endif
|
# else
|
||||||
|
#error [NOT_SUPPORTED] This test can't be ran on this target
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define LED_MASK (LED1|LED2|LED3|LED4)
|
#define LED_MASK (LED1|LED2|LED3|LED4)
|
||||||
|
|
|
@ -48,7 +48,7 @@ int main() {
|
||||||
printf("Initialize PWM on pin 24 with duty cycle: %.2f\n", pwm_dp24.read());
|
printf("Initialize PWM on pin 24 with duty cycle: %.2f\n", pwm_dp24.read());
|
||||||
printf("Initialize PWM on pin 18 with duty cycle: %.2f\n", pwm_dp18.read());
|
printf("Initialize PWM on pin 18 with duty cycle: %.2f\n", pwm_dp18.read());
|
||||||
|
|
||||||
#elif defined(TARGET_nRF51822)
|
#elif defined(TARGET_NRF51822)
|
||||||
PwmOut pwm_p24(p24);
|
PwmOut pwm_p24(p24);
|
||||||
PwmOut pwm_p25(p25);
|
PwmOut pwm_p25(p25);
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ int main() {
|
||||||
|
|
||||||
pwm_1.write(value);
|
pwm_1.write(value);
|
||||||
pwm_2.write(0.50);
|
pwm_2.write(0.50);
|
||||||
|
|
||||||
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
||||||
|
|
||||||
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
||||||
|
@ -111,7 +111,7 @@ int main() {
|
||||||
PwmOut pwm_1(PA_0);
|
PwmOut pwm_1(PA_0);
|
||||||
|
|
||||||
pwm_1.write(value);
|
pwm_1.write(value);
|
||||||
|
|
||||||
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
||||||
|
|
||||||
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
||||||
|
@ -121,7 +121,7 @@ int main() {
|
||||||
PwmOut pwm_1(PA_0);
|
PwmOut pwm_1(PA_0);
|
||||||
|
|
||||||
pwm_1.write(value);
|
pwm_1.write(value);
|
||||||
|
|
||||||
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
||||||
|
|
||||||
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
||||||
|
@ -131,7 +131,7 @@ int main() {
|
||||||
PwmOut pwm_1(PA_0);
|
PwmOut pwm_1(PA_0);
|
||||||
|
|
||||||
pwm_1.write(value);
|
pwm_1.write(value);
|
||||||
|
|
||||||
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
||||||
|
|
||||||
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
||||||
|
@ -141,7 +141,7 @@ int main() {
|
||||||
PwmOut pwm_1(PA_0);
|
PwmOut pwm_1(PA_0);
|
||||||
|
|
||||||
pwm_1.write(value);
|
pwm_1.write(value);
|
||||||
|
|
||||||
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
||||||
|
|
||||||
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
||||||
|
@ -151,7 +151,7 @@ int main() {
|
||||||
PwmOut pwm_1(PA_0);
|
PwmOut pwm_1(PA_0);
|
||||||
|
|
||||||
pwm_1.write(value);
|
pwm_1.write(value);
|
||||||
|
|
||||||
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
|
||||||
|
|
||||||
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
|
||||||
|
@ -177,7 +177,7 @@ int main() {
|
||||||
|
|
||||||
notify_completion(result == value ? true : false);
|
notify_completion(result == value ? true : false);
|
||||||
#else
|
#else
|
||||||
#error This test is not supported on this target.
|
#error [NOT_SUPPORTED] This test is not supported on this target.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
notify_completion(true);
|
notify_completion(true);
|
||||||
|
|
|
@ -26,14 +26,14 @@
|
||||||
#elif defined (TARGET_MAXWSNENV)
|
#elif defined (TARGET_MAXWSNENV)
|
||||||
#define TEST_LED LED_GREEN
|
#define TEST_LED LED_GREEN
|
||||||
|
|
||||||
#elif defined (TARGET_DISCO_F407VG)
|
#elif defined (TARGET_DISCO_F407VG)
|
||||||
#define TEST_LED LED1
|
#define TEST_LED LED1
|
||||||
|
|
||||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A) || defined(TARGET_SAML21J18A)
|
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A) || defined(TARGET_SAML21J18A)
|
||||||
#define TEST_LED LED1
|
#define TEST_LED LED1
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error This test is not supported on this target.
|
#error [NOT_SUPPORTED] This test is not supported on this target
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PwmOut led(TEST_LED);
|
PwmOut led(TEST_LED);
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_SEMIHOST
|
||||||
|
#error [NOT_SUPPORTED] Semihost not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
Serial pc(USBTX, USBRX);
|
Serial pc(USBTX, USBRX);
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
|
#if !DEVICE_SPI
|
||||||
|
#error [NOT_SUPPORTED] SPI is not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(TARGET_SAMR21G18A)
|
#if defined(TARGET_SAMR21G18A)
|
||||||
SPI spi(PB22, PB02, PB23); // mosi, miso, sclk
|
SPI spi(PB22, PB02, PB23); // mosi, miso, sclk
|
||||||
DigitalOut latchpin(PB03);
|
DigitalOut latchpin(PB03);
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_SPI
|
||||||
|
#error [NOT_SUPPORTED] SPI not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
#include "test_env.h"
|
#include "test_env.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_SPISLAVE
|
||||||
|
#error [NOT_SUPPORTED] SPI Slave not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
#if defined(TARGET_KL25Z)
|
#if defined(TARGET_KL25Z)
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#if !DEVICE_LOCALFILESYSTEM
|
||||||
|
#error [NOT_SUPPORTED] LocalFileSystem not supported
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
#define TEST_STDIO 0
|
#define TEST_STDIO 0
|
||||||
|
|
Loading…
Reference in New Issue