Moved variable definitions from header file

This commit is contained in:
Niclas Finne 2011-12-20 04:59:08 +01:00
parent c0cf69ecbd
commit d14d90ea68
3 changed files with 9 additions and 7 deletions

View File

@ -179,8 +179,8 @@ PROCESS_THREAD(accel_process, ev, data) {
accm_init();
/* Register the callback functions for each interrupt */
ACCM_REGISTER_INT1_CB((void *)accm_ff_cb);
ACCM_REGISTER_INT2_CB((void *)accm_tap_cb);
ACCM_REGISTER_INT1_CB(accm_ff_cb);
ACCM_REGISTER_INT2_CB(accm_tap_cb);
/* Set what strikes the corresponding interrupts. Several interrupts per pin is
possible. For the eight possible interrupts, see adxl345.h and adxl345 datasheet. */

View File

@ -46,8 +46,10 @@
#include "i2cmaster.h"
/* Callback pointers when interrupt occurs */
extern void (*accm_int1_cb)(u8_t reg);
extern void (*accm_int2_cb)(u8_t reg);
void (*accm_int1_cb)(u8_t reg);
void (*accm_int2_cb)(u8_t reg);
process_event_t int1_event, int2_event;
/* Bitmasks for the interrupts */
static uint16_t int1_mask = 0, int2_mask = 0;

View File

@ -278,12 +278,12 @@ void accm_set_irq(uint8_t int1, uint8_t int2);
#define ADXL345_SRATE_0_10 0x00 // 0.10 Hz, when I2C data rate >= 100 kHz
/* Callback pointers for the interrupts */
void (*accm_int1_cb)(u8_t reg);
void (*accm_int2_cb)(u8_t reg);
extern void (*accm_int1_cb)(u8_t reg);
extern void (*accm_int2_cb)(u8_t reg);
/* Interrupt 1 and 2 events; ADXL345 signals interrupt on INT1 or INT2 pins,
ISR is invoked and polls the accelerometer process which invokes the callbacks. */
process_event_t int1_event, int2_event; // static ?
extern process_event_t int1_event, int2_event; // static ?
#define ACCM_INT1 0x01
#define ACCM_INT2 0x02