From f27155268cf6ef4f5281564ac972224860cdd598 Mon Sep 17 00:00:00 2001 From: travisutk Date: Tue, 24 Jul 2012 03:12:57 +0000 Subject: [PATCH] Apimote patch. I think this works. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1206 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- firmware/apps/radios/ccspi.c | 12 +++++----- firmware/config.mk | 4 ++-- firmware/platforms/{apimote1.h => apimote.h} | 23 ++++++++++---------- 3 files changed, 20 insertions(+), 19 deletions(-) rename firmware/platforms/{apimote1.h => apimote.h} (84%) mode change 100755 => 100644 diff --git a/firmware/apps/radios/ccspi.c b/firmware/apps/radios/ccspi.c index 6df0458..54b155c 100644 --- a/firmware/apps/radios/ccspi.c +++ b/firmware/apps/radios/ccspi.c @@ -50,12 +50,14 @@ void ccspisetup(){ DIRSS; DIRCE; - P4OUT|=BIT5; //activate CC2420 voltage regulator + //P4OUT|=BIT5; //activate CC2420 voltage regulator msdelay(100); //Reset the CC2420. - P4OUT&=~BIT6; - P4OUT|=BIT6; + /*P4OUT&=~BIT6; FIXME Does the new code work on Z1 and Telosb? + P4OUT|=BIT6;*/ + CLRCE; + SETCE; //Begin a new transaction. CLRSS; @@ -362,8 +364,8 @@ void ccspi_handle_fn( uint8_t const app, //TODO disable AUTOCRC here again to go back to promiscous mode //Turn off LED 2 (green) as signal - PLED2DIR |= PLED2PIN; - PLED2OUT |= PLED2PIN; + PLED2DIR |= PLED2PIN; + PLED2OUT |= PLED2PIN; } //TODO the firmware stops staying in this mode after a while, and stops jamming... need to find a fix. #else diff --git a/firmware/config.mk b/firmware/config.mk index a59ab27..76c118f 100644 --- a/firmware/config.mk +++ b/firmware/config.mk @@ -5,9 +5,9 @@ #Unset by default, but can be explicitly set later. config=undef -ifneq (,$(findstring $(board),apimote1)) +ifneq (,$(findstring $(board),apimote)) mcu ?= msp430f2618 -platform := apimote1 +platform := apimote config := monitor spi ccspi MSP430BSL?=goodfet.bsl --speed=38400 --swap-reset-test CFLAGS += -Duseuart1 diff --git a/firmware/platforms/apimote1.h b/firmware/platforms/apimote.h old mode 100755 new mode 100644 similarity index 84% rename from firmware/platforms/apimote1.h rename to firmware/platforms/apimote.h index 082947a..63a8a0a --- a/firmware/platforms/apimote1.h +++ b/firmware/platforms/apimote.h @@ -1,16 +1,8 @@ /*! \file apimote.h \author Ryan Speers - \brief Port descriptions for the GoodFET platform. + \brief Port descriptions for the Apimote platform. */ -/* #ifdef __MSPGCC__ */ -/* #include */ -/* #else */ -/* #include */ -/* #include */ -/* #include */ -/* #endif */ - #ifndef _GNU_ASSEMBLER_ #include #endif @@ -46,9 +38,15 @@ */ -/* TODO what to do here?. Hopefully nothing. + #define INITPLATFORM \ - P1DIR = 0xe0;\ + P2DIR |= BIT0+BIT7; \ + P2OUT &= ~BIT7; \ + P2OUT |= BIT0; \ + P3DIR |= BIT0; + + /* + P1DIR = 0xe0; \ P1OUT = 0x00;\ P2DIR = 0x7b;\ P2OUT = 0x10;\ @@ -60,7 +58,8 @@ P5OUT = 0xff;\ P6DIR = 0xff;\ P6OUT = 0x00; -*/ + */ + //RF Control //TelosB: Radio CS is 38/P4.2 (to CC2420 pin31) -- 2.20.1