Skip to content

Commit

Permalink
Merge pull request #1 from bridadan/add-circle-ci
Browse files Browse the repository at this point in the history
Add circle ci
  • Loading branch information
bridadan committed Apr 12, 2016
2 parents 4ae6b05 + 1add211 commit b91995c
Show file tree
Hide file tree
Showing 179 changed files with 10,058 additions and 7,795 deletions.
6 changes: 6 additions & 0 deletions TESTS/integration/basic/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "test_env.h"

int main() {
GREENTEA_SETUP(15, "default_auto");
GREENTEA_TESTSUITE_RESULT(true);
}
17 changes: 17 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
test:
override:
- cd ../testproject
- python ../neo/neo.py compile -m K64F -t GCC_ARM -j 0 --source=mbed-os\TESTS\integration\basic

dependencies:
pre:
- cd ../
- ls
- git clone https://github.com/ARMmbed/neo.git
- mkdir testproject
- mv mbed-os testproject
- cd testproject
- git init
- sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
- sudo apt-get update
- sudo apt-get install gcc-arm-embedded
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ void led2_thread(void const *argument) {
}

int main() {
MBED_HOSTTEST_TIMEOUT(15);
MBED_HOSTTEST_SELECT(wait_us_auto);
MBED_HOSTTEST_DESCRIPTION(Basic thread);
MBED_HOSTTEST_START("RTOS_1");
GREENTEA_SETUP(15, "wait_us_auto");

Thread thread(led2_thread, NULL, osPriorityNormal, STACK_SIZE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ void queue_thread(void const *argument) {
}

int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(ISR (Queue));
MBED_HOSTTEST_START("RTOS_8");
GREENTEA_SETUP(20, "default_auto");

Thread thread(queue_thread, NULL, osPriorityNormal, STACK_SIZE);
Ticker ticker;
Expand All @@ -66,6 +63,6 @@ int main (void) {
}
}

MBED_HOSTTEST_RESULT(result);
GREENTEA_TESTSUITE_RESULT(result);
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ void send_thread (void const *argument) {
}

int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(Mail messaging);
MBED_HOSTTEST_START("RTOS_6");
GREENTEA_SETUP(20, "default_auto");

Thread thread(send_thread, NULL, osPriorityNormal, STACK_SIZE);
bool result = true;
Expand All @@ -74,6 +71,6 @@ int main (void) {
}
}
}
MBED_HOSTTEST_RESULT(result);
GREENTEA_TESTSUITE_RESULT(result);
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ void test_thread(void const *args) {
}

int main() {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default);
MBED_HOSTTEST_DESCRIPTION(Mutex resource lock);
MBED_HOSTTEST_START("RTOS_2");

GREENTEA_SETUP(20, "default_auto");
const int t1_delay = THREAD_DELAY * 1;
const int t2_delay = THREAD_DELAY * 2;
const int t3_delay = THREAD_DELAY * 3;
Expand All @@ -96,6 +92,6 @@ int main() {
}

fflush(stdout);
MBED_HOSTTEST_RESULT(!mutex_defect);
GREENTEA_TESTSUITE_RESULT(!mutex_defect);
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ void send_thread (void const *argument) {
}

int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(Queue messaging);
MBED_HOSTTEST_START("RTOS_5");
GREENTEA_SETUP(20, "default_auto");

Thread thread(send_thread, NULL, osPriorityNormal, STACK_SIZE);
bool result = true;
Expand All @@ -76,6 +73,6 @@ int main (void) {
}
}
}
MBED_HOSTTEST_RESULT(result);
GREENTEA_TESTSUITE_RESULT(result);
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ void test_thread(void const *delay) {
}

int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(Semaphore resource lock);
MBED_HOSTTEST_START("RTOS_3");
GREENTEA_SETUP(20, "default_auto");

const int t1_delay = THREAD_DELAY * 1;
const int t2_delay = THREAD_DELAY * 2;
Expand All @@ -86,6 +83,6 @@ int main (void) {
}

fflush(stdout);
MBED_HOSTTEST_RESULT(!sem_defect);
GREENTEA_TESTSUITE_RESULT(!sem_defect);
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ void led_thread(void const *argument) {
}

int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(Signals messaging);
MBED_HOSTTEST_START("RTOS_4");
GREENTEA_SETUP(20, "default_auto");

Thread thread(led_thread, NULL, osPriorityNormal, STACK_SIZE);
bool result = true;
Expand All @@ -48,6 +45,6 @@ int main (void) {
break;
}
}
MBED_HOSTTEST_RESULT(result);
GREENTEA_TESTSUITE_RESULT(result);
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ void blink(void const *n) {
}

