BRISCITS  0.1
RISC "Real-Time" Scheduler
BRISC Thread API

Thread Control Group.

b_thread_create()

b_thread_start()

b_thread_stop()

b_thread_lock()

b_thread_unlock()

b_thread_yield()

Thread State Group

b_thread_current()

b_thread_systick()

Example Usage:

#define STACK_BYTES (1024)
#define STACK_WORDS STACK_BYTES / sizeof(cpu_reg_t)
static cpu_reg_t red_stack [ STACK_WORDS ];
static cpu_reg_t green_stack [ STACK_WORDS ];
static cpu_reg_t blue_stack [ STACK_WORDS ];
static int red_thread_handle = (-1);
static int green_thread_handle = (-1);
static int blue_thread_handle = (-1);
static int main_thread_handle = (-1);
....
....
int main( void )
{
....
....
if ( (main_thread_handle = b_thread_init( "main" )) >= 0 )
{
if ( (red_thread_handle = b_thread_create( "red", run_red, &delay, red_stack, STACK_WORDS )) >= 0)
{
if ( (green_thread_handle = b_thread_create( "green", run_green, &delay, green_stack, STACK_WORDS )) >= 0)
{
if ( (blue_thread_handle = b_thread_create( "blue", run_blue, &delay, blue_stack, STACK_WORDS )) >= 0)
{
b_thread_start( red_thread_handle );
b_thread_start( blue_thread_handle );
b_thread_start( green_thread_handle );
run_main( &delay );
}
}
}
}
....
....
}