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: ELEC350_Project2 SDcard
Revision 14:8e92eb9fc088, committed 2018-12-28
- Comitter:
- Swabey89
- Date:
- Fri Dec 28 12:05:03 2018 +0000
- Parent:
- 13:5f786448e883
- Child:
- 15:e1f62dd17e3c
- Commit message:
- Updates
Changed in this revision
| SDCard.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/SDCard.cpp Fri Dec 28 10:03:52 2018 +0000
+++ b/SDCard.cpp Fri Dec 28 12:05:03 2018 +0000
@@ -3,7 +3,7 @@
void SDcard(void)
{
- SD_tout.attach(SD_toutISR,TOUT_TIME);
+ SD_tout.attach(SD_toutISR,TOUT_TIME_DEF);
static time_t seconds; //static reqiured?
@@ -58,7 +58,7 @@
void SDread(int n)
{
- SD_tout.attach(SD_toutISR,TOUT_TIME);
+ SD_tout.attach(SD_toutISR,TOUT_TIME_SDREAD);
//Read n samples from the SD card
unsigned int i=0;
unsigned int j = newestIndex;
@@ -80,7 +80,7 @@
void SDdelete(int n) //MUST RELEASE SPACE AVAILABLE
{
- SD_tout.attach(SD_toutISR,TOUT_TIME);
+ SD_tout.attach(SD_toutISR,TOUT_TIME_DEF);
//Delete n samples from the SD card
unsigned int i = 0;
if (n==-1) {n = (BUFFERSIZE-Nspaces);}
@@ -122,23 +122,22 @@
{
Thread::signal_wait(SIGNAL_SD);
- SD_tout.attach(SD_toutISR,TOUT_TIME);
+ SD_tout.attach(SD_toutISR,TOUT_TIME_SDMOUNT);
if (sd_init)
{
fclose(fp);
sd.deinit();
+ sd_init = false;
printlock.lock();
pc->printf("SD CARD UNMOUNTED\n\r");
printlock.unlock();
LCDlock.lock();
lcd.cls();
- lcd.printf("Unmounted..");
- Thread::wait(5000);
- LCDlock.unlock();
-
- sd_init = false;
+ lcd.printf("SD UNMOUNTED..");
+ Thread::wait(5000); //Dont like this
+ LCDlock.unlock();
}
else
@@ -148,13 +147,13 @@
lcd.cls();
if (sd_init)
{
- lcd.printf("SD mounted..");
+ lcd.printf("SD MOUNTED..");
}
else
{
lcd.printf("SD FAILED..");
}
- Thread::wait(5000);
+ Thread::wait(5000); //Dont like this
LCDlock.unlock();
}
SD_tout.detach();
