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: FlashMemory/FlashManager.cpp
- Revision:
- 38:18ac0f8628bf
- Parent:
- 37:d16ff13edcb2
--- a/FlashMemory/FlashManager.cpp Tue Mar 21 05:50:52 2017 +0000
+++ b/FlashMemory/FlashManager.cpp Wed Mar 22 06:59:44 2017 +0000
@@ -91,11 +91,8 @@
for(int sector = start_sector; sector <= end_sector; sector++) {
// bufferに一時退避させ,sector削除
- pc.putc('a');
vector<uint8_t> write_buf = readSector(sector);
- pc.putc('b');
sectorErase(sector);
- pc.putc('c');
// write_bufの書き換え
for(int i = 0; i < write_buf.size(); i++) {
@@ -104,11 +101,9 @@
write_buf[i] = data[data_index];
}
}
- pc.putc('d');
// 変更したwrite_bufをページ単位でメモリ書き込み
for(int page = 0; page < (write_buf.size() + PAGE_SIZE - 1) / PAGE_SIZE; page++) {
- pc.printf("%d",page);
int length = min(write_buf.size() - page*PAGE_SIZE , PAGE_SIZE);
m_mx25r.writeEnable(); // send WREN 1st
m_mx25r.programPage(sector * SECTOR_SIZE + page*PAGE_SIZE, &write_buf[page*PAGE_SIZE], length);
@@ -134,11 +129,9 @@
void FlashManager::sectorErase(int sector)
{
- pc.putc('s');
m_mx25r.writeEnable() ; // send WREN 1st
m_mx25r.sectorErase(sector * SECTOR_SIZE) ;
do {
- pc.putc('.');
wait_ms(TIME_SE);
} while(isBusyInWriting()); // end poll
}