-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e66cb23
commit 4f5d2e5
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef __CC_OS__ | ||
#define __CC_OS__ | ||
|
||
#include "stdint.h" | ||
|
||
typedef enum cc_os_err | ||
{ | ||
CC_OS_SUCCESS, | ||
CC_OS_FAIL | ||
}cc_os_err_t; | ||
|
||
typedef void (* task_fn)(void * args); | ||
|
||
typedef struct cc_os_task | ||
{ | ||
task_fn task_fn; | ||
int8_t * i8_name; | ||
int8_t i8_priority; //>> For waited tasks | ||
int32_t * i32_stack_ptr; | ||
size_t s_stack_len; | ||
}cc_os_task_t; | ||
|
||
cc_os_err_t cc_os_add_task (cc_os_task_t * cc_os_task); | ||
cc_os_err_t cc_os_del_task (int8_t * i8_name); | ||
cc_os_err_t cc_os_pause_task (int8_t * i8_name); | ||
cc_os_err_t cc_os_resume_task (int8_t * i8_name); | ||
cc_os_err_t cc_os_wait_task (uint16_t ticks); | ||
cc_os_err_t cc_os_run (void); | ||
|
||
#endif /* __CC_OS__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include "stdint.h" | ||
|
||
typedef struct cc_shed_tcb cc_shed_tcb_t; | ||
|
||
typedef enum | ||
{ | ||
CC_SHED_TASK_READY, | ||
CC_SHED_TASK_RUNNING, | ||
CC_SHED_TASK_PAUSED, | ||
} cc_shed_task_status_t; | ||
|
||
struct cc_shed_tcb | ||
{ | ||
int8_t * i8_name; | ||
int8_t i8_priority; | ||
int32_t * i32_sp; | ||
cc_shed_tcb_t * next_shed_tcb; | ||
cc_shed_task_status_t task_status; | ||
}; |