fusee-primary: log to UART-B

This commit is contained in:
misson20000 2020-10-18 14:54:00 -07:00
parent 190fed22e2
commit f98ce0c909
3 changed files with 11 additions and 11 deletions

View file

@ -65,9 +65,9 @@ void config_gpios()
pinmux->uart3_tx = 0;
pinmux->pe6 = PINMUX_INPUT;
pinmux->ph6 = PINMUX_INPUT;
gpio_configure_mode(TEGRA_GPIO(G, 0), GPIO_MODE_GPIO);
gpio_configure_mode(TEGRA_GPIO(D, 1), GPIO_MODE_GPIO);
gpio_configure_mode(TEGRA_GPIO(G, 0), GPIO_MODE_SFIO);
gpio_configure_mode(TEGRA_GPIO(D, 1), GPIO_MODE_SFIO);
gpio_configure_mode(TEGRA_GPIO(E, 6), GPIO_MODE_GPIO);
gpio_configure_mode(TEGRA_GPIO(H, 6), GPIO_MODE_GPIO);
gpio_configure_direction(TEGRA_GPIO(G, 0), GPIO_DIRECTION_INPUT);
@ -78,6 +78,7 @@ void config_gpios()
i2c_config(I2C_1);
i2c_config(I2C_5);
uart_config(UART_A);
uart_config(UART_B);
/* Configure volume up/down as inputs. */
gpio_configure_mode(GPIO_BUTTON_VOL_UP, GPIO_MODE_GPIO);
@ -213,10 +214,9 @@ void nx_hwinit()
config_gpios();
/* Uncomment for UART debugging. */
/*
clkrst_reboot(CARDEVICE_UARTC);
uart_init(UART_C, 115200);
*/
clkrst_reboot(CARDEVICE_UARTB);
uart_init(UART_B, 115200);
/* Reboot CL-DVFS. */
clkrst_reboot(CARDEVICE_CL_DVFS);

View file

@ -17,6 +17,7 @@
#include "log.h"
#include "../display/video_fb.h"
#include "../uart.h"
#include "vsprintf.h"
/* default log level for screen output */
@ -31,7 +32,7 @@ ScreenLogLevel log_get_log_level() {
}
void log_to_uart(const char *message) {
/* TODO: add UART logging */
uart_send(UART_B, message, strlen(message));
}
static void print_to_screen(ScreenLogLevel screen_log_level, char *message) {
@ -124,4 +125,4 @@ void print(ScreenLogLevel screen_log_level, const char * fmt, ...)
log_to_uart(message);
print_to_screen(screen_log_level, message);
}
}

View file

@ -36,8 +36,7 @@ extern ScreenLogLevel g_screen_log_level;
void log_set_log_level(ScreenLogLevel screen_log_level);
ScreenLogLevel log_get_log_level();
void log_to_uart(const char *message);
void vprint(ScreenLogLevel screen_log_level, const char *fmt, va_list args);
void print(ScreenLogLevel screen_log_level, const char* fmt, ...);
#endif
#endif