[异常解决] Keil安装好nRF51822开发环境,运行DEMO报错:Error:“GPIOTE_CONFIG_NUM_OF_LOW_POWER_ENVENTS” is undefined

1.问题描述

when compiling "ble_app_proximity" exampled by Nordic, it indicates errors:

"D:Program FilesMDK5ARMPACKNordicSemiconductor RF_Drivers3.0.0gpiote rf_drv_gpiote.c(30): error: #20: identifier "GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS" is undefined"

"nrf_drv_gpiote_evt_handler_t handlers[NUMBER_OF_GPIO_TE+GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS];"

and

"D:Program FilesMDK5ARMPACKNordicSemiconductor RF_Drivers3.0.0gpiote rf_drv_gpiote.c(148): error: #20: identifier "GPIOTE_CONFIG_IRQ_PRIORITY" is undefined"

"nrf_drv_common_irq_enable(GPIOTE_IRQn, GPIOTE_CONFIG_IRQ_PRIORITY);"

2.解决办法

  Find nrf_drv_config.h in your project:

 Modify following macro will ok:

#define GPIOTE_ENABLED 1

  将下面宏改为1即可:

参考:https://devzone.nordicsemi.com/question/45202/errorgpiote_config_num_of_low_power_envents-is-undefined/

原文地址:https://www.cnblogs.com/zjutlitao/p/5643750.html