Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getCoreTemp #12608

Merged
merged 4 commits into from Apr 6, 2023
Merged

add getCoreTemp #12608

merged 4 commits into from Apr 6, 2023

Conversation

HThuren
Copy link
Member

@HThuren HThuren commented Apr 2, 2023

Add getCoreTemperature to MSP_STATUS_EX call, to show CPU temperature in configurator.
Last 16bit unsigned in MSP_STATUS_EX

@github-actions

This comment has been minimized.

@blckmn
Copy link
Member

blckmn commented Apr 2, 2023

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> FAIL
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> FAIL
  • assigned to an approver -> FAIL
  • approver count at least three -> FAIL

Comment on lines 1121 to 1130
// Added in API version 1.46
// Write CPU temp
if (cmdMSP == MSP_STATUS_EX) {
#ifdef USE_ADC_INTERNAL
int16_t coretemp = getCoreTemperatureCelsius();
#else
int16_t coretemp = 0;
#endif
sbufWriteU16(dst, coretemp);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we have MSP_STATUS and MSP_STATUS_EX almost the same? What is the difference between both? I see the PID profile count vs gyro cycle time. Something more? Why we don't send the coretemp for both?

Is not a problem of your code, only trying to understand.

Copy link
Member Author

@HThuren HThuren Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say, believe its a matter of backward compability. But also wonder, if this are not an issue, since we have changed API to 1.46. In betaflight_configurator, I will check for API 1.46 if the value can be shown.
No problem from my point of view to send the coreTemp for both MSP_STATUS and MSP_STATUS_EX.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed, now no difference MSP_STATUS and MSP_STATUS_EX

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haslinghuis hope you agree

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 we should drop MSP_STATUS_EX and consolidate functionality using updated MSP_STATUS

@klutvott123 does this impact LUA? Thoughts?

MSP_STATUS_EX was introduced long time ago as MSP_STATUS is MultiWii compliant 😕

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_32)) {
        MSP.send_message(MSPCodes.MSP_STATUS_EX, false, false);
    } else {
        MSP.send_message(MSPCodes.MSP_STATUS, false, false);
    }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultiWii Homepage look very obsolute ...

Now also repported from MSP_STATUS
@github-actions

This comment has been minimized.

src/main/msp/msp.c Outdated Show resolved Hide resolved
Co-authored-by: Míguel Ángel Mulero Martínez <mcgivergim@gmail.com>
@github-actions
Copy link

github-actions bot commented Apr 5, 2023

Do you want to test this code? Here you have an automated build:
Assets
WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!

@HThuren
Copy link
Member Author

HThuren commented Apr 5, 2023

need test, maybe something are wrong, I cant get the image STM32H743 from the test run to work
@blckmn, Are there requirement to align size of MSP datapacket, ie. use U8 insted of U16 ?

@haslinghuis haslinghuis merged commit 2878ad4 into betaflight:master Apr 6, 2023
19 checks passed
davidbitton pushed a commit to davidbitton/betaflight that referenced this pull request Feb 5, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: COMPLETED
Development

Successfully merging this pull request may close these issues.

None yet

5 participants