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: SDFileSystem max32630fthr USBDevice
Fork of FTHR_SD_Demo by
Diff: main.cpp
- Revision:
- 21:0f358a702561
- Parent:
- 20:ba06efe24970
- Child:
- 22:fe94be11bae0
--- a/main.cpp Tue Sep 25 21:57:37 2018 +0000
+++ b/main.cpp Tue Sep 25 23:35:07 2018 +0000
@@ -344,7 +344,7 @@
void clear_log_file()
{
- FILE *fp = fopen(settings_file, "w");
+ FILE *fp = fopen(log_file, "w");
if (fp != NULL)
{
fclose(fp);
@@ -657,7 +657,7 @@
fprintf(fp,"%d,0x",j);
for(i=7;i>=0;i--)
{
- fprintf(fp,"%02X",rom_id_list[j][i]);
+ fprintf(fp,"%02X",OT07[j].rom_id[i]);
}
fprintf(fp,"\r\n");
}
@@ -759,7 +759,7 @@
case 'G':
if(n == 2)
{
- //0 means get config, 1 means get log
+ //0 means get config, 1 means get log, 2 means clear log
bool fileExists = false;
if(device == 0)//get config
{
@@ -769,6 +769,11 @@
{
fileExists = print_log_file();
}
+ if(device == 2)//get log
+ {
+ clear_log_file();
+ fileExists = true;
+ }
if(!fileExists)
{
pc.printf("no_file\r\n");
