add caveat in documentation

This commit is contained in:
Dan Halbert 2022-10-13 11:47:10 -04:00
parent f7d39ceae4
commit ead03cd96f
1 changed files with 5 additions and 1 deletions

View File

@ -104,7 +104,11 @@ MP_PROPERTY_GETTER(mcu_processor_reset_reason_obj,
//| temperature: Optional[float]
//| """The on-chip temperature, in Celsius, as a float. (read-only)
//|
//| Is `None` if the temperature is not available."""
//| Is `None` if the temperature is not available.
//|
//| .. note :: On small SAMD21 builds without external flash,
//| the reported temperature has reduced accuracy and precision, to save code space.
//| """
STATIC mp_obj_t mcu_processor_get_temperature(mp_obj_t self) {
float temperature = common_hal_mcu_processor_get_temperature();
return isnan(temperature) ? mp_const_none : mp_obj_new_float(temperature);