Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseichinger committed Jul 23, 2013
1 parent ea6b167 commit 667cb2f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion redbee-econotag/drivers/Makefile
Expand Up @@ -3,7 +3,7 @@ BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)

INCLUDES += -I$(RIOTBASE)/sys/include/ -I$(RIOTBASE)/drivers/cc110x_ng/include/
INCLUDES += -I$(RIOTBASE)/sys/include/

.PHONY: redbee-econotag_drivers.a

Expand Down
2 changes: 2 additions & 0 deletions redbee-econotag/drivers/include/maca.h
Expand Up @@ -29,6 +29,8 @@ void maca_check ( void );
/* functions to configure MACA */
void maca_set_power ( uint8_t power );
void maca_set_channel ( uint8_t channel );
uint16_t maca_set_address ( uint16_t addr );
uint16_t maca_get_address ( void );

/* get Link Quality Indicator */
//extern uint8_t (*get_lqi) ( void );
Expand Down
21 changes: 19 additions & 2 deletions redbee-econotag/drivers/maca.c
Expand Up @@ -827,7 +827,7 @@ const uint32_t AIMVAL[19] = {
#define ADDR_POW2 (ADDR_POW1 + 12)
#define ADDR_POW3 (ADDR_POW1 + 64)

void set_power ( uint8_t power ) {
void maca_set_power ( uint8_t power ) {
safe_irq_disable ( INT_NUM_MACA );

* ( ( uint32_t * ) ( ADDR_POW1 ) ) = PSMVAL[power];
Expand Down Expand Up @@ -865,7 +865,7 @@ const uint32_t VCODivF[16] = {
#define ADDR_CHAN3 (ADDR_CHAN1+16)
#define ADDR_CHAN4 (ADDR_CHAN1+48)

void set_channel ( uint8_t chan ) {
void maca_set_channel ( uint8_t chan ) {
volatile uint32_t tmp;
safe_irq_disable ( INT_NUM_MACA );

Expand Down Expand Up @@ -895,6 +895,23 @@ void set_channel ( uint8_t chan ) {
}
}

uint16_t maca_set_address ( uint16_t addr ) {
safe_irq_disable ( INT_NUM_MACA );

MACA->MAC16ADDR = addr;

irq_restore();

if ( ITC->NIPENDbits.MACA ) {
ITC->INTFRCbits.MACA = 1;
}
return MACA->MAC16ADDR;
}

uint16_t maca_get_address ( void ) {
return MACA->MAC16ADDR;
}

#define MACA_ROM_END 0x0013ffff
#define MACA_ENTRY_EOF 0x00000e0f
uint32_t _exec_init_entry ( volatile uint32_t *entries, uint8_t *value_buffer ) {
Expand Down

0 comments on commit 667cb2f

Please sign in to comment.