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:
- 54:283bb711e0fa
- Parent:
- 53:b09c062cc31c
- Child:
- 57:56b7e66a0c3d
diff -r b09c062cc31c -r 283bb711e0fa HbUserOpe.cpp
--- a/HbUserOpe.cpp Mon Mar 04 04:03:23 2019 +0000
+++ b/HbUserOpe.cpp Mon Mar 04 07:50:11 2019 +0000
@@ -138,69 +138,46 @@
bool HbUserOpe::ChkCtrlSwRiseEdge(SW_TYPE styp)
{
- if(counter[styp].bf.flg){
- ++counter[styp].bf.cnt;
- if(counter[styp].bf.cnt > CNT_NUM_RE){
- counter[styp].bf.cnt = 0;
- counter[styp].bf.flg = false;
- }
- return false;
- } else{
- if(styp == BRK_L) return counter[BRK_L].bf.flg = curOpe.bf.brk_l && !oldOpe.bf.brk_l;
- if(styp == BRK_R) return counter[BRK_R].bf.flg = curOpe.bf.brk_r && !oldOpe.bf.brk_r;
- if(styp == FLT_ON) return counter[FLT_ON].bf.flg = curOpe.bf.flt_on && !oldOpe.bf.flt_on;
- if(styp == FLT_OFF) return counter[FLT_OFF].bf.flg = curOpe.bf.flt_off && !oldOpe.bf.flt_off;
- if(styp == F_ENG_UP) return counter[F_ENG_UP].bf.flg = curOpe.bf.f_eng_up && !oldOpe.bf.f_eng_up;
- if(styp == F_ENG_DOWN) return counter[F_ENG_DOWN].bf.flg = curOpe.bf.f_eng_down && !oldOpe.bf.f_eng_down;
- if(styp == R_ENG_UP) return counter[R_ENG_UP].bf.flg = curOpe.bf.r_eng_up && !oldOpe.bf.r_eng_up;
- if(styp == R_ENG_DOWN) return counter[R_ENG_DOWN].bf.flg = curOpe.bf.r_eng_down && !oldOpe.bf.r_eng_down;
- if(styp == R_1) return counter[R_1].bf.flg = curOpe.bf.rsv_1 && !oldOpe.bf.rsv_1;
- if(styp == ALL_STOP) return counter[ALL_STOP].bf.flg = curOpe.bf.all_stop && !oldOpe.bf.all_stop;
- return false;
- }
-
- // if(styp == BRK_L)
- // {
- // return curOpe.bf.brk_l && !oldOpe.bf.brk_l;
- // }
- // else if(styp == BRK_R)
- // {
- // return curOpe.bf.brk_r && !oldOpe.bf.brk_r;
- // }
- // else if(styp == FLT_ON)
- // {
- // return curOpe.bf.flt_on && !oldOpe.bf.flt_on;
- // }
- // else if(styp == FLT_OFF)
- // {
- // return curOpe.bf.flt_off && !oldOpe.bf.flt_off;
- // }
- // else if(styp == F_ENG_UP)
- // {
- // return curOpe.bf.f_eng_up && !oldOpe.bf.f_eng_up;
- // }
- // else if(styp == F_ENG_DOWN)
- // {
- // return curOpe.bf.f_eng_down && !oldOpe.bf.f_eng_down;
- // }
- // else if(styp == R_ENG_UP)
- // {
- // return curOpe.bf.r_eng_up && !oldOpe.bf.r_eng_up;
- // }
- // else if(styp == R_ENG_DOWN)
- // {
- // return curOpe.bf.r_eng_down && !oldOpe.bf.r_eng_down;
- // }
- // else if(styp == R_1)
- // {
- // return curOpe.bf.rsv_1 && !oldOpe.bf.rsv_1;
- // }
- // else if(styp == ALL_STOP)
- // {
- // return curOpe.bf.all_stop && !oldOpe.bf.all_stop;
- // }
- // else
- // {
+ // if(counter[styp].bf.flg){
+ // ++counter[styp].bf.cnt;
+ // if(styp == BRK_L){ if(!curOpe.bf.brk_l && oldOpe.bf.brk_l){ counter[styp].bf.cnt = 0; } }
+ // if(styp == BRK_R){ if(!curOpe.bf.brk_r && oldOpe.bf.brk_r){ counter[styp].bf.cnt = 0; } }
+ // if(styp == FLT_ON){ if(!curOpe.bf.flt_on && oldOpe.bf.flt_on){ counter[styp].bf.cnt = 0; } }
+ // if(styp == FLT_OFF){ if(!curOpe.bf.flt_off && oldOpe.bf.flt_off){ counter[styp].bf.cnt = 0; } }
+ // if(styp == F_ENG_UP){ if(!curOpe.bf.f_eng_up && oldOpe.bf.f_eng_up){ counter[styp].bf.cnt = 0; } }
+ // if(styp == F_ENG_DOWN){ if(!curOpe.bf.f_eng_down && oldOpe.bf.f_eng_down){ counter[styp].bf.cnt = 0; } }
+ // if(styp == R_ENG_UP){ if(!curOpe.bf.r_eng_up && oldOpe.bf.r_eng_up){ counter[styp].bf.cnt = 0; } }
+ // if(styp == R_ENG_DOWN){ if(!curOpe.bf.r_eng_down && oldOpe.bf.r_eng_down){ counter[styp].bf.cnt = 0; } }
+ // if(styp == R_1){ if(!curOpe.bf.rsv_1 && oldOpe.bf.rsv_1){ counter[styp].bf.cnt = 0; } }
+ // if(styp == ALL_STOP){ if(!curOpe.bf.all_stop && oldOpe.bf.all_stop){ counter[styp].bf.cnt = 0; } }
+ // if(counter[styp].bf.cnt > CNT_NUM_RE){
+ // counter[styp].bf.cnt = 0;
+ // counter[styp].bf.flg = false;
+ // }
+ // return false;
+ // } else{
+ // if(styp == BRK_L) return counter[BRK_L].bf.flg = curOpe.bf.brk_l && !oldOpe.bf.brk_l;
+ // if(styp == BRK_R) return counter[BRK_R].bf.flg = curOpe.bf.brk_r && !oldOpe.bf.brk_r;
+ // if(styp == FLT_ON) return counter[FLT_ON].bf.flg = curOpe.bf.flt_on && !oldOpe.bf.flt_on;
+ // if(styp == FLT_OFF) return counter[FLT_OFF].bf.flg = curOpe.bf.flt_off && !oldOpe.bf.flt_off;
+ // if(styp == F_ENG_UP) return counter[F_ENG_UP].bf.flg = curOpe.bf.f_eng_up && !oldOpe.bf.f_eng_up;
+ // if(styp == F_ENG_DOWN) return counter[F_ENG_DOWN].bf.flg = curOpe.bf.f_eng_down && !oldOpe.bf.f_eng_down;
+ // if(styp == R_ENG_UP) return counter[R_ENG_UP].bf.flg = curOpe.bf.r_eng_up && !oldOpe.bf.r_eng_up;
+ // if(styp == R_ENG_DOWN) return counter[R_ENG_DOWN].bf.flg = curOpe.bf.r_eng_down && !oldOpe.bf.r_eng_down;
+ // if(styp == R_1) return counter[R_1].bf.flg = curOpe.bf.rsv_1 && !oldOpe.bf.rsv_1;
+ // if(styp == ALL_STOP) return counter[ALL_STOP].bf.flg = curOpe.bf.all_stop && !oldOpe.bf.all_stop;
// return false;
// }
+
+ if (styp == BRK_L) { return curOpe.bf.brk_l && !oldOpe.bf.brk_l; }
+ else if(styp == BRK_R) { return curOpe.bf.brk_r && !oldOpe.bf.brk_r; }
+ else if(styp == FLT_ON) { return curOpe.bf.flt_on && !oldOpe.bf.flt_on; }
+ else if(styp == FLT_OFF) { return curOpe.bf.flt_off && !oldOpe.bf.flt_off; }
+ else if(styp == F_ENG_UP) { return curOpe.bf.f_eng_up && !oldOpe.bf.f_eng_up; }
+ else if(styp == F_ENG_DOWN) { return curOpe.bf.f_eng_down && !oldOpe.bf.f_eng_down; }
+ else if(styp == R_ENG_UP) { return curOpe.bf.r_eng_up && !oldOpe.bf.r_eng_up; }
+ else if(styp == R_ENG_DOWN) { return curOpe.bf.r_eng_down && !oldOpe.bf.r_eng_down; }
+ else if(styp == R_1) { return curOpe.bf.rsv_1 && !oldOpe.bf.rsv_1; }
+ else if(styp == ALL_STOP) { return curOpe.bf.all_stop && !oldOpe.bf.all_stop; }
+ else { return false; }
}