trigger and start button pins not displayed by "pins" command fix #2084
This commit is contained in:
parent
f147aabcd7
commit
88bb2f4569
|
@ -31,6 +31,8 @@
|
|||
|
||||
#define EFI_PWM_TESTER FALSE
|
||||
|
||||
#define EFI_ACTIVE_CONFIGURATION_IN_FLASH FALSE
|
||||
|
||||
#define EFI_MC33816 TRUE
|
||||
|
||||
#define EFI_HPFP TRUE
|
||||
|
|
|
@ -22,7 +22,7 @@ We need to have a separate init function because we do not have the pin or mode
|
|||
*/
|
||||
void ButtonDebounce::init (efitimems_t threshold, brain_pin_e &pin, pin_input_mode_e &mode) {
|
||||
// we need to keep track of whether we have already been initialized due to the way unit tests run.
|
||||
if (!initialized) {
|
||||
if (!isInstanceRegisteredInGlobalList) {
|
||||
// Link us to the list that is used to track ButtonDebounce instances, so that when the configuration changes,
|
||||
// they can be looped through and updated.
|
||||
nextDebounce = s_firstDebounce;
|
||||
|
@ -33,7 +33,7 @@ void ButtonDebounce::init (efitimems_t threshold, brain_pin_e &pin, pin_input_mo
|
|||
m_pin = &pin;
|
||||
m_mode = &mode;
|
||||
startConfiguration();
|
||||
initialized = true;
|
||||
isInstanceRegisteredInGlobalList = true;
|
||||
}
|
||||
|
||||
void ButtonDebounce::stopConfigurationList () {
|
||||
|
@ -61,16 +61,16 @@ void ButtonDebounce::stopConfiguration () {
|
|||
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
|
||||
#if ! EFI_UNIT_TEST
|
||||
efiSetPadUnused(active_pin);
|
||||
needsInit = true;
|
||||
needsPinInitialization = true;
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
}
|
||||
}
|
||||
|
||||
void ButtonDebounce::startConfiguration () {
|
||||
#if ! EFI_UNIT_TEST
|
||||
if (needsInit) {
|
||||
if (needsPinInitialization) {
|
||||
efiSetPadMode("Button", *m_pin, getInputMode(*m_mode));
|
||||
needsInit = false;
|
||||
needsPinInitialization = false;
|
||||
}
|
||||
#endif
|
||||
active_pin = *m_pin;
|
||||
|
|
|
@ -33,10 +33,10 @@ private:
|
|||
pin_input_mode_e *m_mode;
|
||||
pin_input_mode_e active_mode = PI_DEFAULT;
|
||||
bool storedValue = false;
|
||||
bool initialized = false;
|
||||
bool isInstanceRegisteredInGlobalList = false;
|
||||
bool needsPinInitialization = true;
|
||||
ButtonDebounce *nextDebounce = nullptr;
|
||||
static ButtonDebounce* s_firstDebounce;
|
||||
bool needsInit = false;
|
||||
};
|
||||
|
||||
void initButtonDebounce(Logging *sharedLogger);
|
||||
|
|
Loading…
Reference in New Issue