|
把库的例子移植到协议栈,就是跑不起呢?
for (;;)
{
// power_manage();
// if(app_status.BeepStatus == 0x01)
// {
// while (app_pwm_channel_duty_set(&PWM1, 0,50) == NRF_ERROR_BUSY);
//app_pwm_channel_duty_set(&PWM1, 0, 50);
// }
for (uint8_t i = 0; i < 40; ++i)
{
value = (i < 20) ? (i * 5) : (100 - (i - 20) * 5);
ready_flag = false;
/* Set the duty cycle - keep trying until PWM is ready... */
while (app_pwm_channel_duty_set(&PWM2, 0, value) == NRF_ERROR_BUSY);
/* ... or wait for callback. */
// while (!ready_flag);
// // APP_ERROR_CHECK(app_pwm_channel_duty_set(&PWM1, 1, value));
// nrf_delay_ms(25);
nrf_drv_systick_delay_ms(25);
}
//nrf_drv_systick_delay_ms(25);
} |
|