summaryrefslogtreecommitdiff
path: root/print.c
diff options
context:
space:
mode:
authortmk2011-01-29 00:44:05 +0900
committertmk2011-02-22 03:08:49 +0900
commit4f5f1a53d449172263e83c5769c92976e0d3332e (patch)
tree53c87958a30812cd548d83768c1348680e224c3d /print.c
parentc07408a44784c0fdbca33567926a2c0aa4e8e17e (diff)
added PS/2 to USB converter use V-USB as protocol stack
Diffstat (limited to 'print.c')
-rw-r--r--print.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/print.c b/print.c
index 59b4bca18..d9152971b 100644
--- a/print.c
+++ b/print.c
@@ -21,11 +21,10 @@
* THE SOFTWARE.
*/
-// Version 1.0: Initial Release
-
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "print.h"
+#include "sendchar.h"
bool print_enable = false;
@@ -38,15 +37,15 @@ void print_P(const char *s)
while (1) {
c = pgm_read_byte(s++);
if (!c) break;
- if (c == '\n') usb_debug_putchar('\r');
- usb_debug_putchar(c);
+ if (c == '\n') sendchar('\r');
+ sendchar(c);
}
}
void phex1(unsigned char c)
{
if (!print_enable) return;
- usb_debug_putchar(c + ((c < 10) ? '0' : 'A' - 10));
+ sendchar(c + ((c < 10) ? '0' : 'A' - 10));
}
void phex(unsigned char c)
@@ -68,7 +67,7 @@ void pbin(unsigned char c)
{
if (!print_enable) return;
for (int i = 7; i >= 0; i--) {
- usb_debug_putchar((c & (1<<i)) ? '1' : '0');
+ sendchar((c & (1<<i)) ? '1' : '0');
}
}
@@ -76,6 +75,6 @@ void pbin_reverse(unsigned char c)
{
if (!print_enable) return;
for (int i = 0; i < 8; i++) {
- usb_debug_putchar((c & (1<<i)) ? '1' : '0');
+ sendchar((c & (1<<i)) ? '1' : '0');
}
}