1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include "main.h"
- #include "bsp_time.h"
- #include "hal_ble_client.h"
- #include "hal_ble_host.h"
- #include "nrf_delay.h"
- #include "hal_dfu.h"
- #if NRF_LOG_ENABLED
- static void log_init(void)
- {
- ret_code_t err_code = NRF_LOG_INIT(NULL);
- APP_ERROR_CHECK(err_code);
- NRF_LOG_DEFAULT_BACKENDS_INIT();
- }
- #endif
- extern void PRE_Init(void);
- extern void USR_Init(void);
- extern void USR_Process(void);
- int main(void)
- {
- #if BLE_DFU_ENANBLE
- hal_dfu_init();
- #endif
- #if NRF_LOG_ENABLED
- log_init();
- #endif
- PRE_Init(); //Óû§³õʼ»¯
- #if BLE_DFU_ENANBLE
- hal_dfu_server_init();
- #endif
- USR_Init(); //Óû§³õʼ»¯
-
- while (1)
- {
- #if NRF_LOG_ENABLED
- NRF_LOG_FLUSH();
- #endif
- USR_Process();
- }
- }
|