diff --git a/Build_CDTV.md b/Build_CDTV.md new file mode 100644 index 0000000..9246455 --- /dev/null +++ b/Build_CDTV.md @@ -0,0 +1,22 @@ +Build Configuration For CDTV +============================ + +Pins On Arduino +--------------- + +Pin | Signal | Note +----|--------|------------------- + 2 | KBCLK | + 3 | KBDAT | may not be changed + 6 | PRDT | + +Pull these signals through a level shifter, LV on Arduino side, HV on CDTV +side. Connect +5V from both ports to RAW on the Arduino Pro Mini and HV on +the level shifter. LV of the level shifter is connected to 3.3V (VCC) on the +Arduino. GND should be connected to both CDTV ports, GND on both sides of +the level shifter and GND on the Arduino. This way the converter works also +when only one port is connected for that port. + +Pins On CDTV +------------ +![CDTV connectors](images/cdtv_kb_mouse.png) diff --git a/README.md b/README.md index e087855..06543e0 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,10 @@ approach is intended (but not yet implemented.) System | Keyboard | Mouse | Joystick | Note --------|------------|----------|----------|-------------------------------- +-------|------------|----------|----------|--------------------------------- CDTV | working | working | untested | primay development target CD32 | untested | planning | planning | soon to come -A500 | untested | planning | planning | keyboard will require soldering +A500 | untested | planning | planning | reset handling different A600 | won't work | planning | planning | different keyboard handling A1000 | untested | planning | planning | no system available for testing A1200 | won't work | planning | planning | different keyboard handling diff --git a/USB2Amiga/USB2Amiga.ino b/USB2Amiga/USB2Amiga.ino index 5bb46b0..a3b8ad9 100644 --- a/USB2Amiga/USB2Amiga.ino +++ b/USB2Amiga/USB2Amiga.ino @@ -18,7 +18,7 @@ #include "USB_Keyboard.hpp" USB Usb; -USBHub Hub(&Usb); +//USBHub Hub(&Usb); HIDBoot HidComposite(&Usb); HIDBoot HidKeyboard(&Usb); diff --git a/USB2Amiga/USB_Keyboard.cpp b/USB2Amiga/USB_Keyboard.cpp index f2bf6bc..fec6ed8 100644 --- a/USB2Amiga/USB_Keyboard.cpp +++ b/USB2Amiga/USB_Keyboard.cpp @@ -29,7 +29,6 @@ static inline void amigakey( uint8_t code, bool pressed ) KbdRptParser::KbdRptParser() : KeyboardReportParser() -, mCapsLock( false ) , mReset( false ) { } @@ -98,7 +97,7 @@ void KbdRptParser::OnControlKeysChanged(uint8_t before, uint8_t after) { mReset = false; #if DEBUG - Serial.println( "Sending hard reset" ); + Serial.println( "Sending hard reset" ); #endif amikbd_kReset(); } @@ -133,11 +132,14 @@ void KbdRptParser::OnKeyDown(uint8_t mod, uint8_t key) PrintHex( mod, 0x80 ); Serial.println( "" ); #endif - if( key == 0x39 ) + if( key == UHS_HID_BOOT_KEY_CAPS_LOCK ) { /* CAPS LOCK */ - mCapsLock = !mCapsLock; - if( !mCapsLock ) +#if DEBUG + Serial.print( "CAPS LOCK: " ); + Serial.println( kbdLockingKeys.kbdLeds.bmCapsLock ); +#endif + if( !kbdLockingKeys.kbdLeds.bmCapsLock ) { return; } @@ -166,10 +168,10 @@ void KbdRptParser::OnKeyUp(uint8_t mod, uint8_t key) PrintHex( mod, 0x80 ); Serial.println( "" ); #endif - if( key == 0x39 ) + if( key == UHS_HID_BOOT_KEY_CAPS_LOCK ) { /* CAPS LOCK */ - if( mCapsLock ) + if( kbdLockingKeys.kbdLeds.bmCapsLock ) { return; } diff --git a/USB2Amiga/USB_Keyboard.hpp b/USB2Amiga/USB_Keyboard.hpp index c9ed413..a36fbce 100644 --- a/USB2Amiga/USB_Keyboard.hpp +++ b/USB2Amiga/USB_Keyboard.hpp @@ -15,7 +15,6 @@ class KbdRptParser : public KeyboardReportParser void OnKeyDown( uint8_t mod, uint8_t key ); void OnKeyUp( uint8_t mod, uint8_t key ); private: - bool mCapsLock; bool mReset; }; extern KbdRptParser KbdPrs; diff --git a/USB2Amiga/config.h b/USB2Amiga/config.h index 63d9525..18125df 100644 --- a/USB2Amiga/config.h +++ b/USB2Amiga/config.h @@ -7,6 +7,7 @@ #define USE_AMIGA_KEYBOARD (1) #define USE_CDTV_MOUSE_JOY (1) #define USE_AMIGA_MOUSE (0) +#define USE_A500_RESET (0) #define DEBUG (0) diff --git a/USB2Amiga/keycodes_amiga.c b/USB2Amiga/keycodes_amiga.c index ef68eb7..ed7948f 100644 --- a/USB2Amiga/keycodes_amiga.c +++ b/USB2Amiga/keycodes_amiga.c @@ -26,8 +26,6 @@ extern "C" { * PgUp -> KP ([ * PgDn -> KP )] * Num Lock - * - * Amiga-Amiga-Ctrl keycode? */ uint8_t usb2amiga[0x80] =