gorkin
Advanced Member level 1
PaulOS for 8051
Hello brothers!
I´ve found this "cooperative rtos" in schultz 8051 book website: http://www.candthe8051.com/CRTOS_V2.h
I try evaluate it, but I not have any sucess, see above my implemantation in Keil IDE, my uC is: AT89C8051RD2 with 64kB Flash and 2kB RAM.
Like above, my implementation are very simple. I have four task´s and I can see the counter variables counting at interval specified by the task switch.
In main function, I initializate the rtos and all tasks, after I entered in infinite loop...but when I try simulate, only and only task0 run...What happens?
void task0 (void)
{
static unsigned long int _i0_ = 0;
for(;
{
_i0_++;
}
}
void task1 (void)
{
static unsigned long int _i1_ = 0;
for(;
{
_i1_++;
}
}
void task2 (void)
{
static unsigned long int _i2_ = 0;
for(;
{
_i2_++;
}
}
void task3 (void)
{
static unsigned long int _i3_ = 0;
for(;
{
_i3_++;
}
}
void main (void)
{
static unsigned char CurrentTask;
INIT_RTOS(0);
CREATE(0, task0);
CREATE(1, task1);
CREATE(2, task2);
CREATE(3, task3);
RTOSGO(0);
for(;
{
CurrentTask = RUNNING_TASK_ID();
}
}
Hello brothers!
I´ve found this "cooperative rtos" in schultz 8051 book website: http://www.candthe8051.com/CRTOS_V2.h
I try evaluate it, but I not have any sucess, see above my implemantation in Keil IDE, my uC is: AT89C8051RD2 with 64kB Flash and 2kB RAM.
Like above, my implementation are very simple. I have four task´s and I can see the counter variables counting at interval specified by the task switch.
In main function, I initializate the rtos and all tasks, after I entered in infinite loop...but when I try simulate, only and only task0 run...What happens?
void task0 (void)
{
static unsigned long int _i0_ = 0;
for(;
{
_i0_++;
}
}
void task1 (void)
{
static unsigned long int _i1_ = 0;
for(;
{
_i1_++;
}
}
void task2 (void)
{
static unsigned long int _i2_ = 0;
for(;
{
_i2_++;
}
}
void task3 (void)
{
static unsigned long int _i3_ = 0;
for(;
{
_i3_++;
}
}
void main (void)
{
static unsigned char CurrentTask;
INIT_RTOS(0);
CREATE(0, task0);
CREATE(1, task1);
CREATE(2, task2);
CREATE(3, task3);
RTOSGO(0);
for(;
{
CurrentTask = RUNNING_TASK_ID();
}
}