@@ -26,8 +26,8 @@ int32_t STHS34PF80::begin()
2626 // Set ambient temperature average (AVG_TAMB = 8)
2727 int32_t tAmbErr = setAverageTAmbientNumber (STHS34PF80_AVG_T_8);
2828
29- // Block data rate update (BDU) to 1Hz
30- int32_t blockErr = setBlockDataUpdate (STHS34PF80_TMOS_ODR_AT_1Hz );
29+ // Set block data rate update to true
30+ int32_t blockErr = setBlockDataUpdate (true );
3131
3232 // Set the data rate (ODR) to 1Hz
3333 int32_t odrErr = setTmosODR (STHS34PF80_TMOS_ODR_AT_1Hz);
@@ -71,13 +71,9 @@ int32_t STHS34PF80::isConnected()
7171
7272// / @brief Checks to see if the data ready flag is high
7373// / @return Data ready code (0 for not ready, 1 for ready)
74- bool STHS34PF80::getDataReady ()
74+ int32_t STHS34PF80::getDataReady (sths34pf80_tmos_drdy_status_t *drdy )
7575{
76- sths34pf80_tmos_drdy_status_t dataReady;
77-
78- sths34pf80_tmos_drdy_status_get (&sensor, &dataReady);
79-
80- return dataReady.drdy ;
76+ return sths34pf80_tmos_drdy_status_get (&sensor, drdy);
8177}
8278
8379// / @brief This function checks the status of the of the device if
@@ -146,7 +142,7 @@ int32_t STHS34PF80::getTemperatureData(float *tempVal)
146142 int32_t retVal = sths34pf80_tobject_raw_get (&sensor, &tempValFill);
147143
148144 // Divide the raw value by the sensitivity
149- *tempVal = tempValFill / sensitivity;
145+ *tempVal = ( float ) tempValFill / sensitivity;
150146
151147 return retVal;
152148}
@@ -231,7 +227,7 @@ int32_t STHS34PF80::getTmosSensitivity(float *sense)
231227 uint16_t res1 = 2048 ;
232228 float res2 = 16 ;
233229
234- *sense = (senseFill - res1) / res2;
230+ *sense = (float )( senseFill - res1) / res2;
235231 return err;
236232}
237233
@@ -292,17 +288,17 @@ int32_t STHS34PF80::setTmosODR(sths34pf80_tmos_odr_t val)
292288// / for output registers TOBJECT (26h - 27h) and TAMBIENT (28h - 29h).
293289// / @param val Block data update bit (0 disabled, 1 enabled), -1 for error
294290// / @return Error code (0 no error)
295- int32_t STHS34PF80::getBlockDataUpdate (uint8_t *val)
291+ int32_t STHS34PF80::getBlockDataUpdate (bool *val)
296292{
297- return sths34pf80_block_data_update_get (&sensor, val);
293+ return sths34pf80_block_data_update_get (&sensor, ( uint8_t *) val);
298294}
299295
300296// / @brief This function sets the block data update feature
301297// / for output registeres TOBJECT (26h - 27h) and TAMBIENT (28h - 29h).
302298// / Block data update bit (0 disabled, 1 enabled)
303299// / @param val Value to set the block data update bit
304300// / @return Error code (0 no error)
305- int32_t STHS34PF80::setBlockDataUpdate (uint8_t val)
301+ int32_t STHS34PF80::setBlockDataUpdate (bool val)
306302{
307303 return sths34pf80_block_data_update_set (&sensor, val);
308304}
0 commit comments