InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.64k stars 904 forks source link

weather: Add functions for temperature in Fahrenheit #1785

Closed FintasticMan closed 6 months ago

FintasticMan commented 1 year ago

This adds some functions to the WeatherService class for getting the temperature in Fahrenheit. This could theoretically overflow, but only if the temperature is 164.27 °C or higher (or -164.28 °C or lower), which I believe is unlikely enough that we don't need to worry about it. Please tell me if you think that is an issue.

This doesn't add a setting to display the temperature in Fahrenheit in PTS.

Related to #1783.

github-actions[bot] commented 1 year ago
Build size and comparison to main: Section Size Difference
text 377496B -16B
data 940B 0B
bss 63420B 0B
Avamander commented 1 year ago

I really wouldn't add the helper to the data struct definitions, that file is ideally just about the data.

There are other helper functions in the weather controller, that seems like a better place for it?

FintasticMan commented 1 year ago

Ah OK, I was just looking at what you said here, but I've just pushed a change that adds the functions to the WeatherService instead.

matoro commented 8 months ago

Hi, wondering if there's anything missing to allow this and the PTS change to be merged? Was very surprised to discover weather service does not support Fahrenheit.

FintasticMan commented 8 months ago

I don't think there's anything blocking this in particular. There are a couple of issues to be worked out with the weather implementation, which take priority over problems like Fahrenheit not being supported.

FintasticMan commented 6 months ago

This is superseded by #1805.