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 mbed
Fork of PES4_Programme by
Diff: source/sdcard.cpp
- Revision:
- 56:218601547d13
- Parent:
- 55:bdab541f434d
- Child:
- 57:79fed71031da
--- a/source/sdcard.cpp Fri Mar 30 13:05:13 2018 +0000
+++ b/source/sdcard.cpp Sat Mar 31 15:53:13 2018 +0000
@@ -187,18 +187,18 @@
break;
default:
printf("reading medication %d...",(linecounter-1));
- int moment[4];
+ int daycounter = (linecounter-2)/4;
+ int momentcounter = (linecounter-2)%4;
+
+ userfile.medication.day[daycounter].moment[momentcounter].time.hour = atoi(strtok(string, TOKEN));;
+ userfile.medication.day[daycounter].moment[momentcounter].time.minute = atoi(strtok(NULL, TOKEN));;
+ userfile.medication.day[daycounter].moment[momentcounter].timeOffsetMinus = atoi(strtok(NULL, TOKEN));;
+ userfile.medication.day[daycounter].moment[momentcounter].timeOffsetPlus = atoi(strtok(NULL, TOKEN));;
+ int medication = atoi(strtok(NULL, TOKEN));
- moment[0] = atoi(strtok(string, TOKEN));
- moment[1] = atoi(strtok(NULL, TOKEN));
- moment[2] = atoi(strtok(NULL, TOKEN));
- moment[3] = atoi(strtok(NULL, TOKEN));
-
- for(int i = 0; i<4; i++) {
- for( int ii = 0; ii<6; ii++) {
- userfile.medication.day[linecounter-2].moment[i].medContainer.container[ii] = moment[i] % 10;
- moment[i] = moment[i]/10;
- }
+ for( int ii = 0; ii<6; ii++) {
+ userfile.medication.day[daycounter].moment[momentcounter].medContainer.container[5-ii] = medication % 10;
+ medication = medication/10;
}
printf("done!\r\n");
break;
