lpcware

Bugreport: LPCOpen 2.06 for LPC11E68 and 2.16 LPC11E68 configuration pin Interrupt

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by cappo85 on Tue Jul 07 05:38:31 MST 2015
I would like to report a bug in the file syscon_11n6x.c, function :

void Chip_SYSCTL_SetPinInterrupt(uint32_t intno, uint8_t port, uint8_t pin)
{
if (port == 0) {
/* Pins P0.1 to P0.23 only */
LPC_SYSCTL->PINTSEL[intno] = (uint32_t) pin;
}
else {
/* P1.1 to P1.31 and P2.0 to P2.7 */
LPC_SYSCTL->PINTSEL[intno] = (uint32_t) ((port -1)* 32 + pin);
}
}

is not correct.
The proposed solution is:

void Chip_SYSCTL_SetPinInterrupt(uint32_t intno, uint8_t port, uint8_t pin)
{
        switch(port)
        {
        case 0:
                LPC_SYSCTL->PINTSEL[intno] = (uint32_t) pin;
                break;
               
        case 1:
                LPC_SYSCTL->PINTSEL[intno] = (uint32_t) (24 + pin);
                break;
               
        case 2:
                LPC_SYSCTL->PINTSEL[intno] = (uint32_t) (56 + pin);
                break;

       default:
                break;
        }
}

Best regards
Riccardo Capponi

Outcomes