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.
Diff: HbUserOpe.cpp
- Revision:
- 23:79e20be4bc5b
- Parent:
- 22:24c9c2dedca9
- Child:
- 26:732bc37fbefd
diff -r 24c9c2dedca9 -r 79e20be4bc5b HbUserOpe.cpp
--- a/HbUserOpe.cpp Thu Dec 06 11:03:13 2018 +0000
+++ b/HbUserOpe.cpp Sat Dec 08 12:08:25 2018 +0000
@@ -18,4 +18,25 @@
oldOpe = curOpe;
curOpe.w = fpgaGetUserSw();
return curOpe;
-}
\ No newline at end of file
+}
+bool HbUserOpe::ChkCtrlSW(SW_TYPE styp)
+{
+ if(styp == ACCEL_R){return curOpe.bf.axl_r;}
+ else if(styp == ACCEL_L){return curOpe.bf.axl_l;}
+ else if(styp == STOP){return curOpe.bf.stop;}
+ else if(styp == YAW_CTRL){return curOpe.bf.y_ctrl;}
+ else/*if(styp == ENG_STOP)*/{return curOpe.bf.eng_stop;}
+// UINT16 mask = 0x1 << styp;
+// return curOpe.w & mask;
+}
+bool HbUserOpe::ChkCtrlSwAny()
+{
+ UINT16 mask = 0x1;
+ for(int i = 0; i < 5; ++i){
+ if(curOpe.w & mask){
+ return true;
+ }
+ mask = mask << 1;
+ }
+ return false;
+}