chap14/esos_skel.c File Reference

#include "esos.h"
#include "esos_pic24.h"
#include "esos_pic24_rs232.h"

Go to the source code of this file.

Functions

 ESOS_USER_TASK (heartbeat_LED)
 ESOS_USER_TASK (upper_case)
void user_init (void)


Detailed Description

ESOS application program similar to the "Echo" program echo.c in Chapter 8. (See Figure 8.6 in the text.) This version of "echo" program which waits for UART1 RX character and echos it back to UART1 TX with all lowercase letters converted to uppercase. Use this program to test your UART connection under ESOS

Application also has a flashing LED on RB15. Flashing LED is generated by an user task that runs simultaneously with the echo task above.

Note:
Demonstrates multitasking in ESOS

Definition in file esos_skel.c.


Function Documentation

ESOS_USER_TASK ( upper_case   ) 

Read a single character from the "in" stream, convert lowercase letters to uppercase, and send those chars back out the "out" stream

Definition at line 137 of file esos_skel.c.

ESOS_USER_TASK ( heartbeat_LED   ) 

An ESOS task to mimic the heartbeat LED found in the PIC24 support library code used in Chapters 8-13.

Toggle LED1, wait 250ms, repeat forever.

Note:
Since this heartbeat is performed in an ESOS task, a flashing LED indicates that the ESOS scheduler is still running properly. If the LED quits flashing, the ESOS scheduler is no longer rotating through the runnable task list. The most likely reason is that some task has ceased "yielding" the processor, and is caught in some deadlock or otherwise infinite loop.

Definition at line 118 of file esos_skel.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 159 of file esos_skel.c.


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