projects
/
hackover2013-badge-firmware.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
First commit
[hackover2013-badge-firmware.git]
/
tools
/
examples
/
spiflash
/
erase_write_read
/
main.c
diff --git
a/tools/examples/spiflash/erase_write_read/main.c
b/tools/examples/spiflash/erase_write_read/main.c
index
76fb3c4
..
b2eb131
100644
(file)
--- a/
tools/examples/spiflash/erase_write_read/main.c
+++ b/
tools/examples/spiflash/erase_write_read/main.c
@@
-42,7
+42,7
@@
#include "core/gpio/gpio.h"
#include "core/systick/systick.h"
#include "core/gpio/gpio.h"
#include "core/systick/systick.h"
-#include "drivers/spiflash/spiflash.h"
+#include "drivers/s
torage/s
piflash/spiflash.h"
#ifdef CFG_INTERFACE
#include "core/cmd/cmd.h"
#ifdef CFG_INTERFACE
#include "core/cmd/cmd.h"
@@
-88,7
+88,7
@@
int main(void)
}
}
}
}
- printf("Writing 8 bytes to page 0
(bytes 0..7
)\r\n");
+ printf("Writing 8 bytes to page 0
starting at address 0x04 (byte 5
)\r\n");
buffer[0] = 0x12;
buffer[1] = 0x34;
buffer[2] = 0x56;
buffer[0] = 0x12;
buffer[1] = 0x34;
buffer[2] = 0x56;
@@
-97,7
+97,7
@@
int main(void)
buffer[5] = 0xCD;
buffer[6] = 0xEF;
buffer[7] = 0xAA;
buffer[5] = 0xCD;
buffer[6] = 0xEF;
buffer[7] = 0xAA;
- error = spiflashWritePage (0, buffer, 8);
+ error = spiflashWritePage (0
x04
, buffer, 8);
if (error)
{
// Check what went wrong
if (error)
{
// Check what went wrong
@@
-131,6
+131,14
@@
int main(void)
buffer[5] = 0;
buffer[6] = 0;
buffer[7] = 0;
buffer[5] = 0;
buffer[6] = 0;
buffer[7] = 0;
+ buffer[8] = 0;
+ buffer[9] = 0;
+ buffer[10] = 0;
+ buffer[11] = 0;
+ buffer[12] = 0;
+ buffer[13] = 0;
+ buffer[14] = 0;
+ buffer[15] = 0;
error = spiflashReadBuffer (0, buffer, 16);
if (error)
{
error = spiflashReadBuffer (0, buffer, 16);
if (error)
{
This page took
0.031027 seconds
and
4
git commands to generate.