[Tinyos-2-commits] CVS: tinyos-2.x/apps/MultihopOscilloscope
MultihopOscilloscopeC.nc, 1.1.2.1, 1.1.2.2
Kyle Jamieson
kasj78 at users.sourceforge.net
Thu Jun 29 01:22:34 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/apps/MultihopOscilloscope
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26792
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
MultihopOscilloscopeC.nc
Log Message:
finished echoing to the uart.
Index: MultihopOscilloscopeC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MultihopOscilloscope/Attic/MultihopOscilloscopeC.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** MultihopOscilloscopeC.nc 26 Jun 2006 17:33:44 -0000 1.1.2.1
--- MultihopOscilloscopeC.nc 29 Jun 2006 08:22:31 -0000 1.1.2.2
***************
*** 43,46 ****
--- 43,47 ----
implementation {
+ task void uartSendTask();
static void startTimer();
static void fatal_problem();
***************
*** 49,54 ****
static void report_received();
message_t sendbuf;
! bool sendbusy;
/* Current local state - interval, version and accumulated readings */
--- 50,57 ----
static void report_received();
+ uint8_t uartlen;
message_t sendbuf;
! message_t uartbuf;
! bool sendbusy=FALSE, uartbusy=FALSE;
/* Current local state - interval, version and accumulated readings */
***************
*** 117,124 ****
event message_t*
Receive.receive(message_t* msg, void *payload, uint8_t len) {
! // XXX TODO XXX
return msg;
}
//
// Overhearing other traffic in the network.
--- 120,138 ----
event message_t*
Receive.receive(message_t* msg, void *payload, uint8_t len) {
! if (uartbusy == FALSE) {
! uartbusy = TRUE;
! uartlen = len;
! memcpy(&uartbuf, msg, sizeof(message_t));
! post uartSendTask();
! }
!
return msg;
}
+ task void uartSendTask() {
+ if (call SerialSend.send(0xffff, &uartbuf, uartlen) != SUCCESS) {
+ uartbusy = FALSE;
+ }
+ }
//
// Overhearing other traffic in the network.
***************
*** 192,195 ****
--- 206,210 ----
event void SerialSend.sendDone(message_t *msg, error_t error) {
+ uartbusy = FALSE;
}
More information about the Tinyos-2-commits
mailing list