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: MFRC522 NRF2401P SDFileSystem SPI_TFT_ILI9341 TFT_fonts mbed
Fork of Song_Control by
Revision 9:72e93d9ddc8c, committed 2016-02-29
- Comitter:
- dxyang
- Date:
- Mon Feb 29 14:53:35 2016 +0000
- Parent:
- 8:b40c4553f6d4
- Commit message:
- added posh logging
Changed in this revision
| hub.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/hub.cpp Mon Feb 29 14:38:13 2016 +0000
+++ b/hub.cpp Mon Feb 29 14:53:35 2016 +0000
@@ -115,7 +115,10 @@
hubAction_ThreeBatteryDropped,
hubAction_OneBatteryPicked,
hubAction_TwoBatteryPicked,
- hubAction_ThreeBatteryPicked
+ hubAction_ThreeBatteryPicked,
+ hubAction_OneKiloPosho,
+ hubAction_TwoKiloPosho,
+ hubAction_ThreeKiloPosho
};
// any rfid can log errors regarding an unknown tag being read
@@ -532,31 +535,40 @@
// append relevant information for action
switch (action) {
case hubAction_BatteryRfidScanned:
- strcat(logLine, " R B ");
+ strcat(logLine, " RB ");
break;
case hubAction_PoshoRfidScanned:
- strcat(logLine, " R P ");
+ strcat(logLine, " RP ");
break;
case hubAction_Exit:
strcat(logLine, " X ");
break;
case hubAction_OneBatteryDropped:
- strcat(logLine, " D 1 ");
+ strcat(logLine, " BD 1 ");
break;
case hubAction_TwoBatteryDropped:
- strcat(logLine, " D 2 ");
+ strcat(logLine, " BD 2 ");
break;
case hubAction_ThreeBatteryDropped:
- strcat(logLine, " D 3 ");
+ strcat(logLine, " BD 3 ");
break;
case hubAction_OneBatteryPicked:
- strcat(logLine, " P 1 ");
+ strcat(logLine, " BP 1 ");
break;
case hubAction_TwoBatteryPicked:
- strcat(logLine, " P 2 ");
+ strcat(logLine, " BP 2 ");
break;
case hubAction_ThreeBatteryPicked:
- strcat(logLine, " P 3 ");
+ strcat(logLine, " BP 3 ");
+ break;
+ case hubAction_OneKiloPosho:
+ strcat(logLine, " PO 1 ");
+ break;
+ case hubAction_TwoKiloPosho:
+ strcat(logLine, " PO 2 ");
+ break;
+ case hubAction_ThreeKiloPosho:
+ strcat(logLine, " PO 3 ");
break;
}
@@ -1112,16 +1124,18 @@
*/
void poshoSerialUse(int numKilograms, int userIndex) {
flagPoshoAlreadyInUseH = 1;
-
switch (numKilograms) {
case 1:
tickPoshoInUseClearH.attach(&interruptPoshoInUseClearH, (float)timeForOneKgH);
+ logActionWithUserInfoH(hubAction_OneKiloPosho, userIndex);
break;
case 2:
tickPoshoInUseClearH.attach(&interruptPoshoInUseClearH, (float)timeForTwoKgH);
+ logActionWithUserInfoH(hubAction_TwoKiloPosho, userIndex);
break;
case 3:
tickPoshoInUseClearH.attach(&interruptPoshoInUseClearH, (float)timeForThreeKgH);
+ logActionWithUserInfoH(hubAction_ThreeKiloPosho, userIndex);
break;
}
allUsersH[userIndex].accountCredit -= numKilograms*poshoPricePerKgH;
