Skip to content

Commit

Permalink
CC_OS prototype commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjalchanda08 authored and akashkollipara committed Jan 13, 2022
1 parent e66cb23 commit 4f5d2e5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/include/visor/terravisor/cc_os/cc_os.h
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__ */
21 changes: 21 additions & 0 deletions src/include/visor/terravisor/cc_os/cc_shed.h
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;
};

0 comments on commit 4f5d2e5

Please sign in to comment.