Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 4 months ago.
What's different from Keil RTX and mbed RTOS?
I found RL-ARM Users' Guide and RL-ARM Getting Started Guide and examples from Keil's website.
So far I can find one sample project for mbed-rtos.
main.cpp
#include "mbed.h"
#include "rtos.h"
DigitalOut led1(LED1);
InterruptIn sw2(USER_BUTTON);
uint32_t button_pressed;
Thread *thread2;
void sw2_press(void)
{
thread2->signal_set(0x1);
}
void led_thread(void const *argument)
{
while (true) {
led1 = !led1;
Thread::wait(1000);
}
}
void button_thread(void const *argument)
{
while (true) {
Thread::signal_wait(0x1);
button_pressed++;
}
}
int main()
{
Thread thread(led_thread);
thread2 = new Thread(button_thread);
button_pressed = 0;
sw2.fall(&sw2_press);
while (true) {
Thread::wait(5000);
printf("SW2 was pressed (last 5 seconds): %d \n", button_pressed);
fflush(stdout);
button_pressed = 0;
}
}
But what's different from RTX and mbed RTOS? It seems Keil RTX and mbed RTOS are using different API.
- task vs Thread
- event vs signal
- more
I am still looking for sample projects to support the rest of features of RTOS, including:
- Semaphone
- Event
- Mailbox
- Mutex
Is there any official documentations about it?
Question relating to:
2 Answers
10 years, 4 months ago.
Here is the documentation: https://developer.mbed.org/handbook/RTOS
Apparantly mbed-os is going to replace it :( (Sad because I believe mbed OS is way larger than RTOS). RTX and mbed-rtos are identical, as in mbed-rtos is only a shell around RTX.