aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.vusb3
-rw-r--r--main_vusb.c (renamed from ps2_usb/main_vusb.c)0
-rw-r--r--ps2_usart.c (renamed from ps2_usb/ps2_usart.c)0
-rwxr-xr-xps2_usb/Makefile2
-rw-r--r--ps2_usb/Makefile.vusb6
-rw-r--r--ps2_usb/sendchar_dummy.c8
-rw-r--r--ps2_usb/sendchar_usart.c58
-rw-r--r--vusb/sendchar_usart.c19
8 files changed, 25 insertions, 71 deletions
diff --git a/Makefile.vusb b/Makefile.vusb
index 0ef1b1155..b8e71a8e3 100644
--- a/Makefile.vusb
+++ b/Makefile.vusb
@@ -2,7 +2,8 @@ OPT_DEFS += -DHOST_VUSB
2 2
3SRC = usbdrv.c \ 3SRC = usbdrv.c \
4 usbdrvasm.S \ 4 usbdrvasm.S \
5 oddebug.c 5 oddebug.c \
6 sendchar_usart.c
6SRC += $(TARGET_SRC) 7SRC += $(TARGET_SRC)
7 8
8 9
diff --git a/ps2_usb/main_vusb.c b/main_vusb.c
index ec7c5797a..ec7c5797a 100644
--- a/ps2_usb/main_vusb.c
+++ b/main_vusb.c
diff --git a/ps2_usb/ps2_usart.c b/ps2_usart.c
index e45b94c93..e45b94c93 100644
--- a/ps2_usb/ps2_usart.c
+++ b/ps2_usart.c
diff --git a/ps2_usb/Makefile b/ps2_usb/Makefile
index 7b55e0201..605962915 100755
--- a/ps2_usb/Makefile
+++ b/ps2_usb/Makefile
@@ -10,7 +10,7 @@ TARGET_DIR = .
10# keyboard dependent files 10# keyboard dependent files
11TARGET_SRC = main_pjrc.c \ 11TARGET_SRC = main_pjrc.c \
12 keymap.c \ 12 keymap.c \
13 matrix.c \ 13 matrix.c \
14 led.c \ 14 led.c \
15 ps2.c 15 ps2.c
16 16
diff --git a/ps2_usb/Makefile.vusb b/ps2_usb/Makefile.vusb
index 7b69dc27b..6e49fc44d 100644
--- a/ps2_usb/Makefile.vusb
+++ b/ps2_usb/Makefile.vusb
@@ -12,13 +12,13 @@ TARGET_SRC = main_vusb.c \
12 keymap.c \ 12 keymap.c \
13 matrix.c \ 13 matrix.c \
14 led.c \ 14 led.c \
15 ps2_usart.c \ 15 ps2_usart.c
16 sendchar_dummy.c
17# sendchar_usart.c
18 16
19CONFIG_H = config_vusb.h 17CONFIG_H = config_vusb.h
20 18
21 19
20# V-USB debug level: To use ps2_usart.c level must be 0
21# ps2_usart.c requires USART to receive PS/2 signal.
22OPT_DEFS = -DDEBUG_LEVEL=0 22OPT_DEFS = -DDEBUG_LEVEL=0
23 23
24 24
diff --git a/ps2_usb/sendchar_dummy.c b/ps2_usb/sendchar_dummy.c
deleted file mode 100644
index 8c9e583f1..000000000
--- a/ps2_usb/sendchar_dummy.c
+++ /dev/null
@@ -1,8 +0,0 @@
1#include <stdint.h>
2#include "sendchar.h"
3
4
5int8_t sendchar(uint8_t c)
6{
7 return 1;
8}
diff --git a/ps2_usb/sendchar_usart.c b/ps2_usb/sendchar_usart.c
deleted file mode 100644
index fe18177a3..000000000
--- a/ps2_usb/sendchar_usart.c
+++ /dev/null
@@ -1,58 +0,0 @@
1#include <stdint.h>
2#include "oddebug.h"
3#include "sendchar.h"
4
5
6/* from oddebug.h */
7#if defined UBRR
8# define ODDBG_UBRR UBRR
9#elif defined UBRRL
10# define ODDBG_UBRR UBRRL
11#elif defined UBRR0
12# define ODDBG_UBRR UBRR0
13#elif defined UBRR0L
14# define ODDBG_UBRR UBRR0L
15#endif
16
17#if defined UCR
18# define ODDBG_UCR UCR
19#elif defined UCSRB
20# define ODDBG_UCR UCSRB
21#elif defined UCSR0B
22# define ODDBG_UCR UCSR0B
23#endif
24
25#if defined TXEN
26# define ODDBG_TXEN TXEN
27#else
28# define ODDBG_TXEN TXEN0
29#endif
30
31#if defined USR
32# define ODDBG_USR USR
33#elif defined UCSRA
34# define ODDBG_USR UCSRA
35#elif defined UCSR0A
36# define ODDBG_USR UCSR0A
37#endif
38
39#if defined UDRE
40# define ODDBG_UDRE UDRE
41#else
42# define ODDBG_UDRE UDRE0
43#endif
44
45#if defined UDR
46# define ODDBG_UDR UDR
47#elif defined UDR0
48# define ODDBG_UDR UDR0
49#endif
50
51
52/* from oddebug.c */
53int8_t sendchar(uint8_t c)
54{
55 while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */
56 ODDBG_UDR = c;
57 return 1;
58}
diff --git a/vusb/sendchar_usart.c b/vusb/sendchar_usart.c
new file mode 100644
index 000000000..d6f3c894c
--- /dev/null
+++ b/vusb/sendchar_usart.c
@@ -0,0 +1,19 @@
1#include <stdint.h>
2#include "oddebug.h"
3#include "sendchar.h"
4
5
6#if DEBUG_LEVEL > 0
7/* from oddebug.c */
8int8_t sendchar(uint8_t c)
9{
10 while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */
11 ODDBG_UDR = c;
12 return 1;
13}
14#else
15int8_t sendchar(uint8_t c)
16{
17 return 1;
18}
19#endif