|
ESP-IDF Firmware
Firmware architecture and call graph
|
#include <stdio.h>#include <stdio_ext.h>#include "esp_log.h"#include "cdc.h"#include "tusb_console.h"#include "tinyusb.h"#include "vfs_tinyusb.h"#include "esp_check.h"Go to the source code of this file.
Data Structures | |
| struct | console_handle_t |
Macros | |
| #define | STRINGIFY(s) |
| #define | STRINGIFY2(s) |
Functions | |
| static esp_err_t | redirect_std_streams_to (FILE **f_in, FILE **f_out, FILE **f_err, const char *path) |
| Reopen standard streams using a new path. | |
| static esp_err_t | restore_std_streams (FILE **f_in, FILE **f_out, FILE **f_err) |
| Restore output to default. | |
| esp_err_t | esp_tusb_init_console (int cdc_intf) |
| Redirect output to the USB serial. | |
| esp_err_t | esp_tusb_deinit_console (int cdc_intf) |
| Switch log to the default output. | |
Variables | |
| static const char * | TAG = "tusb_console" |
| static console_handle_t | con |
| #define STRINGIFY | ( | s | ) |
Definition at line 17 of file tusb_console.c.
Referenced by restore_std_streams().
| #define STRINGIFY2 | ( | s | ) |
Definition at line 18 of file tusb_console.c.
| esp_err_t esp_tusb_deinit_console | ( | int | cdc_intf | ) |
Switch log to the default output.
| cdc_intf | - interface number of TinyUSB's CDC |
Definition at line 110 of file tusb_console.c.
References con, ESP_OK, ESP_RETURN_ON_ERROR, esp_vfs_tusb_cdc_unregister(), restore_std_streams(), and TAG.
| esp_err_t esp_tusb_init_console | ( | int | cdc_intf | ) |
Redirect output to the USB serial.
| cdc_intf | - interface number of TinyUSB's CDC |
Definition at line 102 of file tusb_console.c.
References con, ESP_OK, ESP_RETURN_ON_ERROR, esp_vfs_tusb_cdc_register(), redirect_std_streams_to(), TAG, and VFS_TUSB_PATH_DEFAULT.
|
static |
Reopen standard streams using a new path.
| f_in | - pointer to a pointer holding a file for in or NULL to don't change stdin |
| f_out | - pointer to a pointer holding a file for out or NULL to don't change stdout |
| f_err | - pointer to a pointer holding a file for err or NULL to don't change stderr |
| path | - mount point |
Definition at line 40 of file tusb_console.c.
Referenced by esp_tusb_init_console().
|
static |
Restore output to default.
| f_in | - pointer to a pointer of an in file updated with redirect_std_streams_to or NULL to don't change stdin |
| f_out | - pointer to a pointer of an out file updated with redirect_std_streams_to or NULL to don't change stdout |
| f_err | - pointer to a pointer of an err file updated with redirect_std_streams_to or NULL to don't change stderr |
Definition at line 75 of file tusb_console.c.
References ESP_OK, STRINGIFY, and TAG.
Referenced by esp_tusb_deinit_console().
|
static |
Definition at line 28 of file tusb_console.c.
Referenced by esp_tusb_deinit_console(), and esp_tusb_init_console().
|
static |
Definition at line 20 of file tusb_console.c.