You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.8 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #pragma once
  2. #include <stdint.h>
  3. #include <string.h>
  4. #include "app_timer.h"
  5. #include "app_uart.h"
  6. #include "app_util_platform.h"
  7. #include "ble_advdata.h"
  8. #include "ble_advertising.h"
  9. #include "ble_conn_params.h"
  10. #include "ble_hci.h"
  11. #include "ble_nus.h"
  12. #include "bsp_btn_ble.h"
  13. #include "diskio_blkdev.h"
  14. #include "ff.h"
  15. #include "nordic_common.h"
  16. #include "nrf.h"
  17. #include "nrf_ble_gatt.h"
  18. #include "nrf_ble_qwr.h"
  19. #include "nrf_block_dev_sdc.h"
  20. #include "nrf_delay.h"
  21. #include "nrf_drv_spi.h"
  22. #include "nrf_log.h"
  23. #include "nrf_log_ctrl.h"
  24. #include "nrf_log_default_backends.h"
  25. #include "nrf_pwr_mgmt.h"
  26. #include "nrf_sdh.h"
  27. #include "nrf_sdh_ble.h"
  28. #include "nrf_sdh_soc.h"
  29. //
  30. #define APP_BLE_CONN_CFG_TAG 1 /**< A tag identifying the SoftDevice BLE configuration. */
  31. void zsys_init();
  32. void zsys_loop();
  33. #define ZLOGI(...) NRF_LOG_INFO(__VA_ARGS__)
  34. #define ZLOGE(...) NRF_LOG_ERROR(__VA_ARGS__)
  35. #define ZLOGW(...) NRF_LOG_WARNING(__VA_ARGS__)
  36. #define ZLOGD(...) NRF_LOG_DEBUG(__VA_ARGS__)
  37. #define ZARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
  38. #define ZPIN(port, num) NRF_GPIO_PIN_MAP(port, num)
  39. #define ZERROR_CHECK(err_code) \
  40. do { \
  41. const uint32_t LOCAL_ERR_CODE = (err_code); \
  42. if (LOCAL_ERR_CODE != NRF_SUCCESS) { \
  43. ZLOGI("%s:%d ZERROR_CHECK(%s) fail:%d", __FILE__, __LINE__, #err_code, LOCAL_ERR_CODE); \
  44. APP_ERROR_CHECK(LOCAL_ERR_CODE); \
  45. } \
  46. } while (0)