📄 main.c
字号:
/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: main.c
** Last modified Date: 2004-09-16
** Last Version: 1.0
** Descriptions: The main() function example template
**
**------------------------------------------------------------------------------------------------------
** Created by: wengshujie
** Created date: 2007-10-15
** Version: 1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
*********************************************************************************************************/
#include "config.h"
INT8U err;
//OS_MEM * IntBuffer; //定义内存控制块指针
//INT8U IntPart[BlockNum][BlockSize]; //划分分区及内存块
OS_MEM * IntBuffer_Big; //定义内存控制块指针
INT8U IntPart_Big[BlockNum][BlockSize_Big]; //划分分区及内存块
OS_MEM_DATA MemInfo;
void Build_INT_Vector_Table()
{
volatile uint32* pRAM;
volatile uint32* pFlash;
uint32 i = 0;
uint32 j = 0;
pRAM = (uint32* )0x40000000;
pFlash = (uint32* )0x10000;
//Move interrupt vector from Flash to SRAM.
for (i=0; i<16; i++)
{
*pRAM = *pFlash;
for(j=0;j<10000;j++);
pRAM++;
pFlash++;
}
MEMMAP = 0x02;//map vector from SRAM.
//GPIO2_Init((1 << 10), 1);
//P2_GPIOSet((1 << 10)); //输出高电平
}
/*********************************************************************************************************
** Function name: main
** Descriptions: 主函数
** Input: 无
** Output: 无
*********************************************************************************************************/
int main (void)
{
//Build_INT_Vector_Table();
OSInit ();
/*用内存分区建立函数OSMemCreate()把这两块RAM存储空间构建成内存 */
/*区,并把管理这两块内存分区的内存分区控制块的地址赋给两个OS_MEM指针*/
//IntBuffer = OSMemCreate(IntPart,BlockNum,BlockSize,&err); //创建内存分区
IntBuffer_Big = OSMemCreate(IntPart_Big,BlockNum,BlockSize_Big,&err); //创建内存分区
UserTask(); //建立用户任务
OSStart ();
}
/*********************************************************************************************************
** End Of File
*********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -