Skip to content

Commit

Permalink
restructuring everything
Browse files Browse the repository at this point in the history
  • Loading branch information
anroOfCode committed Dec 19, 2012
1 parent 845ebd4 commit 40cff89
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#CROSS_COMPILE=arm-linux-gnueabi-gcc

TARGET = cc2520
OBJS = cc2520.o
OBJS = radio.o interface.o

obj-m += $(TARGET).o
cc2520-objs = radio.o interface.o

# Set this is your linux kernel checkout.
KDIR := /home/androbin/linux-rpi-3.2.27
Expand Down
3 changes: 3 additions & 0 deletions cc2520.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
// Structs and definitions
/////////////////////////////

// XOSC Period in nanoseconds.
#define CC2520_XOSC_PERIOD 31

struct cc2520_gpioState {
unsigned int fifopIrq;
unsigned int sfdIrq;
Expand Down
2 changes: 2 additions & 0 deletions interface.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "cc2520.h"

4 changes: 2 additions & 2 deletions cc2520.c → radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <linux/ktime.h>
#include <linux/hrtimer.h>
#include <linux/slab.h>
#include <linux/delay.h>

#include "cc2520.h"

Expand Down Expand Up @@ -105,14 +106,13 @@ int cc2520_setupGpioPins()
goto fail;
state.gpios.fifopIrq = irq;


// Setup SFD Interrupt
irq = gpio_to_irq(CC2520_SFD);
if (irq < 0) {
err = irq;
goto fail;
}

// Setup SFD Interrupt
err = request_irq(
irq,
cc2520_sfdHandler,
Expand Down

0 comments on commit 40cff89

Please sign in to comment.