diff --git a/arch/arm/src/samd5e5/sam_eic.c b/arch/arm/src/samd5e5/sam_eic.c index e5740612a4..6d6d6dd0c4 100644 --- a/arch/arm/src/samd5e5/sam_eic.c +++ b/arch/arm/src/samd5e5/sam_eic.c @@ -116,7 +116,7 @@ void sam_eic_dumpregs(void) * Name: sam_eic_initialize * * Description: - * Initialize the external interrupt controller (EIC). + * Initialize the EIC. Called one timer during system bring-up. * * Input Parameters: * None @@ -153,10 +153,11 @@ int sam_eic_initialize(void) * Name: sam_eic_configure * * Description: - * Configure the interrupt edge sensitivity in CONFIGn register of the EIC + * Configure the interrupt edge sensitivity in CONFIGn register of the + * EIC. The interrupt will be enabled at the EIC (but not at the NVIC). * * Input Parameters: - * eirq - Pin to be configured + * eirq - Pin to be configured (0..15) * pinset - Configuration of the pin * * Returned Value: @@ -177,12 +178,12 @@ int sam_eic_configure(uint8_t eirq, port_pinset_t pinset) reg = SAM_EIC_CONFIG0; val = EIC_CONFIG0_SENSE_BOTH(eirq); - if (pinset & PORT_INT_RISING) + if ((pinset & PORT_INT_RISING) != 0) { val = EIC_CONFIG0_SENSE_RISE(eirq); } - if (pinset & PORT_INT_FALLING) + if ((pinset & PORT_INT_FALLING) != 0) { val = EIC_CONFIG0_SENSE_FALL(eirq); } @@ -194,12 +195,12 @@ int sam_eic_configure(uint8_t eirq, port_pinset_t pinset) reg = SAM_EIC_CONFIG1; val = EIC_CONFIG1_SENSE_BOTH(eirq); - if (pinset & PORT_INT_RISING) + if ((pinset & PORT_INT_RISING) != 0) { val = EIC_CONFIG1_SENSE_RISE(eirq); } - if (pinset & PORT_INT_FALLING) + if ((pinset & PORT_INT_FALLING) != 0) { val = EIC_CONFIG1_SENSE_FALL(eirq); } @@ -221,34 +222,6 @@ int sam_eic_configure(uint8_t eirq, port_pinset_t pinset) return OK; } -/**************************************************************************** - * Name: sam_eic_irq_enable - * - * Description: - * Enable an external interrupt. - * - * Input Parameters: - * irq - SAM_IRQ_EXTINTn IRQ to be enabled - * - * Returned Value: - * None - * - ****************************************************************************/ - -int sam_eic_irq_enable(int irq) -{ - uint32_t config; - int eirq = irq - SAM_IRQ_EXTINT0; - - config = getreg32(SAM_EIC_CONFIG0); - config |= EIC_CONFIG0_FILTEN(eirq) | EIC_CONFIG0_SENSE_FALL(eirq); - putreg32(config, SAM_EIC_CONFIG0); - - putreg32(EIC_EXTINT(eirq), SAM_EIC_INTENSET); - sam_eic_dumpregs(); - return OK; -} - /**************************************************************************** * Name: sam_eic_irq_ack * @@ -256,7 +229,7 @@ int sam_eic_irq_enable(int irq) * Acknowledge receipt of an external interrupt. * * Input Parameters: - * irq - SAM_IRQ_EXTINTn IRQ to be acknowledged + * irq - SAM_IRQ_EXTINTn IRQ to be acknowledged, n=0-15 * * Returned Value: * None diff --git a/arch/arm/src/samd5e5/sam_eic.h b/arch/arm/src/samd5e5/sam_eic.h index 722a3c7ce8..54084fa0df 100644 --- a/arch/arm/src/samd5e5/sam_eic.h +++ b/arch/arm/src/samd5e5/sam_eic.h @@ -68,7 +68,7 @@ extern "C" * Name: sam_eic_initialize * * Description: - * Initialize the EIC + * Initialize the EIC. Called one timer during system bring-up. * * Input Parameters: * None @@ -84,10 +84,11 @@ int sam_eic_initialize(void); * Name: sam_eic_configure * * Description: - * Configure the interrupt edge sensitivity in CONFIGn register of the EIC + * Configure the interrupt edge sensitivity in CONFIGn register of the + * EIC. The interrupt will be enabled at the EIC (but not at the NVIC). * * Input Parameters: - * eirq - Pin to be configured + * eirq - Pin to be configured (0..15) * pinset - Configuration of the pin * * Returned Value: @@ -97,22 +98,6 @@ int sam_eic_initialize(void); int sam_eic_configure(uint8_t eirq, port_pinset_t pinset); -/**************************************************************************** - * Name: sam_eic_irq_enable - * - * Description: - * Enable a external interrupt. - * - * Input Parameters: - * irq - SAM_IRQ_EXTINTn IRQ to be enabled - * - * Returned Value: - * None - * - ****************************************************************************/ - -int sam_eic_irq_enable(int irq); - /**************************************************************************** * Name: sam_eic_irq_ack * @@ -120,7 +105,7 @@ int sam_eic_irq_enable(int irq); * Acknowledge receipt of an external interrupt. * * Input Parameters: - * irq - SAM_IRQ_EXTINTn IRQ to be acknowledged + * irq - SAM_IRQ_EXTINTn IRQ to be acknowledged, n=0-15 * * Returned Value: * None diff --git a/configs/metro-m4/include/board.h b/configs/metro-m4/include/board.h index 98c5047332..ee912bee66 100644 --- a/configs/metro-m4/include/board.h +++ b/configs/metro-m4/include/board.h @@ -54,7 +54,7 @@ /* Clocking *************************************************************************/ /* Overview * - * Since there is not high speed crystal, we will run from the OSC16M clock source. + * Since there is no high speed crystal, we will run from the OSC16M clock source. * We will use its default, POR frequency of 4MHz to avoid an additional clock * switch. * diff --git a/configs/saml21-xplained/include/board.h b/configs/saml21-xplained/include/board.h index f63b9d27a2..69307f1873 100644 --- a/configs/saml21-xplained/include/board.h +++ b/configs/saml21-xplained/include/board.h @@ -56,7 +56,7 @@ /* Clocking *************************************************************************/ /* Overview * - * Since there is not high speed crystal, we will run from the OSC16M clock source. + * Since there is no high speed crystal, we will run from the OSC16M clock source. * We will use its default, POR frequency of 4MHz to avoid an additional clock * switch. *