Commit eabadb5c authored by deroo's avatar deroo
Browse files

fix README typos

parent c6d7af3f
......@@ -21,9 +21,9 @@ flashBytesPerWord
flashNumberOfPages
with the values of 4096, 4 and 256, respectively.
Finally, it declares 2 macros:
Finally, it declares 2 macros:<br>
NANO33BLE_FLASH( \<datatype\>, \<arrayName\>, \<numberOfArrayElements\> )<br>
NANO33BLE_FLASH_LOWEST_PAGE
NANO33BLE_FLASH_LOWEST_PAGE<br>
which are described below.
This code is most useful for implementing non-volatile arrays,
......@@ -65,7 +65,7 @@ Thus, if you need to erase all the pages your sketch is using in order to initia
Valid datatypes include structs and typedefs, in addition to the predefined C datatypes. Structs appear to default to multiples of flash words, so the programmer's attention to alignment issues does not appear to be neccessary.
Some limitations: the sizeof operator on any array declared in flash will always return 4 (=flashBytesPerWord). Also, C string functions like strcpy and strlen do not always work as one would expect to manipulate the arrays in flash, 'tho memcpy and strcpy do work to copy the contents out of flash, and memcpy does work to copy into flash, but the number of bytes should be a multple of flashBytesPerWord. I recommend using macros (ie. #define) or variables to declare the number of array elements as the sketch cannot figure out by itself how big a flash array has been declared after the declaration.
Some limitations: the sizeof operator on any array declared in flash will always return 4 (=flashBytesPerWord). Also, C string functions like strcpy and strlen do not always work as one would expect to manipulate the arrays in flash, 'tho memcpy and strcpy do work to copy the contents out of flash, and memcpy does work to copy into flash, but the number of bytes should be a multple of flashBytesPerWord. I recommend using macros (ie. #define) or variables to declare the number of array elements as the sketch cannot easily figure out by itself how big a flash array has been declared after the declaration.
If you want more control over the details of the declarations in flash,
declare arrays in flash using pointers:<br>
......
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