int main(void) {
MBED_HOSTTEST_TIMEOUT(15);
MBED_HOSTTEST_SELECT(wait_us_auto);
MBED_HOSTTEST_DESCRIPTION(Timer);
MBED_HOSTTEST_START("RTOS_7");
GREENTEA_SETUP(15, "wait_us_auto");

RtosTimer led_1_timer(blink, osTimerPeriodic, (void *)0);
RtosTimer led_2_timer(blink, osTimerPeriodic, (void *)1);
Expand Down
2 changes: 1 addition & 1 deletion core/mbed-rtos/rtos/Mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Mutex {
osMutexId _osMutexId;
osMutexDef_t _osMutexDef;
#ifdef CMSIS_OS_RTX
#if defined(__MBED_CMSIS_RTOS_CA9) || defined(__MBED_CMSIS_RTOS_CM)
#ifdef __MBED_CMSIS_RTOS_CA9
int32_t _mutex_data[4];
#else
int32_t _mutex_data[3];
Expand Down
4 changes: 1 addition & 3 deletions core/mbed-rtos/rtos/RtosTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ class RtosTimer {
private:
osTimerId _timer_id;
osTimerDef_t _timer;
#if defined(CMSIS_OS_RTX) && !defined(__MBED_CMSIS_RTOS_CM)
#ifdef CMSIS_OS_RTX
uint32_t _timer_data[5];
#else
uint32_t _timer_data[6];
#endif
};

Expand Down
24 changes: 2 additions & 22 deletions core/mbed-rtos/rtos/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace rtos {

Thread::Thread(void (*task)(void const *argument), void *argument,
osPriority priority, uint32_t stack_size, unsigned char *stack_pointer) {
#ifdef __MBED_CMSIS_RTOS_CM
#ifdef CMSIS_OS_RTX
_thread_def.pthread = task;
_thread_def.tpriority = priority;
_thread_def.stacksize = stack_size;
Expand Down Expand Up @@ -71,10 +71,8 @@ int32_t Thread::signal_clr(int32_t signals) {
}

Thread::State Thread::get_state() {
#if !defined(__MBED_CMSIS_RTOS_CA9) && !defined(__MBED_CMSIS_RTOS_CM)
#ifdef CMSIS_OS_RTX
#ifndef __MBED_CMSIS_RTOS_CA9
return ((State)_thread_def.tcb.state);
#endif
#else
uint8_t status;
status = osThreadGetState(_tid);
Expand All @@ -84,55 +82,39 @@ Thread::State Thread::get_state() {

uint32_t Thread::stack_size() {
#ifndef __MBED_CMSIS_RTOS_CA9
#if defined(CMSIS_OS_RTX) && !defined(__MBED_CMSIS_RTOS_CM)
return _thread_def.tcb.priv_stack;
#else
return 0;
#endif
#else
return 0;
#endif
}

uint32_t Thread::free_stack() {
#ifndef __MBED_CMSIS_RTOS_CA9
#if defined(CMSIS_OS_RTX) && !defined(__MBED_CMSIS_RTOS_CM)
uint32_t bottom = (uint32_t)_thread_def.tcb.stack;
return _thread_def.tcb.tsk_stack - bottom;
#else
return 0;
#endif
#else
return 0;
#endif
}

uint32_t Thread::used_stack() {
#ifndef __MBED_CMSIS_RTOS_CA9
#if defined(CMSIS_OS_RTX) && !defined(__MBED_CMSIS_RTOS_CM)
uint32_t top = (uint32_t)_thread_def.tcb.stack + _thread_def.tcb.priv_stack;
return top - _thread_def.tcb.tsk_stack;
#else
return 0;
#endif
#else
return 0;
#endif
}

uint32_t Thread::max_stack() {
#ifndef __MBED_CMSIS_RTOS_CA9
#if defined(CMSIS_OS_RTX) && !defined(__MBED_CMSIS_RTOS_CM)
uint32_t high_mark = 0;
while (_thread_def.tcb.stack[high_mark] == 0xE25A2EA5)
high_mark++;
return _thread_def.tcb.priv_stack - (high_mark * 4);
#else
return 0;
#endif
#else
return 0;
#endif
}

osEvent Thread::signal_wait(int32_t signals, uint32_t millisec) {
Expand All @@ -157,11 +139,9 @@ void Thread::attach_idle_hook(void (*fptr)(void)) {

Thread::~Thread() {
terminate();
#ifdef __MBED_CMSIS_RTOS_CM
if (_dynamic_stack) {
delete[] (_thread_def.stack_pointer);
}
#endif
}

}
Loading

0 comments on commit b91995c

Please sign in to comment.