mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-13 03:19:58 +03:00
s/dmesg/bootlog/
This commit is contained in:
parent
fc6d9c4bc1
commit
fd971725c9
4 changed files with 15 additions and 19 deletions
|
@ -73,10 +73,9 @@ While connected to the CLI, all Logical Switches are temporarily disabled (5.1.0
|
|||
| `beeper` | Show/set beeper (buzzer) [usage](Buzzer.md) |
|
||||
| `bind_rx` | Initiate binding for SRXL2 or CRSF receivers |
|
||||
| `blackbox` | Configure blackbox fields |
|
||||
| `bootlog` | Show boot events |
|
||||
| `bootlog` | Show init logs from [serial_printf_debugging](./development/serial_printf_debugging.md) |
|
||||
| `color` | Configure colors |
|
||||
| `defaults` | Reset to defaults and reboot |
|
||||
| `dmesg` | Show init logs from [serial_printf_debugging](./development/serial_printf_debugging.md) |
|
||||
| `dfu` | DFU mode on reboot |
|
||||
| `diff` | List configuration changes from default |
|
||||
| `dump` | Dump configuration |
|
||||
|
|
|
@ -6,7 +6,7 @@ INAV offers a function to use serial `printf` style debugging.
|
|||
|
||||
This provides a simple and intuitive debugging facility.
|
||||
This facility is only available after the serial sub-system has been initialised, but logs generated prior to serial
|
||||
initialization can be obtained via the `dmesg` functionality.
|
||||
initialization can be obtained via the `bootlog` functionality.
|
||||
|
||||
In order to use this feature, the source file must include `common/log.h`.
|
||||
|
||||
|
@ -140,11 +140,11 @@ For the Configurator, debug messages are shown in the developer console log.
|
|||
|
||||
Note: The numeric value in square brackets is the FC uptime in seconds.
|
||||
|
||||
To see printf-style log messages generated prior serial initialization, reserve about 2KB-4KB RAM to buffer the
|
||||
log) by defining DMESG_SIZE:
|
||||
#define DMESG_SIZE 2048
|
||||
To see printf-style log messages generated prior serial initialization, reserve about 2KB RAM to buffer the
|
||||
log) by defining USE_BOOTLOG:
|
||||
#define USE_BOOTLOG 2048
|
||||
|
||||
Then `make clean` and `make`.
|
||||
|
||||
Then in the CLI you can run `dmesg` to see the buffered log.
|
||||
Then in the CLI you can run `bootlog` to see the buffered log.
|
||||
Note dmesg also requires that a serial port be defined for serial debugging.
|
||||
|
|
|
@ -61,8 +61,8 @@ PG_RESET_TEMPLATE(logConfig_t, logConfig,
|
|||
.topics = SETTING_LOG_TOPICS_DEFAULT
|
||||
);
|
||||
|
||||
#if defined(DMESG_SIZE)
|
||||
char dmesg_buffer[DMESG_SIZE];
|
||||
#if defined(USE_BOOTLOG)
|
||||
char dmesg_buffer[USE_BOOTLOG];
|
||||
char *dmesg_head = dmesg_buffer;
|
||||
#endif
|
||||
|
||||
|
@ -141,8 +141,8 @@ static void logPrint(const char *buf, size_t size)
|
|||
mspSerialPushPort(MSP_DEBUGMSG, (uint8_t*)buf, size, mspLogPort, MSP_V2_NATIVE);
|
||||
}
|
||||
|
||||
#ifdef DMESG_SIZE
|
||||
if ( (dmesg_head + size + 2) < (dmesg_buffer + DMESG_SIZE) ) {
|
||||
#ifdef USE_BOOTLOG
|
||||
if ( (dmesg_head + size + 2) < (dmesg_buffer + USE_BOOTLOG) ) {
|
||||
for (unsigned int ii = 0; ii < size; ii++) {
|
||||
*dmesg_head = buf[ii];
|
||||
dmesg_head++;
|
||||
|
|
|
@ -130,8 +130,8 @@ bool cliMode = false;
|
|||
extern timeDelta_t cycleTime; // FIXME dependency on mw.c
|
||||
extern uint8_t detectedSensors[SENSOR_INDEX_COUNT];
|
||||
|
||||
#ifdef DMESG_SIZE
|
||||
extern char dmesg_buffer[DMESG_SIZE];
|
||||
#ifdef USE_BOOTLOG
|
||||
extern char dmesg_buffer[USE_BOOTLOG];
|
||||
extern char *dmesg_head;
|
||||
#endif
|
||||
|
||||
|
@ -4803,10 +4803,10 @@ static void cliUbloxPrintSatelites(char *arg)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef DMESG_SIZE
|
||||
#ifdef USE_BOOTLOG
|
||||
static void printDmesg(char *cmdline __attribute__((unused))) {
|
||||
int size = dmesg_head - dmesg_buffer;
|
||||
cliPrintLinef("log size written: %i", size);
|
||||
cliPrintLinef("log size written: %i of %i bytes reserved", size, USE_BOOTLOG);
|
||||
for (int ii = 0; ii < size; ii++) {
|
||||
cliWrite(dmesg_buffer[ii]);
|
||||
}
|
||||
|
@ -4833,7 +4833,7 @@ const clicmd_t cmdTable[] = {
|
|||
CLI_COMMAND_DEF("bind_rx", "initiate binding for RX SPI or SRXL2", NULL, cliRxBind),
|
||||
#endif
|
||||
#if defined(USE_BOOTLOG)
|
||||
CLI_COMMAND_DEF("bootlog", "show boot events", NULL, cliBootlog),
|
||||
CLI_COMMAND_DEF("bootlog", "show boot log", NULL, printDmesg),
|
||||
#endif
|
||||
#ifdef USE_LED_STRIP
|
||||
CLI_COMMAND_DEF("color", "configure colors", NULL, cliColor),
|
||||
|
@ -4844,9 +4844,6 @@ const clicmd_t cmdTable[] = {
|
|||
CLI_COMMAND_DEF("dfu", "DFU mode on reboot", NULL, cliDfu),
|
||||
CLI_COMMAND_DEF("diff", "list configuration changes from default",
|
||||
"[master|battery_profile|control_profile|mixer_profile|rates|all] {showdefaults}", cliDiff),
|
||||
#ifdef DMESG_SIZE
|
||||
CLI_COMMAND_DEF("dmesg", "init log (DMESG_SIZE)", NULL, printDmesg),
|
||||
#endif
|
||||
CLI_COMMAND_DEF("dump", "dump configuration",
|
||||
"[master|battery_profile|control_profile|mixer_profile|rates|all] {showdefaults}", cliDump),
|
||||
#ifdef USE_RX_ELERES
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue