This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pwm1 handler crash

nrfx_pwm_config_t const config1 =
{
.output_pins =
{
OUT5 , 
OUT6 ,
OUT7 , 
OUT8 , 
},
.irq_priority = APP_IRQ_PRIORITY_LOWEST,
.base_clock = NRF_PWM_CLK_4MHz, 
.count_mode = NRF_PWM_MODE_UP, 
.top_value = 1000, 
.load_mode = NRF_PWM_LOAD_INDIVIDUAL, 
.step_mode = NRF_PWM_STEP_AUTO 
};

seq1_values.channel_0 = 1000; //正向
seq1_values.channel_1 = 1000;
seq1_values.channel_2 = 1000;
seq1_values.channel_3 = 1000;

APP_ERROR_CHECK(nrfx_pwm_init(&m_pwm1, &config1, NULL));

static void pwm1_handler(nrfx_pwm_evt_type_t event_type)
{
if (event_type == NRFX_PWM_EVT_FINISHED)
{
if(B_change1_color == true)
{
B_change1_color = false;
seq1_values.channel_0 = PWM1_code[0];
seq1_values.channel_1 = PWM1_code[1];
seq1_values.channel_2 = PWM1_code[2];
seq1_values.channel_3 = PWM1_code[3];
}
}
}

If I replace NULL with pwm1_handler, the program crashes.Is there a problem with my settings? Requesting help. Thank you.

Parents Reply Children
No Data
Related