#pragma config OSC = INTIO67, FCMEN = OFF, IESO = OFF, PWRT = OFF, BOREN = SBORDIS, BORV = 3, WDT = OFF
#pragma config WDTPS = 32768, MODE = MC, ADDRBW = ADDR20BIT, DATABW = DATA16BIT, WAIT = OFF, CCP2MX = PORTC
#pragma config ECCPMX = PORTE, LPT1OSC = OFF, MCLRE = ON, STVREN = ON, LVP = OFF, BBSIZ = BB2K, XINST = OFF
#include <salvo.h>
#include "salvocfg.h"
#undef OSC
#include <p18f8722.h>
#include <stdio.h>
#include "portmap.h"
void Count_Task( void );
_OSLabel(Count_Task1)
_OSLabel(Display_Task1)
_OSLabel(delay1)
_OSLabel(delay2)
void main( void )
{
Init();
OSInit();
OSCreateTask(Count_Task, OSTCBP(1), 10);
while(1)
{
OSSched();
}
}
void Count_Task( void )
{
while(1)
{
LED1status = 1;
OSDelay(2, delay1);
LED1status = 0;
OSDelay(6, delay2);
OS_Yield(Count_Task1);
}
}
/************************************************************
Copyright (C) 1995-2002 Pumpkin, Inc. and its
Licensor(s). Freely distributable.
$Source: C:\\RCS\\d\\salvo\\tut\\tu3\\syse\\salvocfg.h,v $
$Author: aek $
$Revision: 3.6 $
$Date: 2003-07-30 17:31:30-07 $
Header file for tutorial programs.
************************************************************/
#if defined(MAKE_WITH_FREE_LIB)
/* */
/* Salvo Lite build */
/* */
#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSF
#define OSLIBRARY_GLOBALS OSF
#define OSLIBRARY_CONFIG OSM
#define OSEVENTS 0 /* multitasking only */
#define OSEVENT_FLAGS 0
#define OSMESSAGE_QUEUES 0
#define OSTASKS 2
#elif defined(MAKE_WITH_STD_LIB)
/* */
/* Salvo LE & Pro library build */
/* */
#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSL
#define OSLIBRARY_GLOBALS OSF
#define OSLIBRARY_CONFIG OSM
#define OSEVENTS 0 /* multitasking only */
#define OSEVENT_FLAGS 0
#define OSMESSAGE_QUEUES 0
#define OSTASKS 2
#elif defined(MAKE_WITH_SOURCE)
/* */
/* Salvo Pro source-code build */
/* */
#define OSEVENTS 0 /* multitasking only */
#define OSTASKS 2
#else
#error No MAKE_WITH_??? symbol defined. See salvocfg.h.
#endif
#if !defined(SYSE)
#error SYSE must be defined for this MPLAB-C18 tutorial project ...
#endif#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSF
#define OSLIBRARY_GLOBALS OSF
#define OSLIBRARY_CONFIG OSA // e.g. for sfc18sfa.lib
#define OSEVENTS 1
#define OSEVENT_FLAGS 0
#define OSMESSAGE_QUEUES 0
#define OSTASKS 2Users browsing this forum: No registered users and 1 guest