I am working on an application where I need to start pwm sequence after particular delay (accurate delay of multiple of 100us).
I am quite new to nordic environment.
Here is my code . Can please guide me what is wrong here??
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define Period 20000 //20ms
const nrf_drv_timer_t TIMER_LED = NRF_DRV_TIMER_INSTANCE(0);
APP_PWM_INSTANCE(PWM1,1);
static int gpio_flag =0;
void pwm_update(void)
{
uint32_t value;
value = duty_1;
ready_flag = false;
/* Set the duty cycle - keep trying until PWM is ready... */
while ((app_pwm_channel_duty_set(&PWM1, 0, value))&(app_pwm_channel_duty_set(&PWM1, 1, value)) == NRF_ERROR_BUSY);
/* ... or wait for callback. */
while (!ready_flag);