| | |
| | | { |
| | | RCC_Configuration(); |
| | | //SystemInit(); |
| | | NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x5000); |
| | | Nvic_Init(); |
| | | Systick_Init(); |
| | | Led_Init(); |
| | |
| | | { |
| | | if(g_com_map[DEV_ROLE]==0) |
| | | {int8_t correction_time; |
| | | correction_time=tag_timer-(GROUP_TAG_NUM+1)*3; |
| | | correction_time=tag_timer-g_com_map[DEV_ID]*3; |
| | | tag_delaytime=correction_time; |
| | | if(tag_delaytime>g_com_map[COM_INTERVAL]/2) |
| | | { |
| | |
| | | g_start_send_flag=1; |
| | | } |
| | | |
| | | } |
| | | if(g_com_map[CNT_UPDATE]==1) |
| | | { |
| | | uint32_t result = 0; |
| | | u16 tmp = 0xAAAA; |
| | | __disable_irq(); |
| | | result = FLASH_Prepare(0x8004A38, 2); |
| | | if(result) |
| | | result = FLASH_Write(0x8004A38, (const uint8_t*)&tmp, 2); |
| | | __enable_irq(); |
| | | printf("杩涘叆鍗囩骇妯″紡\r\n"); |
| | | // STMFLASH_Write_NoCheck(0x8004A38,0xAAAA); |
| | | // Delay_ms(100); |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //杞浣嶅洖鍒癰ootloader |
| | | } |
| | | |
| | | } |
| | |
| | | IdleTask(); |
| | | if(g_start_send_flag) |
| | | { |
| | | g_start_send_flag = 0; |
| | | |
| | | g_start_send_flag = 0; |
| | | Tag_App(); |
| | | } |
| | | |