1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +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 "sensors/acceleration.h"
#include "sensors/adcinternal.h"
#include "sensors/barometer.h"
#include "sensors/battery.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.
// other flags can be added as needed
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;