?? arm_00_os_main.c
字號:
/**********************************************************************************************
本程序只供學習使用,不得用于其它任何用途,否則后果自負。
ARM_00_OS_main.c file
LPC213x上的操作系統——ARM_00_OS
作者:Computer-lov
建立日期:2006-5-1
修改日期:2006-5-15
最后修改時間:2006-08-25
版本:V1.0
版權所有,盜版必究。
任何技術問題可到我的博客上留言: http://computer00.21ic.org
Copyright(C) Computer-lov 2006-2016
All rights reserved
**********************************************************************************************/
#include "CPU.H"
#include "My_type.h"
#include "LED.H"
#include "interrupt.h"
#include "ARM_00_OS_TaskSwitch.H"
#include "ARM_00_OS_Core.H"
#include "UART.H"
#include "KEYS.H"
/*********************************************************************************************/
void SysClkInit(void)
{
PLLCON=0x01; //Enable PLL
PLLCFG=0x24; //set M=4,P=2 so the core clock is about 5*11.0592M
PLLFEED=0xAA;
PLLFEED=0x55; //send PLL feed sequence
while((PLLSTAT&(1<<10))==0); //Wait for PLL Locked
PLLCON=3; //Enable and connect PLL
PLLFEED=0xAA;
PLLFEED=0x55; //send PLL feed sequence
VPBDIV=0x01; //VPB clock set. 0x01 --- same as the core clock
MAMCR=0x00;
MAMTIM=0x03; //set MAMTIM to 3cclk for core clock >40MHz
MAMCR=0x02; //use MAM
}
///////////////////////////////////////////////////////////////////////////////////////////////
/**********************************************************************************************
main函數
**********************************************************************************************/
void main(void)
{
DisEnableInterrupt(OS_I_Bit | OS_F_Bit); //關中斷
SysClkInit(); //系統時鐘初始化
UART_init(); //串口初始化
DelayXms(100); //延遲100ms
cls(); //清屏
prints("SystemStart",1); //顯示開機信息
OSInit(); //操作系統初始化
DelayXms(2000); //延時2S。軟件仿真時最好去掉該句,否則有得你等^_^
OSEnterCritical(); //進入臨界段
EnableInterrupt(OS_I_Bit | OS_F_Bit); //開中斷
OSTickInit(); //系統時鐘節拍初始化
OSStart((uint32)OSSystemIdle,OS_THUMB_MODE); //系統開始運行
}
//////////////////////////////////End of function//////////////////////////////////////////////
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -