All basic macros tested and working!
Tested ------ Single : Single Single : Combo Single : Sequence Combo : Single Combo : Combo Combo : Sequence Sequence : Single Sequence : Combo Sequence : Sequence
This commit is contained in:
parent
31a2d75116
commit
b2eaf0c893
@ -249,7 +249,7 @@ TriggerMacro TriggerMacroList[] = {
|
|||||||
Define_TM( 6, 1 ),
|
Define_TM( 6, 1 ),
|
||||||
Define_TM( 7, 2 ),
|
Define_TM( 7, 2 ),
|
||||||
Define_TM( 8, 0 ),
|
Define_TM( 8, 0 ),
|
||||||
Define_TM( 9, 0 ), // TODO
|
Define_TM( 9, 0 ),
|
||||||
Define_TM( 10, 4 ),
|
Define_TM( 10, 4 ),
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -308,9 +308,9 @@ Define_TL( default, 0x1C ) = { 0 };
|
|||||||
Define_TL( default, 0x1D ) = { 0 };
|
Define_TL( default, 0x1D ) = { 0 };
|
||||||
Define_TL( default, 0x1E ) = { 0 };
|
Define_TL( default, 0x1E ) = { 0 };
|
||||||
Define_TL( default, 0x1F ) = { 0 };
|
Define_TL( default, 0x1F ) = { 0 };
|
||||||
Define_TL( default, 0x20 ) = { 1, 8 };
|
Define_TL( default, 0x20 ) = { 2, 8, 9 };
|
||||||
Define_TL( default, 0x21 ) = { 1, 8 };
|
Define_TL( default, 0x21 ) = { 1, 8 };
|
||||||
Define_TL( default, 0x22 ) = { 0 };
|
Define_TL( default, 0x22 ) = { 1, 9 };
|
||||||
Define_TL( default, 0x23 ) = { 0 };
|
Define_TL( default, 0x23 ) = { 0 };
|
||||||
Define_TL( default, 0x24 ) = { 0 };
|
Define_TL( default, 0x24 ) = { 0 };
|
||||||
Define_TL( default, 0x25 ) = { 0 };
|
Define_TL( default, 0x25 ) = { 0 };
|
||||||
|
@ -56,12 +56,13 @@ void cliFunc_macroStep ( char* args );
|
|||||||
|
|
||||||
// Bit positions are important, passes (correct key) always trump incorrect key votes
|
// Bit positions are important, passes (correct key) always trump incorrect key votes
|
||||||
typedef enum TriggerMacroVote {
|
typedef enum TriggerMacroVote {
|
||||||
TriggerMacroVote_Release = 0x8, // Correct key
|
TriggerMacroVote_Release = 0x10, // Correct key
|
||||||
TriggerMacroVote_PassRelease = 0xC, // Correct key (both pass and release)
|
TriggerMacroVote_PassRelease = 0x18, // Correct key (both pass and release)
|
||||||
TriggerMacroVote_Pass = 0x4, // Correct key
|
TriggerMacroVote_Pass = 0x8, // Correct key
|
||||||
TriggerMacroVote_DoNothing = 0x2, // Incorrect key
|
TriggerMacroVote_DoNothingRelease = 0x4, // Incorrect key
|
||||||
TriggerMacroVote_Fail = 0x1, // Incorrect key
|
TriggerMacroVote_DoNothing = 0x2, // Incorrect key
|
||||||
TriggerMacroVote_Invalid = 0x0, // Invalid state
|
TriggerMacroVote_Fail = 0x1, // Incorrect key
|
||||||
|
TriggerMacroVote_Invalid = 0x0, // Invalid state
|
||||||
} TriggerMacroVote;
|
} TriggerMacroVote;
|
||||||
|
|
||||||
typedef enum TriggerMacroEval {
|
typedef enum TriggerMacroEval {
|
||||||
@ -450,10 +451,13 @@ inline TriggerMacroVote Macro_evalLongTriggerMacroVote( TriggerGuide *key, Trigg
|
|||||||
case 0x01:
|
case 0x01:
|
||||||
return TriggerMacroVote_Fail;
|
return TriggerMacroVote_Fail;
|
||||||
|
|
||||||
// Wrong key, held or released, do not pass (no effect)
|
// Wrong key, held, do not pass (no effect)
|
||||||
case 0x02:
|
case 0x02:
|
||||||
case 0x03:
|
|
||||||
return TriggerMacroVote_DoNothing;
|
return TriggerMacroVote_DoNothing;
|
||||||
|
|
||||||
|
// Wrong key released, fail out if pos == 0
|
||||||
|
case 0x03:
|
||||||
|
return TriggerMacroVote_DoNothing | TriggerMacroVote_DoNothingRelease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,6 +576,11 @@ inline TriggerMacroEval Macro_evalTriggerMacro( unsigned int triggerMacroIndex )
|
|||||||
overallVote |= vote;
|
overallVote |= vote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no pass vote was found after scanning the entire combo
|
||||||
|
// And this is the first position in the combo, just remove it (nothing important happened)
|
||||||
|
if ( longMacro && overallVote & TriggerMacroVote_DoNothingRelease && pos == 0 )
|
||||||
|
overallVote |= TriggerMacroVote_Fail;
|
||||||
|
|
||||||
// Decide new state of macro after voting
|
// Decide new state of macro after voting
|
||||||
// Fail macro, remove from pending list
|
// Fail macro, remove from pending list
|
||||||
if ( overallVote & TriggerMacroVote_Fail )
|
if ( overallVote & TriggerMacroVote_Fail )
|
||||||
@ -780,22 +789,18 @@ inline void Macro_process()
|
|||||||
case TriggerMacroEval_DoResult:
|
case TriggerMacroEval_DoResult:
|
||||||
// Append ResultMacro to PendingList
|
// Append ResultMacro to PendingList
|
||||||
Macro_appendResultMacroToPendingList( &TriggerMacroList[ macroTriggerMacroPendingList[ macro ] ] );
|
Macro_appendResultMacroToPendingList( &TriggerMacroList[ macroTriggerMacroPendingList[ macro ] ] );
|
||||||
print("D");
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
macroTriggerMacroPendingList[ macroTriggerMacroPendingListTail++ ] = macroTriggerMacroPendingList[ macro ];
|
macroTriggerMacroPendingList[ macroTriggerMacroPendingListTail++ ] = macroTriggerMacroPendingList[ macro ];
|
||||||
print("A");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Trigger Result Macro and Remove (purposely falling through)
|
// Trigger Result Macro and Remove (purposely falling through)
|
||||||
case TriggerMacroEval_DoResultAndRemove:
|
case TriggerMacroEval_DoResultAndRemove:
|
||||||
// Append ResultMacro to PendingList
|
// Append ResultMacro to PendingList
|
||||||
Macro_appendResultMacroToPendingList( &TriggerMacroList[ macroTriggerMacroPendingList[ macro ] ] );
|
Macro_appendResultMacroToPendingList( &TriggerMacroList[ macroTriggerMacroPendingList[ macro ] ] );
|
||||||
print("&");
|
|
||||||
|
|
||||||
// Remove Macro from Pending List, nothing to do, removing by default
|
// Remove Macro from Pending List, nothing to do, removing by default
|
||||||
case TriggerMacroEval_Remove:
|
case TriggerMacroEval_Remove:
|
||||||
print("R");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user