Sensirion / embedded-sps

Embedded i2c Driver for Sensirion Particulate Matter Sensors - Download the Zip Package from the Release Page
https://github.com/Sensirion/embedded-sps/releases
BSD 3-Clause "New" or "Revised" License
45 stars 15 forks source link

Use generic word count macro #49

Closed abrauchli closed 3 years ago

abrauchli commented 4 years ago

Use the generic SENSIRION_NUM_WORDS macro to convert bytes to words

Check the following:

rnestler commented 3 years ago

@abrauchli Ping.

abrauchli commented 3 years ago

This is flawed, SENSIRION_NUM_WORDS takes a type and runs sizeof() on it, using it on a #define constant results in that constant's type (in this case probably int) being used.. let's kill it with fire.