From 9129af503c8211d713c8a160a3b6f3f86b328639 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 2 Jan 2016 20:53:42 +0100 Subject: o Adding a utility to dump segment sizes from the generated ELF files. o Adding os2 with support for critical sections. More to come. o Adding dma1 to test DMA + SPI. --- os1.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'os1.cpp') diff --git a/os1.cpp b/os1.cpp index c2060ff..9c87a3d 100644 --- a/os1.cpp +++ b/os1.cpp @@ -122,9 +122,9 @@ void idle_task(const void *const) { } static -void create_thread(void (task)(void const *const), bool create_sw); +void os_create_thread(void (task)(void const *const), bool create_sw); -void osKernelInitialize() { +void os_init() { NVIC_SetPriority(SysTick_IRQn, 0xff); NVIC_SetPriority(PendSV_IRQn, 0xff); @@ -142,16 +142,16 @@ void osKernelInitialize() { tasks[i].flags = 0; } - create_thread(idle_task, false); + os_create_thread(idle_task, false); current_task = 0; } -void create_thread(void (task)(void const *const)) { - create_thread(task, true); +void os_create_thread(void (task)(void const *const)) { + os_create_thread(task, true); } static -void create_thread(void (task)(void const *const), bool create_sw) { +void os_create_thread(void (task)(void const *const), bool create_sw) { uint8_t *s = stacks[task_count] + stack_size; s -= sizeof(hardware_frame_t); @@ -224,7 +224,7 @@ volatile bool run; extern "C" void do_first_context_switch(uint8_t *user_stack, void (task)(const void *const arg)); -void osKernelStart() { +void os_start() { run = true; task_t &t = tasks[0]; @@ -276,10 +276,10 @@ int main(void) { init.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_8; GPIO_Init(GPIOB, &init); - osKernelInitialize(); - create_thread(job1); - create_thread(job2); - osKernelStart(); + os_init(); + os_create_thread(job1); + os_create_thread(job2); + os_start(); return 0; } -- cgit v1.2.3