Hi,all.i want to use pwm in my code.And i init pwm with APP_PWM_INSTANCE(PWM1,1),then i get an error:identifier "TIMER1_INSTANCE_INDEX" is undefined.Can someone help me ?
Hi,all.i want to use pwm in my code.And i init pwm with APP_PWM_INSTANCE(PWM1,1),then i get an error:identifier "TIMER1_INSTANCE_INDEX" is undefined.Can someone help me ?
i found it,in nrf_drv_config.h,enabled option.
i found it,in nrf_drv_config.h,enabled option.
Every peripheral must be enabled in nrf_drv_config.h before it can be used. You can then track which peripherals are being used by checking this config file.
Thanks,Aryan!
Can I know how to enable the nrf_drv_config.h? I have include it in main.c, but the error continues.
Every application is supposed to have it's own copy of nrf_drv_config.h. Then in this config file you need to enable peripheral that you want to use. In that case it's TIMER1 since PWM is configured to use that instance. Find TIMER1_ENABLED define and set it to 1.
Using GCC+Eclipse; the error Symbol 'TIMER1_INSTANCE_INDEX' could not be resolved won't go away even if the TIMER1 is set to 1 in nrf_rv_config.h and included the header, and build successful. What I have done then to get rid of this red bug is to define #define TIMER1_INSTANCE_INDEX 1 in main.c!!!! I'm not sure if this a user problem or of Eclipse or the CDT itself???