| | |
| | | } |
| | | unsigned short int updata_byte = 0; |
| | | uint8_t trx_buf[10] = {0}; |
| | | static void app_wdt_callback(void *dev, uint32_t status) |
| | | { |
| | | ASSERT(status, "WDT TIMEOUT,程序复位"); |
| | | //LOG_INFO(TRACE_MODULE_APP, "程序卡死,看门狗复位"); |
| | | } |
| | | struct WDT_CFG_T app_wdt_cfg = { |
| | | .timeout = 32768 * 30, |
| | | .rst_en = true, |
| | | .int_en = true, |
| | | .callback = app_wdt_callback, |
| | | }; |
| | | int main(void) |
| | | { uint8_t c; |
| | | |
| | |
| | | calib_chip(); |
| | | // Disable watchdog timer |
| | | wdt_close(WDT_ID0); |
| | | |
| | | wdt_open(WDT_ID0,&app_wdt_cfg);//30s检测喂狗 |
| | | //LOG_INFO(TRACE_MODULE_APP, "进入Bootloader串口升级\r\n"); |
| | | gpio_open(); |
| | | board_configure(); |
| | |
| | | uart_open(UART_ID1, &test_uart_cfg); |
| | | //uart_open(UART_ID0, &test_uart_cfg); |
| | | //uart_receive(UART_ID1, trx_buf, 1, uart_receive_callback); |
| | | SerialPutString("MK8000-BootLoader-V1.0启动\r\n"); |
| | | SerialPutString("MK8000-BootLoader-V1.1启动\r\n"); |
| | | //Serial0PutString("MK8000-BootLoader-V1.0启动\r\n"); |
| | | while(1) |
| | | { |
| | | |
| | | wdt_ping(WDT_ID0);//喂狗 |
| | | uint16_t tmp = 0; |
| | | tmp=0xAAAA;//测试用 |
| | | //flash_erase(FLASH_ID0, APP_CONFIG_IAPFLAG_SECTOR_ADDR, FLASH_SECTOR_SIZE); |