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.
Dependents: BlackBoard_Firmware_Fast_read_not_test
Fork of Memory by
Diff: Memory.cpp
- Revision:
- 5:2fa79108a29b
- Parent:
- 4:bb4fd1147054
- Child:
- 10:96b5e7dcc91f
--- a/Memory.cpp Thu Feb 09 00:51:57 2017 +0000
+++ b/Memory.cpp Thu Feb 09 03:51:48 2017 +0000
@@ -173,7 +173,21 @@
}
_cs_mem = 1;
- wait_ms(50);//wait for command transfer
+ wait_us(10);//wait for command transfer
+
+ //Enable the memory for wiring. This segment is only required if not writing to the start of a page.
+ if(addressNew%256!=0){
+ _cs_mem=1;
+ _cs_mem=0; //Selet memory
+ my_spi.write(06); //Set Write Enable flag in the status reg
+ _cs_mem=1; //Deslect memory
+ wait_us(10);
+ _cs_mem=0; //Selet memory
+ my_spi.write(0x02); //Send write comand
+ my_spi.write(addressNew>>16); //Send high address byte
+ my_spi.write(addressNew>>8); //Send middle adress byte
+ my_spi.write(addressNew); //Send low address
+ }
for(int i =0; i<length; i++) {
if(addressNew%256==0) { //Handle start and end of pages
