void putc(const char c)
{
+ if (!gd)
+ return;
#ifdef CONFIG_SANDBOX
/* sandbox can send characters to stdout before it has a console */
- if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
+ if (!(gd->flags & GD_FLG_SERIAL_READY)) {
os_putc(c);
return;
}
#endif
#ifdef CONFIG_DEBUG_UART
/* if we don't have a console yet, use the debug UART */
- if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
+ if (!(gd->flags & GD_FLG_SERIAL_READY)) {
printch(c);
return;
}
#endif
- if (!gd)
- return;
#ifdef CONFIG_CONSOLE_RECORD
if ((gd->flags & GD_FLG_RECORD) && gd->console_out.start)
membuff_putbyte((struct membuff *)&gd->console_out, c);
void puts(const char *s)
{
+ if (!gd)
+ return;
#ifdef CONFIG_SANDBOX
/* sandbox can send characters to stdout before it has a console */
- if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
+ if (!(gd->flags & GD_FLG_SERIAL_READY)) {
os_puts(s);
return;
}
#endif
#ifdef CONFIG_DEBUG_UART
- if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
+ if (!(gd->flags & GD_FLG_SERIAL_READY)) {
while (*s) {
int ch = *s++;
return;
}
#endif
- if (!gd)
- return;
#ifdef CONFIG_CONSOLE_RECORD
if ((gd->flags & GD_FLG_RECORD) && gd->console_out.start)
membuff_put((struct membuff *)&gd->console_out, s, strlen(s));