Hot-pluggable parallel port debugging

This commit is contained in:
Jeremy Soller
2020-07-02 09:09:58 -06:00
committed by Jeremy Soller
parent 47aed0733e
commit 834aaf97e4
15 changed files with 127 additions and 306 deletions

View File

@ -10,21 +10,28 @@
#include <ec/i2c.h>
#endif
#ifdef PARPORT_DEBUG
#include <ec/parallel.h>
#endif
#ifdef PARALLEL_DEBUG
#include <board/parallel.h>
#endif // PARALLEL_DEBUG
int putchar(int c) {
unsigned char byte = (unsigned char)c;
smfi_debug(byte);
#ifdef SERIAL_DEBUGGER
SBUF = byte;
#endif
#ifdef I2C_DEBUGGER
i2c_send(&I2C_SMBUS, I2C_DEBUGGER, &byte, 1);
#endif
#ifdef PARPORT_DEBUG
parport_write(&byte, 1);
#endif
#ifdef PARALLEL_DEBUG
if (parallel_debug) {
parallel_write(&byte, 1);
}
#endif // PARALLEL_DEBUG
return (int)byte;
}