Skip to content

Commit e8dfaa6

Browse files
committed
Replaces float_t type with float so that older arduino boards don't get grumpy
1 parent c8b79c1 commit e8dfaa6

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

src/st_src/ism330dhcx_reg.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -88,64 +88,64 @@ int32_t ism330dhcx_write_reg(stmdev_ctx_t *ctx, uint8_t reg,
8888
*
8989
*/
9090

91-
float_t ism330dhcx_from_fs2g_to_mg(int16_t lsb)
91+
float ism330dhcx_from_fs2g_to_mg(int16_t lsb)
9292
{
93-
return ((float_t)lsb * 0.061f);
93+
return ((float)lsb * 0.061f);
9494
}
9595

96-
float_t ism330dhcx_from_fs4g_to_mg(int16_t lsb)
96+
float ism330dhcx_from_fs4g_to_mg(int16_t lsb)
9797
{
98-
return ((float_t)lsb * 0.122f);
98+
return ((float)lsb * 0.122f);
9999
}
100100

101-
float_t ism330dhcx_from_fs8g_to_mg(int16_t lsb)
101+
float ism330dhcx_from_fs8g_to_mg(int16_t lsb)
102102
{
103-
return ((float_t)lsb * 0.244f);
103+
return ((float)lsb * 0.244f);
104104
}
105105

106-
float_t ism330dhcx_from_fs16g_to_mg(int16_t lsb)
106+
float ism330dhcx_from_fs16g_to_mg(int16_t lsb)
107107
{
108-
return ((float_t)lsb * 0.488f);
108+
return ((float)lsb * 0.488f);
109109
}
110110

111-
float_t ism330dhcx_from_fs125dps_to_mdps(int16_t lsb)
111+
float ism330dhcx_from_fs125dps_to_mdps(int16_t lsb)
112112
{
113-
return ((float_t)lsb * 4.375f);
113+
return ((float)lsb * 4.375f);
114114
}
115115

116-
float_t ism330dhcx_from_fs250dps_to_mdps(int16_t lsb)
116+
float ism330dhcx_from_fs250dps_to_mdps(int16_t lsb)
117117
{
118-
return ((float_t)lsb * 8.75f);
118+
return ((float)lsb * 8.75f);
119119
}
120120

121-
float_t ism330dhcx_from_fs500dps_to_mdps(int16_t lsb)
121+
float ism330dhcx_from_fs500dps_to_mdps(int16_t lsb)
122122
{
123-
return ((float_t)lsb * 17.50f);
123+
return ((float)lsb * 17.50f);
124124
}
125125

126-
float_t ism330dhcx_from_fs1000dps_to_mdps(int16_t lsb)
126+
float ism330dhcx_from_fs1000dps_to_mdps(int16_t lsb)
127127
{
128-
return ((float_t)lsb * 35.0f);
128+
return ((float)lsb * 35.0f);
129129
}
130130

131-
float_t ism330dhcx_from_fs2000dps_to_mdps(int16_t lsb)
131+
float ism330dhcx_from_fs2000dps_to_mdps(int16_t lsb)
132132
{
133-
return ((float_t)lsb * 70.0f);
133+
return ((float)lsb * 70.0f);
134134
}
135135

136-
float_t ism330dhcx_from_fs4000dps_to_mdps(int16_t lsb)
136+
float ism330dhcx_from_fs4000dps_to_mdps(int16_t lsb)
137137
{
138-
return ((float_t)lsb * 140.0f);
138+
return ((float)lsb * 140.0f);
139139
}
140140

141-
float_t ism330dhcx_from_lsb_to_celsius(int16_t lsb)
141+
float ism330dhcx_from_lsb_to_celsius(int16_t lsb)
142142
{
143-
return (((float_t)lsb / 256.0f) + 25.0f);
143+
return (((float)lsb / 256.0f) + 25.0f);
144144
}
145145

146-
float_t ism330dhcx_from_lsb_to_nsec(int32_t lsb)
146+
float ism330dhcx_from_lsb_to_nsec(int32_t lsb)
147147
{
148-
return ((float_t)lsb * 25000.0f);
148+
return ((float)lsb * 25000.0f);
149149
}
150150

151151
/**

src/st_src/ism330dhcx_reg.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,21 +2829,21 @@ int32_t ism330dhcx_write_reg(stmdev_ctx_t *ctx, uint8_t reg,
28292829
uint8_t *data,
28302830
uint16_t len);
28312831

2832-
float_t ism330dhcx_from_fs2g_to_mg(int16_t lsb);
2833-
float_t ism330dhcx_from_fs4g_to_mg(int16_t lsb);
2834-
float_t ism330dhcx_from_fs8g_to_mg(int16_t lsb);
2835-
float_t ism330dhcx_from_fs16g_to_mg(int16_t lsb);
2832+
float ism330dhcx_from_fs2g_to_mg(int16_t lsb);
2833+
float ism330dhcx_from_fs4g_to_mg(int16_t lsb);
2834+
float ism330dhcx_from_fs8g_to_mg(int16_t lsb);
2835+
float ism330dhcx_from_fs16g_to_mg(int16_t lsb);
28362836

2837-
float_t ism330dhcx_from_fs125dps_to_mdps(int16_t lsb);
2838-
float_t ism330dhcx_from_fs250dps_to_mdps(int16_t lsb);
2839-
float_t ism330dhcx_from_fs500dps_to_mdps(int16_t lsb);
2840-
float_t ism330dhcx_from_fs1000dps_to_mdps(int16_t lsb);
2841-
float_t ism330dhcx_from_fs2000dps_to_mdps(int16_t lsb);
2842-
float_t ism330dhcx_from_fs4000dps_to_mdps(int16_t lsb);
2837+
float ism330dhcx_from_fs125dps_to_mdps(int16_t lsb);
2838+
float ism330dhcx_from_fs250dps_to_mdps(int16_t lsb);
2839+
float ism330dhcx_from_fs500dps_to_mdps(int16_t lsb);
2840+
float ism330dhcx_from_fs1000dps_to_mdps(int16_t lsb);
2841+
float ism330dhcx_from_fs2000dps_to_mdps(int16_t lsb);
2842+
float ism330dhcx_from_fs4000dps_to_mdps(int16_t lsb);
28432843

2844-
float_t ism330dhcx_from_lsb_to_celsius(int16_t lsb);
2844+
float ism330dhcx_from_lsb_to_celsius(int16_t lsb);
28452845

2846-
float_t ism330dhcx_from_lsb_to_nsec(int32_t lsb);
2846+
float ism330dhcx_from_lsb_to_nsec(int32_t lsb);
28472847

28482848
typedef enum
28492849
{

0 commit comments

Comments
 (0)