Yes.
Following the examples given in the CC1000 radio stack - TinyOS 1.x uses
"static const prog_uchar ..." to define the array stored into program
memory, and then PRG_RDB(&..) reads in a byte from program memory.
TinyOS 2.x uses "static const_uint8_t ..." to define the array stored in
program memory, and then "read_uint8_t(&..) reads it back in.
I'm not sure where these two macros are defined.
In TinyOS 1.x:
static const prog_uchar CC1K_LPL_PreambleLength[CC1K_LPL_STATES*2] = {
...
};
void setPreambleLength() {
uint16_t len =
(uint16_t)PRG_RDB(&CC1K_LPL_PreambleLength[lplTxPower * 2]) << 8
| PRG_RDB(&CC1K_LPL_PreambleLength[lplTxPower * 2 + 1]);
call ByteRadio.setPreambleLength(len);
}
In TinyOS 2.x:
static const_uint8_t CC1K_LPL_PreambleLength[CC1K_LPL_STATES*2] = {
...
};
void setPreambleLength() {
uint16_t len =
(uint16_t)read_uint8_t(&CC1K_LPL_PreambleLength[lplTxPower * 2]) << 8
| read_uint8_t(&CC1K_LPL_PreambleLength[lplTxPower * 2 + 1]);
call ByteRadio.setPreambleLength(len);
}
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of jose m
Sent: Tuesday, September 12, 2006 11:48 AM
To: [email protected]
Subject: [Tinyos-help] Constant structures resident in flash
I see this declaration:
static const prog_uchar
CC1K_LPL_PreambleLength[CC1K_LPL_STATES*2]
it say that is a constant defined on flash (only
read). I want to do the same thing for save memory, so
"static const" is enough, and the use the PRG_RDB
macro. Yes? where is defined this macro?
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help