gfroerli / firmware

Firmware for the water temperature sensor project
GNU General Public License v3.0
6 stars 1 forks source link

Implement measurement decode #131

Open rnestler opened 2 years ago

dbrgn commented 1 year ago

@rnestler I rebased and continued with this PR. First I wrote some tests and noticed that they always failed. After some debugging, I changed the loading of the bits from LE to BE: cf7f06e829350ecc67661f56ee4cebd6ada43d33 To be honest I still find it hard to understand the bitvec crate, but the tests pass now.

From my view, after adding these tests, the PR should now be ready to merge. What do you think?

rnestler commented 1 year ago

I changed the loading of the bits from LE to BE

Well this makes sense, since we store the bits in BE order (most significant bit first).

rnestler commented 1 year ago

To be honest I still find it hard to understand the bitvec crate, but the tests pass now.

True. Maybe it would be easier to just hand-roll the masking and shifting of the bits.