robotics/examples/serial_comm/esos_comm_example.c File Reference

#include "esos_comm_example_config.h"

Go to the source code of this file.

Functions

static ESOS_USER_TASK (heartbeat)
static ESOS_USER_TASK (hello)
void divvy_packet (void)
void user_init (void)


Detailed Description

Author:
Thomas Donaldson
This file contains example code for the ESOS comm library. See this file's divvy_packet().

Definition in file esos_comm_example.c.


Function Documentation

void divvy_packet ( void   ) 

This function demonstrates the use of the comm library's various get and put functions. It reads in the all the possible variables, increments them, and echos them back (prepending an error byte). For example, sending (alignment is for better representation):

 0x55 AA    11 22 3333 4444 55555555 66666666 AA 55 
will return:
 0x66 BB 00 12 23 3433 4544 56555555 67666666 BB 66 

Definition at line 44 of file esos_comm_example.c.

static ESOS_USER_TASK ( hello   )  [static]

Precondition:
This function must be registered with ESOS in user_init()
This task runs once and prints a string.

Definition at line 29 of file esos_comm_example.c.

static ESOS_USER_TASK ( heartbeat   )  [static]

Precondition:
This function must be registered with ESOS in user_init()
This task flashes the heartbeat LED (HEARTBEAT) at a rate specified by HALF_HEARTBEAT_PERIOD (in ms).

Definition at line 16 of file esos_comm_example.c.

void user_init ( void   ) 

User-provided function to initialize user's hardware configuration register user tasks.

Note:
All ESOS applications MUST provide this function.

This function MUST register at least one ESOS task.

user_init() is a centralized initialization routine where the user can setup their application. It is called automagically by ES_OS during the operating system initialization.

User should set up any state machines and init all application variables. They can also turn on any needed peripherals here.

User shall not mess with the interrupt hardware directly!!! The ESOS must be aware of the interrupts and provides esos_XXXXXXX functions for the user to use. Using these ESOS-provided functions, the user may (and probably should) initialize, register, and enable interrupts in this routine.

Furthermore, the user should register AT LEAST one user application task here via esos_RegisterTask or the ES_OS scheduler will have nothing to schedule to run when this function returns.

Definition at line 89 of file esos_comm_example.c.


Generated on Sun Mar 15 11:14:22 2009 for PIC24 Support Libraries by  doxygen 1.5.8