0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38,
0x33, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x30,
0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28,
0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20,
0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18,
0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00
};
void display_Begin_LED(void)
{
Begin_LED = 0; /* Begin_LED on */
}
void off_Begin_LED(void)
{
Begin_LED = 1; /* Begin_LED off */
}
void display_OK_LED(void)
{
OK_LED = 0; /* OK_LED on */
}
void off_OK_LED(void)
{
OK_LED = 1; /* OK_LED off */
}
void display_ERROR_LED(void)
{
ERROR_LED = 0; /* ERROR_LED on */
}
void off_ERROR_LED(void)
{
ERROR_LED = 1; /* ERROR_LED off */
}
void delay(INT16U counter)
{
INT16U temp = 0;
for(temp = counter; temp>0; temp--)
{
_nop_();
_nop_();
_nop_();
}
}
void main()
{
//sbit Begin_LED = P1^0;
//sbit ERROR_LED = P1^3;
//sbit OK_LED = P1^7;
display_Begin_LED();
delay(DELAY_CONST);
sector_erase(DEBUG_Data_Memory_Begin_Sector_addr);
if(byte_program_and_verify(DEBUG_Data_Memory_Begin_Sector_addr,0x55) == OK)
display_OK_LED();
else
display_ERROR_LED();
/*
if(sequential_write_flash_in_one_sector(DEBUG_Data_Memory_Begin_Sector_addr, USED_BYTE_QTY_IN_ONE_SECTOR, Test_array_total))
display_OK_LED();
else
display_ERROR_LED();
*/
/*
if(write_flash_with_protect_in_one_sector(DEBUG_Data_Memory_Begin_Sector_addr+0x3, USED_BYTE_QTY_IN_ONE_SECTOR-0x30, Test_array_total))
display_OK_LED();
else
display_ERROR_LED();
*/
while(1);
}
上一页 [1] [2] [3] [4] [5] [6] [7] [8]
本文关键字:C语言 STC单片机(,单片机-工控设备 - STC单片机(