If a target is restricted to single threaded mode, fail compilation of the test as not supported

pull/2006/head
Sam Grove 2016-06-24 16:08:59 -05:00
parent 6dd11c76e4
commit a30fac1e1e
17 changed files with 68 additions and 0 deletions

View File

@ -1,6 +1,10 @@
#include "mbed.h" #include "mbed.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
DigitalOut led1(LED1); DigitalOut led1(LED1);
DigitalOut led2(LED2); DigitalOut led2(LED2);

View File

@ -1,6 +1,10 @@
#include "mbed.h" #include "mbed.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
Queue<uint32_t, 5> queue; Queue<uint32_t, 5> queue;
DigitalOut myled(LED1); DigitalOut myled(LED1);

View File

@ -1,6 +1,10 @@
#include "mbed.h" #include "mbed.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
typedef struct { typedef struct {
float voltage; /* AD result of measured voltage */ float voltage; /* AD result of measured voltage */
float current; /* AD result of measured current */ float current; /* AD result of measured current */

View File

@ -1,6 +1,10 @@
#include "mbed.h" #include "mbed.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
osMutexId stdio_mutex; osMutexId stdio_mutex;
osMutexDef(stdio_mutex); osMutexDef(stdio_mutex);

View File

@ -1,6 +1,10 @@
#include "mbed.h" #include "mbed.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
typedef struct { typedef struct {
float voltage; /* AD result of measured voltage */ float voltage; /* AD result of measured voltage */
float current; /* AD result of measured current */ float current; /* AD result of measured current */

View File

@ -1,6 +1,10 @@
#include "mbed.h" #include "mbed.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
osSemaphoreId two_slots; osSemaphoreId two_slots;
osSemaphoreDef(two_slots); osSemaphoreDef(two_slots);

View File

@ -1,6 +1,10 @@
#include "mbed.h" #include "mbed.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
DigitalOut led(LED1); DigitalOut led(LED1);
void led_thread(void const *argument) { void led_thread(void const *argument) {

View File

@ -1,6 +1,10 @@
#include "mbed.h" #include "mbed.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
DigitalOut LEDs[4] = { DigitalOut LEDs[4] = {
DigitalOut(LED1), DigitalOut(LED2), DigitalOut(LED3), DigitalOut(LED4) DigitalOut(LED1), DigitalOut(LED2), DigitalOut(LED3), DigitalOut(LED4)
}; };

View File

@ -2,6 +2,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
/* /*
* The stack size is defined in cmsis_os.h mainly dependent on the underlying toolchain and * The stack size is defined in cmsis_os.h mainly dependent on the underlying toolchain and
* the C standard library. For GCC, ARM_STD and IAR it is defined with a size of 2048 bytes * the C standard library. For GCC, ARM_STD and IAR it is defined with a size of 2048 bytes

View File

@ -3,6 +3,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
DigitalOut led2(LED2); DigitalOut led2(LED2);
#define SIZE 100 #define SIZE 100

View File

@ -2,6 +2,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
#define QUEUE_SIZE 5 #define QUEUE_SIZE 5
#define THREAD_DELAY 250 #define THREAD_DELAY 250
#define QUEUE_PUT_ISR_VALUE 128 #define QUEUE_PUT_ISR_VALUE 128

View File

@ -2,6 +2,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
typedef struct { typedef struct {
float voltage; /* AD result of measured voltage */ float voltage; /* AD result of measured voltage */
float current; /* AD result of measured current */ float current; /* AD result of measured current */

View File

@ -2,6 +2,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
#define THREAD_DELAY 50 #define THREAD_DELAY 50
#define SIGNALS_TO_EMIT 100 #define SIGNALS_TO_EMIT 100

View File

@ -2,6 +2,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
typedef struct { typedef struct {
float voltage; /* AD result of measured voltage */ float voltage; /* AD result of measured voltage */
float current; /* AD result of measured current */ float current; /* AD result of measured current */

View File

@ -2,6 +2,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
#define THREAD_DELAY 75 #define THREAD_DELAY 75
#define SEMAPHORE_SLOTS 2 #define SEMAPHORE_SLOTS 2
#define SEM_CHANGES 100 #define SEM_CHANGES 100

View File

@ -2,6 +2,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
#define SIGNALS_TO_EMIT 100 #define SIGNALS_TO_EMIT 100
#define SIGNAL_HANDLE_DELEY 25 #define SIGNAL_HANDLE_DELEY 25
#define SIGNAL_SET_VALUE 0x01 #define SIGNAL_SET_VALUE 0x01

View File

@ -2,6 +2,10 @@
#include "test_env.h" #include "test_env.h"
#include "rtos.h" #include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
DigitalOut LEDs[4] = { DigitalOut LEDs[4] = {
DigitalOut(LED1), DigitalOut(LED2), DigitalOut(LED3), DigitalOut(LED4) DigitalOut(LED1), DigitalOut(LED2), DigitalOut(LED3), DigitalOut(LED4)
}; };