cc2531 B1 support. B2 to come
This commit is contained in:
parent
26ae56fcaf
commit
c95fc4f360
|
@ -80,8 +80,13 @@ int configure(int type, int value)
|
|||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if MODEL_CC2531
|
||||
void
|
||||
port_1_isr(void) __interrupt(P1INT_VECTOR)
|
||||
#else
|
||||
void
|
||||
port_0_isr(void) __interrupt(P0INT_VECTOR)
|
||||
#endif
|
||||
{
|
||||
EA = 0;
|
||||
ENERGEST_ON(ENERGEST_TYPE_IRQ);
|
||||
|
|
|
@ -43,23 +43,38 @@
|
|||
#include "contiki-conf.h"
|
||||
#include "lib/sensors.h"
|
||||
|
||||
#define BUTTON_PORT 0
|
||||
#define BUTTON_PIN 1
|
||||
|
||||
#define BUTTON_SENSOR "Button"
|
||||
|
||||
/*
|
||||
* SmartRF Buttons
|
||||
* B1: P0_1, B2: Not Connected
|
||||
*
|
||||
* USB Dongle Buttons
|
||||
* B1: P1_2
|
||||
* B2: P1_3
|
||||
*
|
||||
*/
|
||||
#if MODEL_CC2531
|
||||
#define BUTTON_PORT 1
|
||||
#define BUTTON_PIN 2
|
||||
#else
|
||||
#define BUTTON_PORT 0
|
||||
#define BUTTON_PIN 1
|
||||
#endif
|
||||
|
||||
#ifdef BUTTON_SENSOR_CONF_ON
|
||||
#define BUTTON_SENSOR_ON BUTTON_SENSOR_CONF_ON
|
||||
#endif /* BUTTON_SENSOR_CONF_ON */
|
||||
|
||||
#if BUTTON_SENSOR_ON
|
||||
extern const struct sensors_sensor button_sensor;
|
||||
#if MODEL_CC2531
|
||||
/* Button 1: P1_2 - Port 1 ISR needed */
|
||||
void port_1_isr(void) __interrupt(P1INT_VECTOR);
|
||||
#else
|
||||
/* Button 1: P0_1 - Port 0 ISR needed */
|
||||
void port_0_isr(void) __interrupt(P0INT_VECTOR);
|
||||
#endif
|
||||
#define BUTTON_SENSOR_ACTIVATE() button_sensor.configure(SENSORS_ACTIVE, 1)
|
||||
#else
|
||||
#define BUTTON_SENSOR_ACTIVATE()
|
||||
|
|
Loading…
Reference in a new issue