All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
robotc_glue.c File Reference

Some glue functions to make porting ROBOTC coe easier. More...

#include "ch.h"
#include "hal.h"
#include "vex.h"
#include "robotc_glue.h"

Data Structures

struct  _rcTask
 Structure that correlates a function name with a thread. More...
 

Macros

#define RC_TASKS   10
 Maximum number of ROBOTC style tasks. More...
 
#define TC_THREAD_STACK   584
 Stack size for ROBOTC each thread also uses 176 bytes (0xB0) for thread overhead and 8 bytes for heap header. More...
 

Typedefs

typedef struct _rcTask rcTask
 Structure that correlates a function name with a thread. More...
 

Functions

Thread * StartTaskWithPriority (tfunc_t pf, tprio_t priority,...)
 Start a task with a given priority. More...
 
void StopTask (tfunc_t pf)
 Stop a task. More...
 
void CleanupTask (Thread *tp)
 cleanup a task if it was terminated elsewhere More...
 

Detailed Description

Some glue functions to make porting ROBOTC coe easier.

Macro Definition Documentation

#define RC_TASKS   10

Maximum number of ROBOTC style tasks.

#define TC_THREAD_STACK   584

Stack size for ROBOTC each thread also uses 176 bytes (0xB0) for thread overhead and 8 bytes for heap header.

Typedef Documentation

typedef struct _rcTask rcTask

Structure that correlates a function name with a thread.

Function Documentation

Thread* StartTaskWithPriority ( tfunc_t  pf,
tprio_t  priority,
  ... 
)

Start a task with a given priority.

Parameters
[in]pfThe thread function
[in]priorityThe thread priority
Returns
A pointer to the thread
void StopTask ( tfunc_t  pf)

Stop a task.

Parameters
[in]pfThe thread function
void CleanupTask ( Thread *  tp)

cleanup a task if it was terminated elsewhere

Parameters
[in]tpA pointer to a thread
Note
this will not usually be called by the user by by an internal thread