config_extra.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #ifndef __CONFIG_EXTRA_H__
  2. #define __CONFIG_EXTRA_H__
  3. /*****************************************************************************
  4. * Module : 系统功能配置
  5. *****************************************************************************/
  6. #if BSP_ADKEY_EN || BSP_IOKEY_EN
  7. #define BSP_KEY_EN 1
  8. #endif
  9. #if BSP_ADKEY_EN || BSP_VBAT_DETECT_EN
  10. #define BSP_SARADC_EN 1
  11. #endif
  12. #if (SYS_SLEEP_LEVEL >= SLEEP_LEVEL_LV2)
  13. #define SLEEP_SFR_SAVE 1
  14. #else
  15. #define SLEEP_SFR_SAVE 0
  16. #endif
  17. #if !SYS_SLEEP_LEVEL
  18. #undef SYS_SLEEP_TIME
  19. #undef SLEEP_SFR_SAVE
  20. #define SYS_SLEEP_TIME 0
  21. #define SLEEP_SFR_SAVE 0
  22. #endif
  23. #if !AB_FOT_EN
  24. #undef AB_FOT_CHANNEL
  25. #define AB_FOT_CHANNEL 0
  26. #endif
  27. #if !FUNC_USBD_EN
  28. #undef USB_HID_EN
  29. #undef USB_SPEAKER_EN
  30. #undef USB_MIC_EN
  31. #undef USB_VENDOR_EN
  32. #undef USB_AUDIO_EN
  33. #undef USB_EN
  34. #define USB_HID_EN 0
  35. #define USB_SPEAKER_EN 0
  36. #define USB_MIC_EN 0
  37. #define USB_VENDOR_EN 0
  38. #define USB_AUDIO_EN 0
  39. #define USB_EN 0
  40. #endif
  41. #if (FLASH_RESERVE_SIZE % 4096) != 0
  42. #error "FLASH_RESERVE_SIZE is not a multiple of 4096!"
  43. #endif
  44. #if (AB_FOT_EN && (AB_FOT_TYPE == AB_FOT_TYPE_PACK))
  45. #if (FOT_PACK_START % 4096) != 0
  46. #error "FOT_PACK_START is not a multiple of 4096!"
  47. #endif
  48. #endif
  49. /*****************************************************************************
  50. * Module : 蓝牙相关配置
  51. *****************************************************************************/
  52. #if (FUNC_LE_BQB_RF_EN || FUNC_LE_FCC_EN || LE_FCC_TEST_EN || LE_BQB_RF_EN)
  53. #define LE_DUT_UART_EN 1
  54. #undef SYS_SLEEP_TIME
  55. #define SYS_SLEEP_TIME 0
  56. #undef SYS_OFF_TIME
  57. #define SYS_OFF_TIME 0
  58. #else
  59. #define LE_DUT_UART_EN 0
  60. #endif
  61. #if (FUNC_LE_FCC_EN && LE_FCC_TEST_EN)
  62. #error "LE FCC TEST: The FUNC_LE_FCC_EN and LE_FCC_TEST_EN cannot be enabled at the same time!\n"
  63. #endif
  64. #if (FUNC_LE_BQB_RF_EN && LE_BQB_RF_EN)
  65. #error "LE BQB RF TEST: The FUNC_LE_BQB_RF_EN and LE_BQB_RF_EN cannot be enabled at the same time!\n"
  66. #endif
  67. /*****************************************************************************
  68. * Module : UART打印功能配置
  69. *****************************************************************************/
  70. #if !BSP_UART_DEBUG_EN
  71. //关闭所以打印信息
  72. #undef printf
  73. #undef vprintf
  74. #undef print_r
  75. #undef print_r16
  76. #undef print_r32
  77. #undef printk
  78. #undef vprintk
  79. #undef print_kr
  80. #undef print_kr16
  81. #undef print_kr32
  82. #define printf(...)
  83. #define vprintf(...)
  84. #define print_r(...)
  85. #define print_r16(...)
  86. #define print_r32(...)
  87. #define printk(...)
  88. #define vprintk(...)
  89. #define print_kr(...)
  90. #define print_kr16(...)
  91. #define print_kr32(...)
  92. #endif
  93. #endif // __CONFIG_EXTRA_H__