📄 cinit.c
字号:
/**************************************************************************
*
* ARM - Strategic Support Group
*
***************************************************************************/
/***************************************************************************
*
* Module : cinit.c
* Description : The C Initializer is designed to initialize the interrupts
* and set off task A.
*
* Tool Chain : ARM Developers Suite 1.0
* Platform : Evaluator7T
* History :
*
* 990929 ASloss
* - started working on cinit.c for AEB-1
*
* 2000-03-26 Andrew N. Sloss
* - ported to Evaluator7T
*
**************************************************************************/
/**************************************************************************
* IMPORTS
**************************************************************************/
#include <stdio.h>
#include <assert.h>
#include <time.h>
#include "taska.h"
#include "led.h"
#include "timer.h"
#include "irq.h"
/**************************************************************************
* MACROS
**************************************************************************/
#define angel_SWI 0x123456
/**************************************************************************
* MISC
**************************************************************************/
// -- angle SWI Note: remove if program is for standalone mode....
__swi (angel_SWI) void _WriteC(unsigned op, const char *c);
#define WriteC(c) _WriteC (0x3,c)
/**************************************************************************
* DATATYPES
**************************************************************************/
// none...
/**************************************************************************
* STATICS
**************************************************************************/
// none...
/**************************************************************************
* ROUTINUES
**************************************************************************/
/* -- cinit_print ---------------------------------------------------------
*
* Description : prints information out to the console of the debugger
*
* Parameters : string - string to be printed out to the console.
* Return : none...
* Notes :
*
*/
void cinit_print (const char *string)
{
int pos = 0;
while (string[pos] != 0) WriteC(&string[pos++]);
}
/* -- C_Entry --------------------------------------------------------------
*
* Description : entry point for switch
*
* Parameters : none...
* Return : Should Exit with the correct SWI...
* Notes : none...
*
*/
void cinit_banner (void)
{
// -- banner ...............................................
cinit_print ("\n -- remove the serial cable from the board \n\n");
cinit_print ("\n ********************************************* \n");
cinit_print (" *** Remember to RESET the board after USE *** \n");
cinit_print (" ********************************************* \n");
}
/* -- cinit_init --------------------------------------------------------
*
* Description : Initializes the LED's on the Evaluator7T board to be
* OFF. Setup the internal GLOBALS to indicate that the
* LED's are OFF.
*
* Parameters : none...
* Return : none...
* Notes : none...
*
*/
void cinit_init (void)
{
// -- init internal ..........................................
// <add USER initialization code here>
// -- init hardware ..........................................
cinit_banner ();
irq_init ();
timer_start ();
}
/* -- C_Entry --------------------------------------------------------------
*
* Description : entry point for tasker
*
* Parameters : none...
* Return : return 1 if successful
* Notes : none...
*
*/
int C_Entry ( void )
{
// -- initialize all internal structures .......................
cinit_init ();
__asm {
MRS r1,CPSR
ORR r1,r1,#0x10
MSR CPSR_c,r1
}
taska_process (); // start with process A
//
// *** Should never reach this code ***
//
return 0;
}
/**************************************************************************
* End of cinit.c
**************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -