Hi,
First off, thanks to the people who help out on this list! You guys are great :)
I'm having a little difficulty understanding the BlockWrite interface. The
documentation states that between power cycles, no block may be written to more
than once. So, let's say I have a small struct at the beginning of my memory,
defined as:
struct mystruct
{
uint32_t myValue1;
uint32_t myValue2;
} mystruct;
And I'm writing to MYBASE_ADDRESS.
Does this mean that in order to do successive calls of
BlockWrite.write(MYBASE_ADDRESS, &mystruct, sizeof(mystruct)) I have to first
call BlockWrite.erase()? If so, this seems like a bad implementation-- what if
I wanted to have more items written to the memory? For instance, say I kept
writing mystructs at MYBASE_ADDRESS + offset * number of mystructs, and I
needed them to be persistent across reboots. I would lose them to effect this
one write.
Would I first need to copy out all of the data I wanted to save, change
mystruct (at whichever address I wanted to change), and then write the whole
thing back? This also seems problematic.
Could someone help me understand what is the "proper" way to go about this?
Also, if someone could help me understand why only one write cycle is allowed
between successive power cycles, I'd greatly appreciate it :)
Thanks for your time!
-Max_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help