Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed commands BLE_API nRF51822
Diff: Storage.cpp
- Revision:
- 5:46947b447701
- Parent:
- 4:2a5a08b14539
- Child:
- 6:75263c93daf7
diff -r 2a5a08b14539 -r 46947b447701 Storage.cpp
--- a/Storage.cpp Wed Jun 03 15:10:45 2015 +0000
+++ b/Storage.cpp Sun Jun 07 14:11:26 2015 +0000
@@ -8,8 +8,8 @@
Storage::Storage()
{
cs = 1;
- spi.format(8,0);
- spi.frequency(200000);
+ spi.format(8,3);
+ spi.frequency(150000);
}
Storage* Storage::getInstance()
@@ -38,20 +38,6 @@
cs = 0;
spi.write(0x06);
cs = 1;
- /*
- wait(0.001);
-
- cs = 0;
- spi.write(0x05);
-
- if(spi.write(0x00) & 0x2) {
- cs = 1;
- return true;
- } else {
- cs = 1;
- return false;
- }
- */
}
//for debug
@@ -171,7 +157,7 @@
cs = 0;
spi.write(0xDC);
- char bytes[4];
+ char bytes[4] = {0,0,0,0};
bytes[0] = (addr >> 24) & 0xff;
bytes[1] = (addr >> 16) & 0xff;
bytes[2] = (addr >> 8) & 0xff;
@@ -184,4 +170,3 @@
cs = 1;
}
-