actually use button name (#2126)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
3614cd3161
commit
0df5d0ae3d
|
@ -13,8 +13,9 @@
|
|||
ButtonDebounce* ButtonDebounce::s_firstDebounce = nullptr;
|
||||
static Logging *logger;
|
||||
|
||||
ButtonDebounce::ButtonDebounce(const char *name) {
|
||||
this->name = name;
|
||||
ButtonDebounce::ButtonDebounce(const char *name)
|
||||
: m_name(name)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,7 +70,7 @@ void ButtonDebounce::stopConfiguration () {
|
|||
void ButtonDebounce::startConfiguration () {
|
||||
#if EFI_PROD_CODE
|
||||
if (needsPinInitialization) {
|
||||
efiSetPadMode("Button", *m_pin, getInputMode(*m_mode));
|
||||
efiSetPadMode(m_name, *m_pin, getInputMode(*m_mode));
|
||||
needsPinInitialization = false;
|
||||
}
|
||||
#endif
|
||||
|
@ -117,7 +118,7 @@ void ButtonDebounce::debug() {
|
|||
ButtonDebounce *listItem = s_firstDebounce;
|
||||
while (listItem != nullptr) {
|
||||
#if EFI_PROD_CODE || EFI_UNIT_TEST
|
||||
scheduleMsg(logger, "%s timeLast %d", listItem->name, listItem->timeLast);
|
||||
scheduleMsg(logger, "%s timeLast %d", listItem->m_name, listItem->timeLast);
|
||||
scheduleMsg(logger, "physical state %d value %d", efiReadPin(listItem->active_pin), listItem->storedValue);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
class ButtonDebounce {
|
||||
public:
|
||||
ButtonDebounce(const char *name);
|
||||
explicit ButtonDebounce(const char* name);
|
||||
void init(efitimems_t threshold, brain_pin_e &pin, pin_input_mode_e &mode);
|
||||
void stopConfiguration();
|
||||
void startConfiguration();
|
||||
|
@ -25,7 +25,7 @@ public:
|
|||
static void startConfigurationList();
|
||||
static void debug();
|
||||
private:
|
||||
const char *name;
|
||||
const char* const m_name;
|
||||
efitick_t m_threshold;
|
||||
efitick_t timeLast;
|
||||
brain_pin_e *m_pin;
|
||||
|
|
Loading…
Reference in New Issue