resetprg.c
来自「ucOS 在单片机上实现」· C语言 代码 · 共 36 行
C
36 行
/*****************************************************************************************
** FILE : ResetPrg.C **
** DESCRIPTION : Reset Program. User must include this MODIFIED file in their **
** applictions. **
**-------------------------------------------------------------------------------------**
** **
** Copyright (c) 2001-2002 Hitachi Micro Systems Europe Ltd UK. **
** **
** This program is distributed in the hope that it will be useful, **
** but WITHOUT ANY WARRANTY; without even the implied warranty of **
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **
** **
*****************************************************************************************/
#include <machine.h>
#include <_h_c_lib.h>
#include "stacksct.h"
#include "iodefine.h"
void PowerON_Reset(void)
{
unsigned char dummy;
set_imask_ccr(1);
*((volatile unsigned char *)0xffc3)= 0x9e;
dummy = *((volatile unsigned char *)0xffc3);
*((volatile unsigned char *)0xffc3)= 0xf1;
*((volatile unsigned char *)0xfffa)= 0xbf;
_INITSCT();
P_IENR1.BYTE = 0;
P_IENR2.BYTE = 0;
set_imask_ccr(0);
main();
sleep();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?