Explorar el Código

move files: main_vusb.c ps2_usart.c sendchar_usart.c from ps2_usb to common dir

tmk hace 14 años
padre
commit
61e12a3157
Se han modificado 8 ficheros con 25 adiciones y 71 borrados
  1. 2 1
      Makefile.vusb
  2. 0 0
      main_vusb.c
  3. 0 0
      ps2_usart.c
  4. 1 1
      ps2_usb/Makefile
  5. 3 3
      ps2_usb/Makefile.vusb
  6. 0 8
      ps2_usb/sendchar_dummy.c
  7. 0 58
      ps2_usb/sendchar_usart.c
  8. 19 0
      vusb/sendchar_usart.c

+ 2 - 1
Makefile.vusb

@@ -2,7 +2,8 @@ OPT_DEFS += -DHOST_VUSB
 
 
 SRC =	usbdrv.c \
 SRC =	usbdrv.c \
 	usbdrvasm.S \
 	usbdrvasm.S \
-	oddebug.c
+	oddebug.c \
+	sendchar_usart.c
 SRC +=	$(TARGET_SRC)
 SRC +=	$(TARGET_SRC)
 
 
 
 

+ 0 - 0
ps2_usb/main_vusb.c → main_vusb.c


+ 0 - 0
ps2_usb/ps2_usart.c → ps2_usart.c


+ 1 - 1
ps2_usb/Makefile

@@ -10,7 +10,7 @@ TARGET_DIR = .
 # keyboard dependent files
 # keyboard dependent files
 TARGET_SRC =	main_pjrc.c \
 TARGET_SRC =	main_pjrc.c \
 		keymap.c \
 		keymap.c \
-  	        matrix.c \
+		matrix.c \
 		led.c \
 		led.c \
 		ps2.c
 		ps2.c
 
 

+ 3 - 3
ps2_usb/Makefile.vusb

@@ -12,13 +12,13 @@ TARGET_SRC =	main_vusb.c \
 		keymap.c \
 		keymap.c \
 		matrix.c \
 		matrix.c \
 		led.c \
 		led.c \
-		ps2_usart.c \
-		sendchar_dummy.c
-#		sendchar_usart.c
+		ps2_usart.c
 
 
 CONFIG_H = config_vusb.h
 CONFIG_H = config_vusb.h
 
 
 
 
+# V-USB debug level: To use ps2_usart.c level must be 0
+# ps2_usart.c requires USART to receive PS/2 signal.
 OPT_DEFS = -DDEBUG_LEVEL=0
 OPT_DEFS = -DDEBUG_LEVEL=0
 
 
 
 

+ 0 - 8
ps2_usb/sendchar_dummy.c

@@ -1,8 +0,0 @@
-#include <stdint.h>
-#include "sendchar.h"
-
-
-int8_t sendchar(uint8_t c)
-{
-    return 1;
-}

+ 0 - 58
ps2_usb/sendchar_usart.c

@@ -1,58 +0,0 @@
-#include <stdint.h>
-#include "oddebug.h"
-#include "sendchar.h"
-
-
-/* from oddebug.h */
-#if defined UBRR
-#   define  ODDBG_UBRR  UBRR
-#elif defined UBRRL
-#   define  ODDBG_UBRR  UBRRL
-#elif defined UBRR0
-#   define  ODDBG_UBRR  UBRR0
-#elif defined UBRR0L
-#   define  ODDBG_UBRR  UBRR0L
-#endif
-
-#if defined UCR
-#   define  ODDBG_UCR   UCR
-#elif defined UCSRB
-#   define  ODDBG_UCR   UCSRB
-#elif defined UCSR0B
-#   define  ODDBG_UCR   UCSR0B
-#endif
-
-#if defined TXEN
-#   define  ODDBG_TXEN  TXEN
-#else
-#   define  ODDBG_TXEN  TXEN0
-#endif
-
-#if defined USR
-#   define  ODDBG_USR   USR
-#elif defined UCSRA
-#   define  ODDBG_USR   UCSRA
-#elif defined UCSR0A
-#   define  ODDBG_USR   UCSR0A
-#endif
-
-#if defined UDRE
-#   define  ODDBG_UDRE  UDRE
-#else
-#   define  ODDBG_UDRE  UDRE0
-#endif
-
-#if defined UDR
-#   define  ODDBG_UDR   UDR
-#elif defined UDR0
-#   define  ODDBG_UDR   UDR0
-#endif
-
-
-/* from oddebug.c */
-int8_t sendchar(uint8_t c)
-{
-    while(!(ODDBG_USR & (1 << ODDBG_UDRE)));    /* wait for data register empty */
-    ODDBG_UDR = c;
-    return 1;
-}

+ 19 - 0
vusb/sendchar_usart.c

@@ -0,0 +1,19 @@
+#include <stdint.h>
+#include "oddebug.h"
+#include "sendchar.h"
+
+
+#if DEBUG_LEVEL > 0
+/* from oddebug.c */
+int8_t sendchar(uint8_t c)
+{
+    while(!(ODDBG_USR & (1 << ODDBG_UDRE)));    /* wait for data register empty */
+    ODDBG_UDR = c;
+    return 1;
+}
+#else
+int8_t sendchar(uint8_t c)
+{
+    return 1;
+}
+#endif