UMSATS / payload-tsat

STM32 Projects for the development of the 2023-2025 TSAT7 biological payload module.
MIT License
1 stars 0 forks source link

Consider Converting TMP235 Readings to Little-Endian #15

Open Koloss0 opened 5 months ago

Koloss0 commented 5 months ago

The TMP235_Read_Temp function returns a 16 bit value which is (to my memory) big endian. However, the L4 line of STM32's are natively little endian. Thus converting the value before it gets returned from TMP235_Read_Temp might save us from making silly mistakes. The old TSAT-6 code did this conversion too, but it did it as the CAN message was being created.

Luckily I've written a BE to LE conversion function already. At the time of writing this it is located in Core/Inc/utils.h. However, in the future I might add it to the TSAT Utilities Kit since it is a nice-to-have.

Koloss0 commented 5 months ago

We should really fact check if the TMP235 does return a result in BE though.

Koloss0 commented 5 months ago

Update: The BE to LE function has moved to the TSAT Utilities Kit in tuk/utils.h