diff --git a/cpu/cc253x/dev/p2-intr.h b/cpu/cc253x/dev/p2-intr.h index f29edcc1b..4518243b4 100644 --- a/cpu/cc253x/dev/p2-intr.h +++ b/cpu/cc253x/dev/p2-intr.h @@ -45,7 +45,11 @@ void cc253x_p2_register_handler(struct cc253x_p2_handler *h); void cc253x_p2_unregister_handler(struct cc253x_p2_handler *h); +/* When the ISR is not needed, hide its prototype from the module containing + * main() to prevent linking it */ +#if PORT_2_ISR_ENABLED void cc253x_p2_int(void) __interrupt(P2INT_VECTOR); +#endif #define cc253x_p2_irq_disable(flag) do { flag = IEN2 & 0x2; IEN2 &= ~0x2; } while(0) #define cc253x_p2_irq_enable(flag) do { IEN2 |= flag; } while(0) diff --git a/platform/cc2530dk/contiki-conf.h b/platform/cc2530dk/contiki-conf.h index a5e2406df..7df312e84 100644 --- a/platform/cc2530dk/contiki-conf.h +++ b/platform/cc2530dk/contiki-conf.h @@ -98,6 +98,14 @@ #define CC2530_CONF_MAC_FROM_PRIMARY 1 #endif +/* Interrupt Number 6: Shared between P2 Inputs, I2C and USB + * A single ISR handles all of the above. Leave this as is if you are not + * interested in any of the above. Define as 1 (e.g. in project-conf.h) if + * at least one of those interrupt sources will need handled */ +#ifndef PORT_2_ISR_ENABLED +#define PORT_2_ISR_ENABLED 0 +#endif + /* * Sensors * It is harmless to #define XYZ 1 diff --git a/platform/cc2530dk/models.h b/platform/cc2530dk/models.h index e5dcf58eb..8d42cbf1b 100644 --- a/platform/cc2530dk/models.h +++ b/platform/cc2530dk/models.h @@ -67,6 +67,9 @@ #if MODEL_CC2531 #define USB_CONF_ENABLE 1 +/* Enabled the ISR for Interrupt Num 6 */ +#define PORT_2_ISR_ENABLED 1 + #ifndef USB_CONF_CLASS #define DMA_CONF_ON 1 #define DMA_USB_CHANNEL 0