rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
console_hw.c File Reference

The IOMCU_CONSOLE build's console; see console_hw.h. More...

#include "console_hw.h"
#include <stdarg.h>
#include "pico/stdio.h"
#include "pico/stdio_usb.h"
#include "pico/stdlib.h"
#include "tusb.h"
#include "page_console.h"

Macros

#define CONSOLE_HW_KEYS_PER_PASS   64u
 Characters taken in one pass: a pasted line of PAGE_CONSOLE_LINE_MAX takes 3 passes at most.

Functions

void console_hw_init (const link_dev_t *dev)
 The console on the pages of dev.
void console_hw_pass (void)
 Once a pass: the characters that came, the report of a HITEC operation that has ended, and as much output as the USB transmit buffer has room for now, a line cut where the room ends and its rest first in the next pass.
void console_hw_say (const char *fmt,...)
 A line for the USB serial port, formatted as printf() formats, through the console's output: it leaves after the lines said before it and never inside one, and saying it does not wait for the host.

Variables

static page_console_t s_console
static char s_out [PAGE_CONSOLE_OUT_LINE *2u]
 The output of one pass, off the main loop's stack.

Detailed Description

The IOMCU_CONSOLE build's console; see console_hw.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ console_hw_init()

void console_hw_init ( const link_dev_t * dev)

The console on the pages of dev.

After link_dev_init().

Parameters
devThe link device whose pages the console serves.

◆ console_hw_pass()

void console_hw_pass ( void )

Once a pass: the characters that came, the report of a HITEC operation that has ended, and as much output as the USB transmit buffer has room for now, a line cut where the room ends and its rest first in the next pass.

A line of any length leaves. Never waits for the host: a pass writes no more than the buffer has free, and a host that stops reading leaves the output in the console's buffer.

◆ console_hw_say()

void console_hw_say ( const char * fmt,
... )

A line for the USB serial port, formatted as printf() formats, through the console's output: it leaves after the lines said before it and never inside one, and saying it does not wait for the host.

Dropped while no host has the port open, as printf() drops it.

Parameters
fmtprintf() format string.
...Arguments for the format string.