Files
system76-embedded-controller/src/board/system76/common/stdio.c
Tim Crawford e032c5f0f2 Update .clang-format and apply
Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.

There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-10 12:02:21 -07:00

40 lines
606 B
C

// SPDX-License-Identifier: GPL-3.0-only
#include <stdio.h>
#include <board/smfi.h>
#ifdef SERIAL_DEBUGGER
#include <mcs51/8051.h>
#endif
#ifdef I2C_DEBUGGER
#include <ec/i2c.h>
#endif
#ifdef PARALLEL_DEBUG
#include <board/parallel.h>
#endif // PARALLEL_DEBUG
int putchar(int c) {
uint8_t byte = (uint8_t)c;
smfi_debug(byte);
#ifdef SERIAL_DEBUGGER
SBUF = byte;
#endif
#ifdef I2C_DEBUGGER
i2c_send(&I2C_SMBUS, I2C_DEBUGGER, &byte, 1);
#endif
#ifdef PARALLEL_DEBUG
if (parallel_debug) {
parallel_write(&byte, 1);
}
#endif // PARALLEL_DEBUG
return (int)byte;
}