Skip to content

Commit

Permalink
arch_config: Remove float32_t typedef (#56)
Browse files Browse the repository at this point in the history
float is defined to be a single precision floating point type and on
almost all platforms it is a IEEE-754 32 bit floating point. A platform
not supporting IEEE-754 is out of scope for this driver.
  • Loading branch information
rnestler authored May 8, 2020
1 parent 5d3454a commit 1d83b81
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
3 changes: 0 additions & 3 deletions embedded-uart-common/sensirion_arch_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ extern "C" {
* typedef char int8_t;
* typedef unsigned char uint8_t; */

/* Types not typically provided by <stdint.h> */
typedef float float32_t;

/**
* Define the endianness of your architecture:
* 0: little endian, 1: big endian
Expand Down
2 changes: 1 addition & 1 deletion sps30-uart/sps30.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int16_t sps30_read_measurement(struct sps30_measurement *measurement) {
union {
uint16_t u16_value[2];
uint32_t u32_value;
float32_t f32_value;
float f32_value;
} val, data[10];

ret = sensirion_shdlc_xcv(SPS30_ADDR, SPS30_CMD_READ_MEASUREMENT, 0, NULL,
Expand Down
20 changes: 10 additions & 10 deletions sps30-uart/sps30.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ extern "C" {
#define SPS30_GET_ERR_STATE(err_code) ((err_code)&0xff)

struct sps30_measurement {
float32_t mc_1p0;
float32_t mc_2p5;
float32_t mc_4p0;
float32_t mc_10p0;
float32_t nc_0p5;
float32_t nc_1p0;
float32_t nc_2p5;
float32_t nc_4p0;
float32_t nc_10p0;
float32_t typical_particle_size;
float mc_1p0;
float mc_2p5;
float mc_4p0;
float mc_10p0;
float nc_0p5;
float nc_1p0;
float nc_2p5;
float nc_4p0;
float nc_10p0;
float typical_particle_size;
};

/**
Expand Down

0 comments on commit 1d83b81

Please sign in to comment.