1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

add getCoreTemp (#12608)

* add getCoreTemp

* add ifdef

* Update msp.c

Now also repported from MSP_STATUS

* Update src/main/msp/msp.c

Co-authored-by: Míguel Ángel Mulero Martínez <mcgivergim@gmail.com>

---------

Co-authored-by: Míguel Ángel Mulero Martínez <mcgivergim@gmail.com>
This commit is contained in:
HThuren 2023-04-06 22:22:05 +02:00 committed by GitHub
parent e195bf7717
commit 2878ad4e72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -138,6 +138,7 @@
#include "scheduler/scheduler.h" #include "scheduler/scheduler.h"
#include "sensors/acceleration.h" #include "sensors/acceleration.h"
#include "sensors/adcinternal.h"
#include "sensors/barometer.h" #include "sensors/barometer.h"
#include "sensors/battery.h" #include "sensors/battery.h"
#include "sensors/boardalignment.h" #include "sensors/boardalignment.h"
@ -1116,6 +1117,14 @@ static bool mspProcessOutCommand(mspDescriptor_t srcDesc, int16_t cmdMSP, sbuf_t
// config state flags - bits to indicate the state of the configuration, reboot required, etc. // config state flags - bits to indicate the state of the configuration, reboot required, etc.
// other flags can be added as needed // other flags can be added as needed
sbufWriteU8(dst, (getRebootRequired() << 0)); sbufWriteU8(dst, (getRebootRequired() << 0));
// Added in API version 1.46
// Write CPU temp
#ifdef USE_ADC_INTERNAL
sbufWriteU16(dst, getCoreTemperatureCelsius());
#else
sbufWriteU16(dst, 0);
#endif
} }
break; break;

View file

@ -336,7 +336,7 @@
#define MSP_V2_FRAME 255 //MSPv2 payload indicator #define MSP_V2_FRAME 255 //MSPv2 payload indicator
// Additional commands that are not compatible with MultiWii // Additional commands that are not compatible with MultiWii
#define MSP_STATUS_EX 150 //out message cycletime, errors_count, CPU load, sensor present etc #define MSP_STATUS_EX 150 //out message cycletime, errors_count, CPU load, CPU temperature, sensor present etc
#define MSP_UID 160 //out message Unique device ID #define MSP_UID 160 //out message Unique device ID
#define MSP_GPSSVINFO 164 //out message get Signal Strength (only U-Blox) #define MSP_GPSSVINFO 164 //out message get Signal Strength (only U-Blox)
#define MSP_GPSSTATISTICS 166 //out message get GPS debugging data #define MSP_GPSSTATISTICS 166 //out message get GPS debugging data