| | |
| | | hardware_pici = STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+2); |
| | | hardware_type = STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+4); |
| | | //deca_sleep(1000); |
| | | g_com_map[VERSION] = (1<<8)|29; |
| | | g_com_map[VERSION] = (1<<8)|31; |
| | | // g_com_map[DEV_ID]=1158; |
| | | // #ifdef DEBUG_MODE |
| | | // // g_com_map[GROUP_ID]=21; |
| | |
| | | // } |
| | | //g_com_map[NOMOVESLEEP_TIME]=5; |
| | | printf("固件版本: URT-LORA-GPS版本 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff); |
| | | memcpy(g_com_map2,g_com_map,COM_MAP_SIZE); |
| | | // memcpy(g_com_map2,g_com_map,COM_MAP_SIZE); |
| | | // printf("DEVICE PAIRID: %d .\r\n",g_com_map[PAIR_ID]); |
| | | // printf("DEVICE ALARM DISTANCE: 1.%d 2.%d 3.%d .\r\n",g_com_map[ALARM_DISTANCE1],g_com_map[ALARM_DISTANCE2],g_com_map[ALARM_DISTANCE3]); |
| | | |
| | |
| | | uint16_t irq_num; |
| | | u8 lora_irq_flag,lora_working_flag; |
| | | //u8 uwb_irq_flag; |
| | | extern uint8_t LoraUp_flag; |
| | | void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) |
| | | { |
| | | if(GPIO_Pin == RADIO_DIO1_Pin) |
| | |
| | | |
| | | // SystemClock_Config(); |
| | | irq_num++; |
| | | lora_irq_flag = 1; |
| | | |
| | | if(LoraUp_flag) |
| | | { |
| | | RadioIrqProcess(); |
| | | } |
| | | else |
| | | { |
| | | lora_irq_flag = 1; |
| | | } |
| | | } |
| | | if(GPIO_Pin == GPIO_PIN_1)//按键 |
| | | { |
| | |
| | | Error_Handler(); |
| | | } |
| | | HAL_TIM_Base_Start_IT(&htim6); |
| | | memcpy(g_com_map2,g_com_map,COM_MAP_SIZE); |
| | | /* USER CODE END 2 */ |
| | | |
| | | /* Infinite loop */ |
| | |
| | | else |
| | | { |
| | | // HAL_IWDG_Refresh(&hiwdg); |
| | | // if(lora_irq_flag) |
| | | // { |
| | | // lora_irq_flag = 0; |
| | | // lora_working_flag = 1; |
| | | // RadioIrqProcess(); |
| | | // lora_working_flag = 0; |
| | | // } |
| | | if(lora_irq_flag) |
| | | { |
| | | lora_irq_flag = 0; |
| | | lora_working_flag = 1; |
| | | RadioIrqProcess(); |
| | | lora_working_flag = 0; |
| | | } |
| | | // if(uwb_irq_flag) |
| | | // { |
| | | // MbxTagUwbRec(); |