mirror of
https://github.com/jscrane/r65emu.git
synced 2025-04-14 09:37:04 +00:00
support multiple PS/2 keyboard drivers
This commit is contained in:
parent
25f7aad376
commit
bed7ed38c2
@ -19,9 +19,9 @@
|
||||
// PS/2 keyboard
|
||||
#if !defined(USE_OWN_KBD)
|
||||
#define USE_PS2_KBD
|
||||
#endif
|
||||
#define PS2_KBD_IRQ D3
|
||||
#define PS2_KBD_DATA D4
|
||||
#endif
|
||||
|
||||
// SPI-RAM
|
||||
#if !defined(NO_SPIRAM)
|
||||
|
@ -26,9 +26,9 @@
|
||||
// PS/2 keyboard
|
||||
#if !defined(USE_OWN_KBD)
|
||||
#define USE_PS2_KBD
|
||||
#endif
|
||||
#define PS2_KBD_DATA 34
|
||||
#define PS2_KBD_IRQ 35
|
||||
#endif
|
||||
|
||||
// Storage
|
||||
#if !defined(NO_STORAGE)
|
||||
|
@ -5,9 +5,9 @@
|
||||
// PS/2 keyboard
|
||||
#if !defined(USE_OWN_KBD)
|
||||
#define USE_PS2_KBD
|
||||
#endif
|
||||
#define PS2_KBD_DATA PE_4
|
||||
#define PS2_KBD_IRQ PE_5
|
||||
#endif
|
||||
|
||||
// Storage
|
||||
#if !defined(NO_STORAGE)
|
||||
|
@ -11,9 +11,9 @@
|
||||
// PS/2 Keyboard
|
||||
#if !defined(USE_OWN_KBD)
|
||||
#define USE_PS2_KBD
|
||||
#endif
|
||||
#define PS2_KBD_DATA 32
|
||||
#define PS2_KBD_IRQ 33
|
||||
#endif
|
||||
|
||||
// 64kB RAM
|
||||
#define RAM_SIZE 0x10000u
|
||||
|
@ -1,4 +1,7 @@
|
||||
#include <Arduino.h>
|
||||
#include "hardware.h"
|
||||
|
||||
#if defined(USE_PS2_KBD)
|
||||
#include "ps2drv.h"
|
||||
|
||||
#if !defined(KBD_BUFFER)
|
||||
@ -13,7 +16,7 @@ static uint8_t DataPin;
|
||||
#if defined(ESP32) || defined(ESP8266)
|
||||
IRAM_ATTR
|
||||
#endif
|
||||
void ps2interrupt(void)
|
||||
void ps2interrupt_handler(void)
|
||||
{
|
||||
static uint8_t bitcount=0;
|
||||
static uint8_t incoming=0;
|
||||
@ -86,6 +89,7 @@ void PS2Driver::begin(uint8_t data_pin, uint8_t irq_pin)
|
||||
DataPin = data_pin;
|
||||
pinMode(irq_pin, INPUT_PULLUP);
|
||||
pinMode(data_pin, INPUT_PULLUP);
|
||||
attachInterrupt(irq_pin, ps2interrupt, FALLING);
|
||||
attachInterrupt(irq_pin, ps2interrupt_handler, FALLING);
|
||||
head = tail = 0;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user