Fixed #154 Rotary encoder usage jumpy in emulation mode

This commit is contained in:
Stephen White 2019-12-29 16:52:21 +11:00
parent d3f045e7c3
commit bdcf49f758
2 changed files with 7 additions and 3 deletions

View file

@ -142,6 +142,7 @@ enum PIGPIOMasks
};
static const unsigned ButtonPinFlags[5] = { PIGPIO_MASK_IN_BUTTON1, PIGPIO_MASK_IN_BUTTON2, PIGPIO_MASK_IN_BUTTON3, PIGPIO_MASK_IN_BUTTON4, PIGPIO_MASK_IN_BUTTON5 };
static int buttonCount = sizeof(ButtonPinFlags) / sizeof(unsigned);
///////////////////////////////////////////////////////////////////////////////////////////////
// Original Non-split lines
@ -290,7 +291,6 @@ public:
write32(PWM_CTL, PWM_USEF2 + PWM_PWEN2 + PWM_USEF1 + PWM_PWEN1 + PWM_CLRF1);
#endif
int buttonCount = sizeof(ButtonPinFlags) / sizeof(unsigned);
for (index = 0; index < buttonCount; ++index)
{
InputButton[index] = false;
@ -409,8 +409,8 @@ public:
static void ReadBrowseMode(void);
static void ReadGPIOUserInput(int buttonCount);
static void ReadEmulationMode1541(void);
static void ReadButtonsEmulationMode(void);
static void ReadEmulationMode1581(void);
static void WaitUntilReset(void)

View file

@ -868,7 +868,7 @@ EXIT_TYPE Emulate1541(FileBrowser* fileBrowser)
#endif
}
IEC_Bus::ReadButtonsEmulationMode();
IEC_Bus::ReadGPIOUserInput(3);
// Other core will check the uart (as it is slow) (could enable uart irqs - will they execute on this core?)
#if not defined(EXPERIMENTALZERO)
@ -1074,8 +1074,12 @@ EXIT_TYPE Emulate1581(FileBrowser* fileBrowser)
#endif
}
IEC_Bus::ReadGPIOUserInput(3);
// Other core will check the uart (as it is slow) (could enable uart irqs - will they execute on this core?)
#if not defined(EXPERIMENTALZERO)
inputMappings->CheckKeyboardEmulationMode(numberOfImages, numberOfImagesMax);
#endif
inputMappings->CheckButtonsEmulationMode();
bool exitEmulation = inputMappings->Exit();