fixed naming of SPI and CC2420 related code

This commit is contained in:
joxe 2010-06-23 10:19:15 +00:00
parent 80942abaf7
commit 705f8cc451
2 changed files with 10 additions and 7 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)$Id: cc2420-arch-sfd.c,v 1.3 2010/01/26 10:20:16 adamdunkels Exp $ * @(#)$Id: cc2420-arch-sfd.c,v 1.4 2010/06/23 10:19:15 joxe Exp $
*/ */
#include <io.h> #include <io.h>
@ -34,6 +34,7 @@
#include "dev/spi.h" #include "dev/spi.h"
#include "dev/cc2420.h" #include "dev/cc2420.h"
#include "contiki-conf.h"
volatile uint8_t cc2420_arch_sfd_counter; volatile uint8_t cc2420_arch_sfd_counter;
volatile uint16_t cc2420_arch_sfd_start_time; volatile uint16_t cc2420_arch_sfd_start_time;
@ -48,7 +49,7 @@ cc24240_timerb1_interrupt(void)
ENERGEST_ON(ENERGEST_TYPE_IRQ); ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* always read TBIV to clear IFG */ /* always read TBIV to clear IFG */
tbiv = TBIV; tbiv = TBIV;
if(SFD_IS_1) { if(CC2420_SFD_IS_1) {
cc2420_arch_sfd_counter++; cc2420_arch_sfd_counter++;
cc2420_arch_sfd_start_time = TBCCR1; cc2420_arch_sfd_start_time = TBCCR1;
} else { } else {
@ -62,7 +63,7 @@ void
cc2420_arch_sfd_init(void) cc2420_arch_sfd_init(void)
{ {
/* Need to select the special function! */ /* Need to select the special function! */
P4SEL = BV(SFD); P4SEL = BV(CC2420_SFD_PIN);
/* start timer B - 32768 ticks per second */ /* start timer B - 32768 ticks per second */
TBCTL = TBSSEL_1 | TBCLR; TBCTL = TBSSEL_1 | TBCLR;

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)$Id: cc2420-arch.c,v 1.8 2010/05/10 11:32:44 nifi Exp $ * @(#)$Id: cc2420-arch.c,v 1.9 2010/06/23 10:19:15 joxe Exp $
*/ */
#include <io.h> #include <io.h>
@ -47,7 +47,7 @@
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
interrupt(PORT1_VECTOR) interrupt(CC2420_IRQ_VECTOR)
cc24240_port1_interrupt(void) cc24240_port1_interrupt(void)
{ {
ENERGEST_ON(ENERGEST_TYPE_IRQ); ENERGEST_ON(ENERGEST_TYPE_IRQ);
@ -64,12 +64,14 @@ cc2420_arch_init(void)
spi_init(); spi_init();
/* all input by default, set these as output */ /* all input by default, set these as output */
P4DIR |= BV(CSN) | BV(VREG_EN) | BV(RESET_N); CC2420_CSN_PORT(DIR) |= BV(CC2420_CSN_PIN);
CC2420_VREG_PORT(DIR) |= BV(CC2420_VREG_PIN);
CC2420_RESET_PORT(DIR) |= BV(CC2420_RESET_PIN);
#if CONF_SFD_TIMESTAMPS #if CONF_SFD_TIMESTAMPS
cc2420_arch_sfd_init(); cc2420_arch_sfd_init();
#endif #endif
SPI_DISABLE(); /* Unselect radio. */ CC2420_SPI_DISABLE(); /* Unselect radio. */
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/