[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/printf PrintfP.nc, 1.8,
1.9 printf.h, 1.7, 1.8
Kevin Klues
klueska at users.sourceforge.net
Mon Sep 3 13:29:10 PDT 2007
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tools/tinyos/misc
tos-write-buildinfo.in, 1.5, 1.6
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/doc/html/tutorial lesson16.html,
NONE, 1.1 index.html, 1.6, 1.7 lesson15.html, 1.7,
1.8 lesson8.html, 1.6, 1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/printf
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15055
Modified Files:
PrintfP.nc printf.h
Log Message:
Update to allow buffer size to be changed at compile time
Index: PrintfP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/printf/PrintfP.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PrintfP.nc 20 Aug 2007 06:09:11 -0000 1.8
--- PrintfP.nc 3 Sep 2007 20:29:08 -0000 1.9
***************
*** 70,79 ****
S_FLUSHING,
};
!
message_t printfMsg;
nx_uint8_t buffer[PRINTF_BUFFER_SIZE];
norace nx_uint8_t* next_byte;
uint8_t state = S_STOPPED;
! uint8_t bytes_left_to_flush;
uint8_t length_to_send;
--- 70,79 ----
S_FLUSHING,
};
!
message_t printfMsg;
nx_uint8_t buffer[PRINTF_BUFFER_SIZE];
norace nx_uint8_t* next_byte;
uint8_t state = S_STOPPED;
! uint32_t bytes_left_to_flush;
uint8_t length_to_send;
***************
*** 87,91 ****
length_to_send = (bytes_left_to_flush < sizeof(printf_msg_t)) ? bytes_left_to_flush : sizeof(printf_msg_t);
memset(m->buffer, 0, sizeof(printf_msg_t));
! memcpy(m->buffer, (uint8_t*)next_byte, length_to_send);
if(call AMSend.send(AM_BROADCAST_ADDR, &printfMsg, sizeof(printf_msg_t)) != SUCCESS)
post retrySend();
--- 87,91 ----
length_to_send = (bytes_left_to_flush < sizeof(printf_msg_t)) ? bytes_left_to_flush : sizeof(printf_msg_t);
memset(m->buffer, 0, sizeof(printf_msg_t));
! memcpy(m->buffer, (nx_uint8_t*)next_byte, length_to_send);
if(call AMSend.send(AM_BROADCAST_ADDR, &printfMsg, sizeof(printf_msg_t)) != SUCCESS)
post retrySend();
Index: printf.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/printf/printf.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** printf.h 20 Aug 2007 16:43:43 -0000 1.7
--- printf.h 3 Sep 2007 20:29:08 -0000 1.8
***************
*** 31,34 ****
--- 31,38 ----
#define PRINTF_H
+ #ifndef PRINTF_BUFFER_SIZE
+ #define PRINTF_BUFFER_SIZE 250
+ #endif
+
#ifdef _H_msp430hardware_h
#include <stdio.h>
***************
*** 39,44 ****
#include "message.h"
- #define PRINTF_BUFFER_SIZE 250
-
typedef nx_struct printf_msg {
nx_uint8_t buffer[TOSH_DATA_LENGTH];
--- 43,46 ----
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tools/tinyos/misc
tos-write-buildinfo.in, 1.5, 1.6
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/doc/html/tutorial lesson16.html,
NONE, 1.1 index.html, 1.6, 1.7 lesson15.html, 1.7,
1.8 lesson8.html, 1.6, 1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list