From a8b540adcf56ce15006b875cfeb5dc78ec35f512 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 28 Nov 2019 19:08:36 +0100 Subject: [PATCH] doc/driver-guide.md: add a note about float floating point variables should generally be avoided. --- doc/doxygen/src/driver-guide.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/doxygen/src/driver-guide.md b/doc/doxygen/src/driver-guide.md index c5fcba9d64..739b0c32c8 100644 --- a/doc/doxygen/src/driver-guide.md +++ b/doc/doxygen/src/driver-guide.md @@ -21,6 +21,10 @@ already converted values in some physical unit instead of RAW data, so that users can work directly with data from different devices directly without having to care about device specific conversion. +However, please avoid the use of `float` or `double`. Instead, multiply to the +next SI (or appropriate) unit. E.g. if an ADC would return values like `1.23 V`, +chose to return `1230 mV` instead. + Additionally towards ease of use, all device drivers in RIOT should provide a similar 'look and feel'. They should behave similar concerning things like their state after initialization, like their used data representation and so on.