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/main.cpp
- Revision:
- 77:c2e22d1e5d44
- Parent:
- 74:a4dacab0d3dd
- Child:
- 79:c825bd2dea81
- Child:
- 80:6e3eb8246ced
--- a/source/main.cpp Fri Apr 06 11:54:14 2018 +0000 +++ b/source/main.cpp Sat Apr 07 17:43:22 2018 +0000 @@ -29,9 +29,9 @@ s_time medicationTime; s_time outputTime; +s_time currentTime; s_medContainer medication; s_medContainer medInventory; -s_time currentTime; int success = 1; @@ -60,15 +60,12 @@ int main() { /* SD write Test*/ - medicationTime.hour = 15; - medicationTime.minute = 30; + + medicationTime = getTime(); - outputTime.day = getTime().day; - outputTime.month = getTime().month; - outputTime.year = getTime().year; - outputTime.hour = getTime().hour; - outputTime.minute = getTime().minute; - + outputTime = getTime(); + + currentTime = getTime(); medication.container[0] = 1; medication.container[1] = 2; @@ -77,20 +74,13 @@ medication.container[4] = 1; medication.container[5] = 2; - medInventory.container[0] = 5; medInventory.container[1] = 10; medInventory.container[2] = 15; medInventory.container[3] = 20; medInventory.container[4] = 25; medInventory.container[5] = 30; - - - currentTime.day = getTime().day; - currentTime.month = getTime().month; - currentTime.year = getTime().year; - currentTime.hour = getTime().hour; - currentTime.minute = getTime().minute; + /************/ pc.baud(460800); @@ -183,7 +173,7 @@ /* Console State Switch */ case 47: printf("\n\rState Switch: Enter next State: \n\r"); - printf("45\tset Time\n\r46\tread Time\n\r47\tState Switch\n\r48\tServo Board Test Tool\n\r49\tenable servo output\n\r50\tdisable servo output\n\r51\ttest SD Card\n\r52\tread medication\n\r53\tMedication display test tool\n\r60\twrite_medProtocol test\n\r61\twrite_medInventory test\n\r62\twrite_medError test\n\r"); + printf("45\tset Time\n\r46\tread Time\n\r47\tState Switch\n\r48\tServo Board Test Tool\n\r49\tenable servo output\n\r50\tdisable servo output\n\r51\ttest SD Card\n\r52\tread medication\n\r53\tMedication display test tool\n\r60\twrite_medProtocol test\n\r61\twrite_medInventory test\n\r62\twrite_medError test\n\r63\terase_errorPotocol test\n\r64\terase_medPotocol\n\r"); pc.scanf("%d", &state); printf("Switch to State %d\n\r",state); fflush(stdin); @@ -348,12 +338,26 @@ case 62: printf("write_medError\n\r"); - write_medError(fail, time); + write_medError(fail, currentTime); printf("done\n\r"); state = 47; break; + + case 63: + printf("erase_errorPotocol\n\r"); + erase_medError(); + state = 47; + + break; + case 64: + printf("erase_medPotocol\n\r"); + erase_medProtocol(); + state = 47; + + break; + default: state = 47; /* Go to State Switch */ break;