SEU_G10
/
rtos_3_same
rtos32
Fork of rtos_3_same by
Revision 7:a7e4b9c130de, committed 2015-11-13
- Comitter:
- xiscosc
- Date:
- Fri Nov 13 14:42:40 2015 +0000
- Parent:
- 6:209f4db62daf
- Commit message:
- rtos32
Changed in this revision
diff -r 209f4db62daf -r a7e4b9c130de main.cpp --- a/main.cpp Tue Jun 04 16:01:32 2013 +0100 +++ b/main.cpp Fri Nov 13 14:42:40 2015 +0000 @@ -1,21 +1,36 @@ #include "mbed.h" #include "rtos.h" - DigitalOut led1(LED1); DigitalOut led2(LED2); - -void led2_thread(void const *args) { +double status; +Timer t; +int tim; +bool b; + +void thread1(void const *args) { + int aux = (t.read_us() - tim); + printf("The time taken was %d US_SECONDS (CON LA MISMA PRIORIDAD) \r\n", aux); + t.reset(); while (true) { - led2 = !led2; - Thread::wait(1000); + + led1 = !led1; + for(double i=0; i<100000; i++) { + status = i; + } + led1 = !led1; + Thread::wait(300); + } } + + +int main() { + led1 = false; + led2 = false; + b = true; + Thread my_thread1(thread1); + t.reset(); + t.start(); + while (true) { + tim = t.read_us(); + } } - -int main() { - Thread thread(led2_thread); - - while (true) { - led1 = !led1; - Thread::wait(500); - } -}
diff -r 209f4db62daf -r a7e4b9c130de mbed-rtos.lib --- a/mbed-rtos.lib Tue Jun 04 16:01:32 2013 +0100 +++ b/mbed-rtos.lib Fri Nov 13 14:42:40 2015 +0000 @@ -1,1 +1,1 @@ -https://mbed.org/users/mbed_official/code/mbed-rtos/ \ No newline at end of file +https://mbed.org/users/mbed_official/code/mbed-rtos/#6d90423c236e
diff -r 209f4db62daf -r a7e4b9c130de mbed.bld --- a/mbed.bld Tue Jun 04 16:01:32 2013 +0100 +++ b/mbed.bld Fri Nov 13 14:42:40 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/ \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file