diff options
| author | tmk <nobody@nowhere> | 2011-01-29 00:44:05 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2011-02-22 03:08:49 +0900 |
| commit | 4f5f1a53d449172263e83c5769c92976e0d3332e (patch) | |
| tree | 53c87958a30812cd548d83768c1348680e224c3d /print.c | |
| parent | c07408a44784c0fdbca33567926a2c0aa4e8e17e (diff) | |
| download | qmk_firmware-4f5f1a53d449172263e83c5769c92976e0d3332e.tar.gz qmk_firmware-4f5f1a53d449172263e83c5769c92976e0d3332e.zip | |
added PS/2 to USB converter use V-USB as protocol stack
Diffstat (limited to 'print.c')
| -rw-r--r-- | print.c | 13 |
1 files changed, 6 insertions, 7 deletions
| @@ -21,11 +21,10 @@ | |||
| 21 | * THE SOFTWARE. | 21 | * THE SOFTWARE. |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | // Version 1.0: Initial Release | ||
| 25 | |||
| 26 | #include <avr/io.h> | 24 | #include <avr/io.h> |
| 27 | #include <avr/pgmspace.h> | 25 | #include <avr/pgmspace.h> |
| 28 | #include "print.h" | 26 | #include "print.h" |
| 27 | #include "sendchar.h" | ||
| 29 | 28 | ||
| 30 | 29 | ||
| 31 | bool print_enable = false; | 30 | bool print_enable = false; |
| @@ -38,15 +37,15 @@ void print_P(const char *s) | |||
| 38 | while (1) { | 37 | while (1) { |
| 39 | c = pgm_read_byte(s++); | 38 | c = pgm_read_byte(s++); |
| 40 | if (!c) break; | 39 | if (!c) break; |
| 41 | if (c == '\n') usb_debug_putchar('\r'); | 40 | if (c == '\n') sendchar('\r'); |
| 42 | usb_debug_putchar(c); | 41 | sendchar(c); |
| 43 | } | 42 | } |
| 44 | } | 43 | } |
| 45 | 44 | ||
| 46 | void phex1(unsigned char c) | 45 | void phex1(unsigned char c) |
| 47 | { | 46 | { |
| 48 | if (!print_enable) return; | 47 | if (!print_enable) return; |
| 49 | usb_debug_putchar(c + ((c < 10) ? '0' : 'A' - 10)); | 48 | sendchar(c + ((c < 10) ? '0' : 'A' - 10)); |
| 50 | } | 49 | } |
| 51 | 50 | ||
| 52 | void phex(unsigned char c) | 51 | void phex(unsigned char c) |
| @@ -68,7 +67,7 @@ void pbin(unsigned char c) | |||
| 68 | { | 67 | { |
| 69 | if (!print_enable) return; | 68 | if (!print_enable) return; |
| 70 | for (int i = 7; i >= 0; i--) { | 69 | for (int i = 7; i >= 0; i--) { |
| 71 | usb_debug_putchar((c & (1<<i)) ? '1' : '0'); | 70 | sendchar((c & (1<<i)) ? '1' : '0'); |
| 72 | } | 71 | } |
| 73 | } | 72 | } |
| 74 | 73 | ||
| @@ -76,6 +75,6 @@ void pbin_reverse(unsigned char c) | |||
| 76 | { | 75 | { |
| 77 | if (!print_enable) return; | 76 | if (!print_enable) return; |
| 78 | for (int i = 0; i < 8; i++) { | 77 | for (int i = 0; i < 8; i++) { |
| 79 | usb_debug_putchar((c & (1<<i)) ? '1' : '0'); | 78 | sendchar((c & (1<<i)) ? '1' : '0'); |
| 80 | } | 79 | } |
| 81 | } | 80 | } |
