golioth-firmware-sdk icon indicating copy to clipboard operation
golioth-firmware-sdk copied to clipboard

examples: zephyr: Fix get_temperature with temp0 DT alias

Open cdwilson opened this issue 9 months ago • 2 comments

When a temp0 devicetree alias is added to the board overlay, the get_temperature function was looping through all sensor channels, always returning the result of reading the last one, even if it was not a supported channel.

This fixes the function so that it returns after the first successful read from a temperature channel.

cdwilson avatar Apr 29 '24 15:04 cdwilson

Visit the preview URL for this PR (updated for commit 5f5f010):

https://golioth-firmware-sdk-doxygen-dev--pr470-cdwilson-fix-z-gwtdbows.web.app

(expires Mon, 06 May 2024 15:36:41 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a9993e61697a3983f3479e468bcb0b616f9a0578

github-actions[bot] avatar Apr 29 '24 15:04 github-actions[bot]

Code Coverage

Type Coverage
lines 55.6% (1035 of 1862 lines)
functions 57.7% (94 of 163 functions)

github-actions[bot] avatar Apr 29 '24 15:04 github-actions[bot]