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.
Diff: Memory.cpp
- Revision:
- 8:6af25b9563df
- Parent:
- 6:c11cb6709b8b
- Child:
- 9:2587f246bf48
--- a/Memory.cpp Thu Dec 22 22:16:11 2016 +0000
+++ b/Memory.cpp Sun Apr 15 23:19:56 2018 +0000
@@ -11,12 +11,15 @@
*If length is greater than BufferSize (3840 bytes) the function will terminate
*and return the start address.
*/
-int Memory::readData(SPI my_spi, char value [], int Address, int length)
+int Memory::readData(SPI my_spi, short value [], int Address, int length)
{
- if(length>bufferSize) {
- printf("\nLength %i exceeds Max Length\n",length);
- return Address;
- }
+ //if(length>bufferSize) {
+ //printf("\nLength %i exceeds Max Length\n",length);
+ //return Address;
+ //}
+ int temp = 0;
+ int temp1 = 0;
+ int temp2 =0;
_cs_mem = 1; //Ensure cs is deselected
wait_us(10);
_cs_mem = 0; //memory is selected
@@ -27,7 +30,9 @@
for(int i =0; i <length; i++) {
- value[i]= my_spi.write(dummy);//Send dummy byte to read out value ate Address
+ temp = my_spi.write(dummy);//Send dummy byte to read out value ate Address
+ value[i]= (temp);
+ //printf(" %X",value[i]);
Address++;
}
_cs_mem = 1;
@@ -144,3 +149,4 @@
return address;
}
+