I need small logical implementation for this code.
I have 8 fault.below are order of fault.
F1-> First F2->Sec F3->3rd F4->4th
In have shared part of it. below code working as mentioned
Latest fault F4 or 4th fault flicker 100% rate
PREV1 fault F3 or 3rd fault flicker 50% rate
PREV2fault F2 or2nd fault flicker steady
First fault F1 or1st fault flicker steady
but expected to work like this.
First fault F1 or 1st fault flicker 100%
Sec fault F2-> steady
third fault f3-> steady
4th fault f4 -> steady
This should be true if fault given in any order. First fault should flicker ,subsequent fault should be steady.kindly give some logic.
Now i am trying to read above input and identifying which is latest input. IN this code assume i have 4 input F1,F2,F3,F4 where F4 is latest f3 is 3rd and f1 is first. as per below code F4 will be flashing and remaining F1,F2,F3,will be steady. i m expecting First input F1 flash first later should be steady similarly if order F2 is first, F3,f1,F4 i/p F2 is first i/p it should be flashing and remaining should be steady.
here i am checking which input is latest input.
void CHK_WINDOW() {
for (w = 0; w <= 8; w++) {
switch (w) {
case 1:
if (((Fault_Array[0] & 0x01) == 0x01) != intype.INF25) {
Debounce25++;
if (Debounce25 >9) {
if (((Fault_Array[0] & 0x01) == 0x01) != intype.INF25) {
if ((WINDOW[0] & 0x01) == 0x00) {
WINDOW[0] |= 0x01;
PREVIOUS_FLT1 = PREVIOUS_FLT;
PREVIOUS_FLT = LATEST_FLT;
LATEST_FLT = 0x19;
Debounce25 = 0;
}
}
}
} else
Debounce25 = 0;
break;
default:
break;
}
}
}
i know problem is in these line of CHK_WINDOW() function.when input detected first time it move to latest one. later input comes it will move value to previous one.
here i expect once latest input address i might need to set one flag. if next input come ,if flag is already 1 then latest i/p remain same but previous & previous1 should be value.