NOTE: I just noticed that my user defined ISRs were missing clearing the ISR status flag in the GPT peripheral. They should be like this. void gpt0_counter_compare_match_A_isr(void) { ssp_vector_info_t * p_vector_info = NULL; R_SSP_VectorInfoGet(R_SSP_CurrentIrqGet(), &p_vector_info); g_ioport.p_api->pinWrite(IOPORT_PORT_06_PIN_00, IOPORT_LEVEL_LOW); R_GPTA0->GTST_b.TCFA = 0; // Clear the ISR flag in the peripheral /** Clear pending IRQ to make sure it doesn't fire again after exiting */ R_BSP_IrqStatusClear(R_SSP_CurrentIrqGet()); } void gpt1_counter_compare_match_B_isr(void) { ssp_vector_info_t * p_vector_info = NULL; R_SSP_VectorInfoGet(R_SSP_CurrentIrqGet(), &p_vector_info); g_ioport.p_api->pinWrite(IOPORT_PORT_06_PIN_01, IOPORT_LEVEL_LOW); R_GPTA1->GTST_b.TCFB = 0; // Clear the ISR flag in the peripheral /** Clear pending IRQ to make sure it doesn't fire again after exiting */ R_BSP_IrqStatusClear(R_SSP_CurrentIrqGet()); } void gpt2_counter_compare_match_C_isr(void) { ssp_vector_info_t * p_vector_info = NULL; R_SSP_VectorInfoGet(R_SSP_CurrentIrqGet(), &p_vector_info); g_ioport.p_api->pinWrite(IOPORT_PORT_06_PIN_02, IOPORT_LEVEL_LOW); R_GPTA2->GTST_b.TCFC = 0; // Clear the ISR flag in the peripheral /** Clear pending IRQ to make sure it doesn't fire again after exiting */ R_BSP_IrqStatusClear(R_SSP_CurrentIrqGet()); }
↧