Skip to content

Commit f33adc5

Browse files
moonlight83340danieldegrasse
authored andcommitted
samples: shields: x_nucleo_iks02a1: Remove unused variable
The `die_temp` variable declared under `CONFIG_ISM330DHCX_ENABLE_TEMP` was never used. Instead `die_temp2` was used without using `CONFIG_ISM330DHCX_ENABLE_TEMP`. Removing it to avoid confusion. The variable `die_temp2` holds temperature data from IIS2MDC. Since there is no other variable with this purpose anymore, rename it to die_temp for clarity. Signed-off-by: Gaetan Perrot <[email protected]>
1 parent 80b7745 commit f33adc5

File tree

1 file changed

+2
-6
lines changed
  • samples/shields/x_nucleo_iks02a1/standard/src

1 file changed

+2
-6
lines changed

samples/shields/x_nucleo_iks02a1/standard/src/main.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,7 @@ static void ism330dhcx_config(const struct device *ism330dhcx)
160160

161161
int main(void)
162162
{
163-
#ifdef CONFIG_ISM330DHCX_ENABLE_TEMP
164163
struct sensor_value die_temp;
165-
#endif
166-
struct sensor_value die_temp2;
167164
struct sensor_value accel1[3], accel2[3];
168165
struct sensor_value gyro[3];
169166
struct sensor_value magn[3];
@@ -215,7 +212,7 @@ int main(void)
215212

216213
sensor_channel_get(iis2dlpc, SENSOR_CHAN_ACCEL_XYZ, accel2);
217214
sensor_channel_get(iis2mdc, SENSOR_CHAN_MAGN_XYZ, magn);
218-
sensor_channel_get(iis2mdc, SENSOR_CHAN_DIE_TEMP, &die_temp2);
215+
sensor_channel_get(iis2mdc, SENSOR_CHAN_DIE_TEMP, &die_temp);
219216
sensor_channel_get(ism330dhcx, SENSOR_CHAN_ACCEL_XYZ, accel1);
220217
sensor_channel_get(ism330dhcx, SENSOR_CHAN_GYRO_XYZ, gyro);
221218

@@ -237,8 +234,7 @@ int main(void)
237234
sensor_value_to_double(&magn[1]),
238235
sensor_value_to_double(&magn[2]));
239236

240-
printf("IIS2MDC: Temperature: %.1f C\n",
241-
sensor_value_to_double(&die_temp2));
237+
printf("IIS2MDC: Temperature: %.1f C\n", sensor_value_to_double(&die_temp));
242238

243239
printf("ISM330DHCX: Accel (m.s-2): x: %.3f, y: %.3f, z: %.3f\n",
244240
sensor_value_to_double(&accel1[0]),

0 commit comments

Comments
 (0)