CH552/projects/examples/IAP/CH554IAPDemo.C

45 lines
1.5 KiB
C++
Raw Normal View History

2018-10-17 10:44:45 +02:00
/********************************** (C) COPYRIGHT ******************************
* File Name : CH554IAPDemo.C
* Author : WCH
* Version : V1.0
* Date : 2017/01/20
* Description : <EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>P17LED<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>EnableIAP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>͵<EFBFBD>ƽ<EFBFBD>󣬽<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>BOOT<EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>BOOT<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*******************************************************************************/
#include "./Public/CH554.H"
#include "./Public/Debug.H"
sbit EnableIAP = P1^6;
#define BOOT_ADDR 0x3800
#pragma NOAREGS
/*******************************************************************************
* Function Name : main
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD>
* Input : None
* Output : None
* Return : None
*******************************************************************************/
typedef void( *pTaskFn)( void );
pTaskFn tasksArr[1];
void main( void )
{
UINT16 i=0;
while(1){
SCK = ~SCK; //P17<31><37>˸
mDelaymS(50);
if(EnableIAP == 0){ //P16<31><36><EFBFBD>ż<EFBFBD><C5BC><EFBFBD>͵<EFBFBD>ƽ<EFBFBD><C6BD>ת
break;
}
}
EA = 0; //<2F>ر<EFBFBD><D8B1><EFBFBD><EFBFBD>жϣ<D0B6><CFA3>ؼ<EFBFBD>
tasksArr[0] = BOOT_ADDR;
mDelaymS( 100 );
(tasksArr[0])( ); //<2F><><EFBFBD><EFBFBD>BOOT<4F><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ʹ<><CAB9>ISP<53><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
while(1);
}