Skip to content

Commit

Permalink
- release build architecture added
Browse files Browse the repository at this point in the history
- updated documentation
- fixed compiler warnings
  • Loading branch information
Sven Oliver Moll committed Jul 14, 2020
1 parent 5c58327 commit 04eaf6e
Show file tree
Hide file tree
Showing 9 changed files with 1,021 additions and 1,133 deletions.
21 changes: 15 additions & 6 deletions Build_CDTV.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Build Configuration For CDTV
============================

You can use the precompiled file `hex/USB2Amiga.CDTV.hex` to program the
Arduino pro mini 328p 3.3V.

Pins On Arduino
---------------

Expand All @@ -10,12 +13,18 @@ Pin | Signal | Note
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.
Pull these signals through a level shifter with LV# on Arduino side and HV#
on CDTV side. The pins 2, 3 and 6 match the layout of the typical 4-bit
level shifters, where the pins in the center are used for GND and refence
voltage.

Also 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
------------
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
USB2AMIGA_VARIANTS = CDTV
export BUILD_BASE = $(HOME)/tmp

RM = rm -rf
CP = cp -v

all: $(USB2AMIGA_VARIANTS)

clean:
$(RM) $(BUILD_BASE)

release:
@if git status | grep '[ ]USB2Amiga/'; then \
echo -e "\n*** source code contains uncommitted changes\n"; \
exit 1; \
fi
$(MAKE) clean
$(MAKE) all
for r in $(USB2AMIGA_VARIANTS); do $(CP) $(BUILD_BASE)/$$r/USB2Amiga.hex hex/USB2Amiga.$$r.hex; done
git add hex/

CDTV:
$(MAKE) -C USB2Amiga -f ../mk/CDTV.mk all

14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ FAQ
---
Can I use it with an USB hub?

No, sorry. The Arduino libraries, that this project builds upon, don't support
this. So can't I. A workaround would be to build two USB2Amiga, using one for
keyboard and one for mouse.
No, sorry. To keep the code simple, this seldom used feature is not implmented.
The example code for USB keyboard and mouse from the library does not support
this either, even though the code looks like it might. A workaround would be to
build two USB2Amiga, using one for keyboard and one for mouse.


Building
--------
- [CDTV](Build_CDTV.md)


Acknowledgements
Expand All @@ -59,4 +65,4 @@ least looking at) other peoples code.
code written by hkzlab)
- cssvb94 gave me the idea on how to include support for a standard amiga
mouse with his project
[AmigaUSBMouseJoystick](https://github.com/cssvb94/AmigaUSBMouseJoystick)
[AmigaUSBMouseJoystick](https://github.com/cssvb94/AmigaUSBMouseJoystick)
3 changes: 1 addition & 2 deletions USB2Amiga/cdtv.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@

#define BUFSIZE 16
static volatile int8_t head=0, tail=0;
static uint16_t irbuf[BUFSIZE];

#if F_CPU >= 24000000L
#error 24MHz not defined
Expand Down Expand Up @@ -118,7 +117,7 @@ uint16_t joystick_get_state(){

static volatile int16_t mouse_x=0, mouse_y=0;
static volatile uint8_t mouse_buttons=0;
uint8_t mouse_set_state(uint8_t buttons, int8_t x, int8_t y) {
void mouse_set_state(uint8_t buttons, int8_t x, int8_t y) {
noInterrupts();
#if USE_CDTV_MOUSE_JOY
if( x == -1 )
Expand Down
2 changes: 1 addition & 1 deletion USB2Amiga/cdtv.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern "C" {
void cdtv_init();
void cdtv_main();

uint8_t mouse_set_state(uint8_t buttons, int8_t x, int8_t y);
void mouse_set_state(uint8_t buttons, int8_t x, int8_t y);

#ifdef __cplusplus
}
Expand Down
2 changes: 2 additions & 0 deletions USB2Amiga/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#define USE_AMIGA_MOUSE (0)
#define USE_A500_RESET (0)

#ifndef DEBUG
#define DEBUG (0)
#endif

// INT1 on PIN3 (DATAPIN) for ACK, that is DATAPIN needs to be pin 3
#define DATAPIN (3)
Expand Down
Loading

0 comments on commit 04eaf6e

Please sign in to comment.