diff --git a/src/iec_bus.h b/src/iec_bus.h index a3911be..ce42864 100644 --- a/src/iec_bus.h +++ b/src/iec_bus.h @@ -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) diff --git a/src/main.cpp b/src/main.cpp index f4d2cff..966da44 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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();