Commit c6a58c22 authored by David Johnson's avatar David Johnson

Oops, checked in the wrong version initially. This one is tested and

works.
parent 89031812
// $Id: ElabRadioDumpFH.nc,v 1.1 2005-06-27 17:49:21 johnsond Exp $ // $Id: ElabRadioDumpFH.nc,v 1.3 2005-06-27 22:11:57 johnsond Exp $
/* tab:4 /* tab:4
* "Copyright (c) 2000-2003 The Regents of the University of California. * "Copyright (c) 2000-2003 The Regents of the University of California.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* 94704. Attention: Intel License Inquiry. * 94704. Attention: Intel License Inquiry.
*/ */
/* Author: Phil Buonadonna /* Author: Phil Buonadonna
* Revision: $Id: ElabRadioDumpFH.nc,v 1.1 2005-06-27 17:49:21 johnsond Exp $ * Revision: $Id: ElabRadioDumpFH.nc,v 1.3 2005-06-27 22:11:57 johnsond Exp $
*/ */
/** /**
...@@ -40,11 +40,11 @@ configuration ElabRadioDumpFH { ...@@ -40,11 +40,11 @@ configuration ElabRadioDumpFH {
} }
implementation { implementation {
components Main, ElabRadioDumpFHM, RadioCRCPacket as Comm, components Main, ElabRadioDumpFHM, RadioCRCPacket as Comm,
//UARTNoCRCPacket as UART, //UARTNoCRCPacket as UART,
GenericComm as UART, GenericComm as UART,
LedsC, LedsC,
TimerC; TimerC,
// CC1000ControlM; CC1000ControlM;
//FramerM, UART //FramerM, UART
Main.StdControl -> ElabRadioDumpFHM; Main.StdControl -> ElabRadioDumpFHM;
...@@ -67,7 +67,7 @@ implementation { ...@@ -67,7 +67,7 @@ implementation {
ElabRadioDumpFHM.Leds -> LedsC; ElabRadioDumpFHM.Leds -> LedsC;
ElabRadioDumpFHM.CC1000Control -> Comm; ElabRadioDumpFHM.CC1000Control -> CC1000ControlM;
//FramerM.ByteControl -> UART; //FramerM.ByteControl -> UART;
//FramerM.ByteComm -> UART; //FramerM.ByteComm -> UART;
......
// $Id: ElabRadioDumpFHM.nc,v 1.1 2005-06-27 17:49:22 johnsond Exp $ // $Id: ElabRadioDumpFHM.nc,v 1.2 2005-06-27 22:02:37 johnsond Exp $
/* tab:4 /* tab:4
* "Copyright (c) 2000-2003 The Regents of the University of California. * "Copyright (c) 2000-2003 The Regents of the University of California.
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
*/ */
/* /*
* Author: Phil Buonadonna * Author: Phil Buonadonna
* Revision: $Id: ElabRadioDumpFHM.nc,v 1.1 2005-06-27 17:49:22 johnsond Exp $ * Revision: $Id: ElabRadioDumpFHM.nc,v 1.2 2005-06-27 22:02:37 johnsond Exp $
* *
* *
*/ */
...@@ -77,51 +77,51 @@ implementation ...@@ -77,51 +77,51 @@ implementation
TXFLAG_TOKEN = 0x2 TXFLAG_TOKEN = 0x2
}; };
int freqTableLength = 6; int freqTableLength = 236;
uint32_t freqTable[6] = uint32_t freqTable[236] =
{ {
// 902012557, 902012557,
// 902096400, 902167353, 902280720, 902403600, 902491249, 902608400, 902096400, 902167353, 902280720, 902403600, 902491249, 902608400,
// 902682811, 902734492, 903017877, 903018000, 903301630, 903353066, 902682811, 902734492, 903017877, 903018000, 903301630, 903353066,
// 903427600, 903544506, 903632400, 903755280, 903868769, 903939600, 903427600, 903544506, 903632400, 903755280, 903868769, 903939600,
// 904023320, 904071134, 904246800, 904435907, 904492560, 904597763, 904023320, 904071134, 904246800, 904435907, 904492560, 904597763,
// 904693575, 904861200, 905003046, 905066000, 905124391, 905229840, 904693575, 904861200, 905003046, 905066000, 905124391, 905229840,
// 905363829, 905475600, 905570184, 905651020, 905782800, 905885200, 905363829, 905475600, 905570184, 905651020, 905782800, 905885200,
// 905967120, 906034084, 906090000, 906137323, 906177648, 906704277, 905967120, 906034084, 906090000, 906137323, 906177648, 906704277,
// 906704461, 907230905, 907271600, 907318800, 907374593, 907441680, 906704461, 907230905, 907271600, 907318800, 907374593, 907441680,
// 907523600, 907626000, 907757534, 907838738, 907933200, 908044847, 907523600, 907626000, 907757534, 907838738, 907933200, 908044847,
// 908178960, 908284162, 908342800, 908405877, 908547600, 908715102, 908178960, 908284162, 908342800, 908405877, 908547600, 908715102,
// 908810791, 908916240, 908973015, 909162000, 909337419, 909385356, 908810791, 908916240, 908973015, 909162000, 909337419, 909385356,
// 909469200, 909540154, 909653520, 909776400, 909864048, 909981200, 909469200, 909540154, 909653520, 909776400, 909864048, 909981200,
// 910055611, 910107292, 910390676, 910390800, 910674431, 910725865, 910055611, 910107292, 910390676, 910390800, 910674431, 910725865,
// 910800400, 910917305, 911005200, 911128080, 911241569, 911312400, 910800400, 910917305, 911005200, 911128080, 911241569, 911312400,
// 911396120, 911443933, 911619600, 911808708, 911865360, 911970562, 911396120, 911443933, 911619600, 911808708, 911865360, 911970562,
// 912066374, 912234000, 912375846, 912438800, 912497190, 912602640, 912066374, 912234000, 912375846, 912438800, 912497190, 912602640,
// 912736629, 912848400, 912942985, 913023819, 913155600, 913258000, 912736629, 912848400, 912942985, 913023819, 913155600, 913258000,
// 913339920, 913406883, 913462800, 913510123, 913550447, 914077076, 913339920, 913406883, 913462800, 913510123, 913550447, 914077076,
// 914077262, 914603704, 914644400, 914691600, 914747392, 914814480, 914077262, 914603704, 914644400, 914691600, 914747392, 914814480,
// 914896400, 914998800, 915130333, 915211539, 915306000, 915417647, 914896400, 914998800, 915130333, 915211539, 915306000, 915417647,
// 915551760, 915656961, 915715600, 915778677, 915920400, 916087901, 915551760, 915656961, 915715600, 915778677, 915920400, 916087901,
916183590, 916289040, 916345816, 916534800, 916710218, 916758156, 916183590, 916289040, 916345816, 916534800, 916710218, 916758156,
// 916842000, 916912954, 917026320, 917149200, 917236847, 917354000, 916842000, 916912954, 917026320, 917149200, 917236847, 917354000,
// 917428410, 917480093, 917763475, 917763600, 918047231, 918098665, 917428410, 917480093, 917763475, 917763600, 918047231, 918098665,
// 918173200, 918290104, 918378000, 918500880, 918614370, 918685200, 918173200, 918290104, 918378000, 918500880, 918614370, 918685200,
// 918768919, 918816732, 918992400, 919181508, 919238160, 919343361, 918768919, 918816732, 918992400, 919181508, 919238160, 919343361,
// 919439174, 919606800, 919748647, 919811600, 919869989, 919975440, 919439174, 919606800, 919748647, 919811600, 919869989, 919975440,
// 920109428, 920221200, 920315785, 920396618, 920528400, 920630800, 920109428, 920221200, 920315785, 920396618, 920528400, 920630800,
// 920712720, 920779683, 920835600, 920882924, 920923246, 921449875, 920712720, 920779683, 920835600, 920882924, 920923246, 921449875,
// 921450000, 921450062, 921976503, 922017201, 922064400, 922120192, 921450000, 921450062, 921976503, 922017201, 922064400, 922120192,
// 922187280, 922269200, 922371600, 922503132, 922584339, 922678800, 922187280, 922269200, 922371600, 922503132, 922584339, 922678800,
// 922790446, 922924560, 923029760, 923088400, 923151478, 923293200, 922790446, 922924560, 923029760, 923088400, 923151478, 923293200,
// 923460701, 923556389, 923661840, 923718616, 923907600, 924083017, 923460701, 923556389, 923661840, 923718616, 923907600, 924083017,
// 924130955, 924214800, 924285755, 924399120, 924522000, 924609646, 924130955, 924214800, 924285755, 924399120, 924522000, 924609646,
// 924726800, 924801210, 924852893, 925136274, 925136400, 925420032, 924726800, 924801210, 924852893, 925136274, 925136400, 925420032,
// 925471464, 925546000, 925662903, 925750800, 925873680, 925987170, 925471464, 925546000, 925662903, 925750800, 925873680, 925987170,
// 926058000, 926141719, 926189531, 926365200, 926554309, 926610960, 926058000, 926141719, 926189531, 926365200, 926554309, 926610960,
// 926716160, 926811973, 926979600, 927121447, 927184400, 927242788, 926716160, 926811973, 926979600, 927121447, 927184400, 927242788,
// 927348240, 927482228, 927594000, 927688586, 927769417, 927901200, 927348240, 927482228, 927594000, 927688586, 927769417, 927901200,
// 928003600, 928003600,
}; };
int freqIdx = 0; int freqIdx = 0;
...@@ -174,12 +174,12 @@ implementation ...@@ -174,12 +174,12 @@ implementation
// this gets done in the event handler! // this gets done in the event handler!
atomic { //atomic {
pMsg->data[8] = freqTable[freqIdx]; //pMsg->data[8] = freqTable[freqIdx];
pMsg->data[9] = freqTable[freqIdx] >> 8; //pMsg->data[9] = freqTable[freqIdx] >> 8;
pMsg->data[10] = freqTable[freqIdx] >> 16; //pMsg->data[10] = freqTable[freqIdx] >> 16;
pMsg->data[11] = freqTable[freqIdx] >> 24; //pMsg->data[11] = freqTable[freqIdx] >> 24;
} //}
pMsg->length = (pMsg->length > 12)?pMsg->length:12; pMsg->length = (pMsg->length > 12)?pMsg->length:12;
...@@ -257,10 +257,10 @@ implementation ...@@ -257,10 +257,10 @@ implementation
freqIdx = 0; freqIdx = 0;
#ifndef FH_INTERVAL #ifndef FH_INTERVAL
#define FH_INTERVAL 5120 #define FH_INTERVAL 1024
#endif #endif
//call TimerFH.start(TIMER_REPEAT,FH_INTERVAL); call TimerFH.start(TIMER_REPEAT,FH_INTERVAL);
return rcombine(ok1, ok2); return rcombine(ok1, ok2);
} }
...@@ -407,15 +407,16 @@ implementation ...@@ -407,15 +407,16 @@ implementation
atomic { atomic {
call Leds.greenOn(); call Leds.greenOn();
// freqIdx starts out at -1, so this works. // freqIdx starts out at -1, so this works.
freqIdx = (++freqIdx)%freqTableLength; freqIdx++;
//CC1000Control.stop(); freqIdx = freqIdx%freqTableLength;
call RadioControl.stop();
if (call CC1000Control.TuneManual(freqTable[freqIdx]) == 916710218) { if (call CC1000Control.TuneManual(freqTable[freqIdx]) == 916710218) {
call Leds.redOn(); call Leds.redOn();
} }
else { else {
call Leds.redOff(); call Leds.redOff();
} }
//CC1000Control.start(); call RadioControl.start();
call Leds.greenOff(); call Leds.greenOff();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment