58: 59: 60: u8 c,AckNum,ErrorNum,sum,BlockNum,code; 61: u16 i; 62: u32 *PData; 0x08001B6A FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 63: AckNum = 0; 0x08001B6E FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 65: sum = 0; 0x08001B72 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 67: InitVar(); 0x08001B76 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 68: FLASH_Unlock(); 69: /* Clear All pending flags */ 0x08001B7A FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 70: FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); 0x08001B7E FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001B82 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001B86 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001B8A FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001B8E FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001B92 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001B96 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001B9A FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001B9E FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 75: while(AckSucceed != 1)//握手 76: { 0x08001BA2 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BA6 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 78: if(RecFail == 1) 79: { 0x08001BAA FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BAE FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 80: break; 81: } 0x08001BB2 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BB6 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BBA FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 88: AckNum = 0; 0x08001BBE FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BC2 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BC6 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BCA FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BCE FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BD2 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 95: USART_SendData(USART1, ACK); 96: } 0x08001BD6 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BDA FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 97: if(ErrorNum >= 5) 98: { 0x08001BDE FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 99: AckSucceed = 0; 0x08001BE2 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BE6 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 75: while(AckSucceed != 1)//握手 76: { 77: c = RecieveByte(); 78: if(RecFail == 1) 79: { 0x08001BEA FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BEE FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 80: break; 81: } 82: if(c == 0xa5) 83: { 84: AckNum++; 85: } 86: else 87: { 88: AckNum = 0; 89: USART_SendData(USART1, NAK); 90: ErrorNum++; 91: } 92: if(AckNum >= 5) 93: { 94: AckSucceed = 1; 95: USART_SendData(USART1, ACK); 96: } 97: if(ErrorNum >= 5) 98: { 99: AckSucceed = 0; 100: break; 101: } 102: } 0x08001BF2 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 106: RecFail = 0; 107: //FlashAddr = 0x8002000; 0x08001BF6 FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BFA FFFFFFFF DCD 0xFFFFFFFF ; ? Undefined 0x08001BFE FFFF4604 DCD 0xFFFF4604 ; ? Undefined 109: if(RecFail == 1) 0x08001C02 4838 LDR r0,[pc,#224] ; @0x08001CE4 0x08001C04 7800 LDRB r0,[r0,#0x00] 0x08001C06 2801 CMP r0,#0x01 0x08001C08 D100 BNE 0x08001C0C 110: break; 0x08001C0A E09A B 0x08001D42 111: sum = c; 0x08001C0C 4627 MOV r7,r4 112: FlashAddr = (u32)c << 24; 0x08001C0E 0620 LSLS r0,r4,#24 0x08001C10 4936 LDR r1,[pc,#216] ; @0x08001CEC 0x08001C12 6008 STR r0,[r1,#0x00] 113: c = RecieveByte(); 0x08001C14 F7FFFEE6 BL.W RecieveByte (0x080019E4) 0x08001C18 4604 MOV r4,r0 114: sum += c; 0x08001C1A 4427 ADD r7,r7,r4 115: FlashAddr += (u32)c << 16; |