mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 09:45:33 +03:00
Add support for sharing DEBUG_TRACE port with an MSP port
- Added MSPv2 code MSP2_COMMON_DEBUG_OUTPUT, which sends a debug message to the MSP client. It must be ready to accept MSP responses without sending a request first. - Moved MSP initialization a bit early in the boot process, so we can print debug output during HW initialization. - Added a couple of functions in msp_serial.c to locate an MSP port from a serial port and to push a message to a given MSP port. - Updated isSerialConfigValid() to allow sharing MSP with DEBUG_TRACE.
This commit is contained in:
parent
8e77390fb2
commit
638c9de7a8
6 changed files with 84 additions and 18 deletions
|
@ -255,6 +255,10 @@ void init(void)
|
|||
serialInit(feature(FEATURE_SOFTSERIAL), SERIAL_PORT_NONE);
|
||||
#endif
|
||||
|
||||
// Initialize MSP here so the DEBUG_TRACE can share a port with MSP
|
||||
mspFcInit();
|
||||
mspSerialInit();
|
||||
|
||||
#if defined(USE_DEBUG_TRACE)
|
||||
// Debug trace uses serial output, so we only can init it after serial port is ready
|
||||
// From this point on we can use DEBUG_TRACE() to produce real-time debugging information
|
||||
|
@ -550,9 +554,6 @@ void init(void)
|
|||
|
||||
imuInit();
|
||||
|
||||
mspFcInit();
|
||||
mspSerialInit();
|
||||
|
||||
#ifdef USE_CLI
|
||||
cliInit(serialConfig());
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue