?? main.c
字號:
/*******************************************************************************
* Module : main.c
*
* Purpose : First bit of 'C' code that executes after startup (see boot.asm).
; Starts up the operating system, uC/OS.
*
* Language : 'c'
*
* Written : Kirby W. Cartwright, The Vanner Power Group, 06/29/98
*
* Modified :
*
* Project : Vanner Power Group Modular Controller Project PX-02.
*
* Copyright : (C) copyright 1998 by Vanner, Inc. All Rights Reserved.
*
* Notes :
*
* Unit Tested:
*
*******************************************************************************/
#define LEDS 0x000C /* LEDs Register */
#include <ioports.h>
#include <time.h>
#include "includes.h"
extern void KickDog(void);
OS_STK_TYPE TimeOfDayStk[OS_TASK_IDLE_STK_SIZE];
static void TimeOfDayTask(void *);
/*******************************************************************************
*
* Routine : main
*
* Purpose : Initialize further hardware, start multitasking.
*
* Inputs : None (void).
*
* Globals : None.
*
* Outputs (Returns):
* None (void).
*
* Note(s) :
*
*******************************************************************************/
void main(void)
{
int i;
extern void ConfigureWatchDog(void);
ConfigureWatchDog();
OSInit();
OSTaskCreate(TimeOfDayTask,(void *)&i,(void *)&TimeOfDayStk[OS_TASK_IDLE_STK_TOP], 62);
OSStart(); /* Start multitasking */
}
/*******************************************************************************
*
* Routine : void abort(void)
*
* Purpose : Satisfy a link requirement.
*
* Inputs : None (void).
*
* Globals : None.
*
* Outputs (Returns):
* None (void).
*
* Note(s) : Should never get here. Should add code to annunciate if we
* ever do.
*
*******************************************************************************/
void abort(void)
{
while (1);
}
/*******************************************************************************
*
* Routine : void interrupt DefaultISR(void)
*
* Purpose : Supply a default ISR for unused vectors.
*
* Inputs : None (void).
*
* Globals : None.
*
* Outputs (Returns):
* None (void).
*
* Note(s) : Should add code to annunciate if we ever get here.
*
*******************************************************************************/
void interrupt DefaultISR(void)
{
}
/*******************************************************************************
*
* Task : void TimeOfDayTask(void *j);
*
* Purpose : Time of day task.
*
* Inputs : Pointer to context? Pointer to time/date structure.
*
* Globals : None.
*
* Outputs (Returns):
* None (void). Should never return.
*
* Note(s) : Should add code to go update global time and date structures.
* Y2K compliant.
* Should add code to initialize from hardware RTC on power-up.
* The actual interrupt rate is 15625/256=61.03515625 Hz.
*
*******************************************************************************/
void TimeOfDayTask(void *j)
{
volatile UBYTE LEDTick=0;
while (1)
{
outport(0x000C,LEDTick++);
KickDog();
OSTimeDly(31);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -