samples: shields: x_nucleo_iks02a1: run clang-format
Run clang-format on files. Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
This commit is contained in:
parent
f33adc5ade
commit
0dd63fcbd3
@ -13,8 +13,7 @@
|
||||
#ifdef CONFIG_IIS2DLPC_TRIGGER
|
||||
static int iis2dlpc_trig_cnt;
|
||||
|
||||
static void iis2dlpc_trigger_handler(const struct device *dev,
|
||||
const struct sensor_trigger *trig)
|
||||
static void iis2dlpc_trigger_handler(const struct device *dev, const struct sensor_trigger *trig)
|
||||
{
|
||||
sensor_sample_fetch_chan(dev, SENSOR_CHAN_ACCEL_XYZ);
|
||||
iis2dlpc_trig_cnt++;
|
||||
@ -24,8 +23,7 @@ static void iis2dlpc_trigger_handler(const struct device *dev,
|
||||
#ifdef CONFIG_IIS2MDC_TRIGGER
|
||||
static int iis2mdc_trig_cnt;
|
||||
|
||||
static void iis2mdc_trigger_handler(const struct device *dev,
|
||||
const struct sensor_trigger *trig)
|
||||
static void iis2mdc_trigger_handler(const struct device *dev, const struct sensor_trigger *trig)
|
||||
{
|
||||
sensor_sample_fetch_chan(dev, SENSOR_CHAN_ALL);
|
||||
iis2mdc_trig_cnt++;
|
||||
@ -59,16 +57,16 @@ static void iis2dlpc_config(const struct device *iis2dlpc)
|
||||
odr_attr.val1 = 100;
|
||||
odr_attr.val2 = 0;
|
||||
|
||||
if (sensor_attr_set(iis2dlpc, SENSOR_CHAN_ACCEL_XYZ,
|
||||
SENSOR_ATTR_SAMPLING_FREQUENCY, &odr_attr) < 0) {
|
||||
if (sensor_attr_set(iis2dlpc, SENSOR_CHAN_ACCEL_XYZ, SENSOR_ATTR_SAMPLING_FREQUENCY,
|
||||
&odr_attr) < 0) {
|
||||
printk("Cannot set sampling frequency for IIS2DLPC accel\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sensor_g_to_ms2(16, &fs_attr);
|
||||
|
||||
if (sensor_attr_set(iis2dlpc, SENSOR_CHAN_ACCEL_XYZ,
|
||||
SENSOR_ATTR_FULL_SCALE, &fs_attr) < 0) {
|
||||
if (sensor_attr_set(iis2dlpc, SENSOR_CHAN_ACCEL_XYZ, SENSOR_ATTR_FULL_SCALE, &fs_attr) <
|
||||
0) {
|
||||
printk("Cannot set sampling frequency for IIS2DLPC gyro\n");
|
||||
return;
|
||||
}
|
||||
@ -90,8 +88,8 @@ static void iis2mdc_config(const struct device *iis2mdc)
|
||||
odr_attr.val1 = 100;
|
||||
odr_attr.val2 = 0;
|
||||
|
||||
if (sensor_attr_set(iis2mdc, SENSOR_CHAN_ALL,
|
||||
SENSOR_ATTR_SAMPLING_FREQUENCY, &odr_attr) < 0) {
|
||||
if (sensor_attr_set(iis2mdc, SENSOR_CHAN_ALL, SENSOR_ATTR_SAMPLING_FREQUENCY, &odr_attr) <
|
||||
0) {
|
||||
printk("Cannot set sampling frequency for IIS2MDC\n");
|
||||
return;
|
||||
}
|
||||
@ -113,16 +111,16 @@ static void ism330dhcx_config(const struct device *ism330dhcx)
|
||||
odr_attr.val1 = 416;
|
||||
odr_attr.val2 = 0;
|
||||
|
||||
if (sensor_attr_set(ism330dhcx, SENSOR_CHAN_ACCEL_XYZ,
|
||||
SENSOR_ATTR_SAMPLING_FREQUENCY, &odr_attr) < 0) {
|
||||
if (sensor_attr_set(ism330dhcx, SENSOR_CHAN_ACCEL_XYZ, SENSOR_ATTR_SAMPLING_FREQUENCY,
|
||||
&odr_attr) < 0) {
|
||||
printk("Cannot set sampling frequency for ISM330DHCX accel\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sensor_g_to_ms2(16, &fs_attr);
|
||||
|
||||
if (sensor_attr_set(ism330dhcx, SENSOR_CHAN_ACCEL_XYZ,
|
||||
SENSOR_ATTR_FULL_SCALE, &fs_attr) < 0) {
|
||||
if (sensor_attr_set(ism330dhcx, SENSOR_CHAN_ACCEL_XYZ, SENSOR_ATTR_FULL_SCALE, &fs_attr) <
|
||||
0) {
|
||||
printk("Cannot set sampling frequency for ISM330DHCX accel\n");
|
||||
return;
|
||||
}
|
||||
@ -131,16 +129,16 @@ static void ism330dhcx_config(const struct device *ism330dhcx)
|
||||
odr_attr.val1 = 208;
|
||||
odr_attr.val2 = 0;
|
||||
|
||||
if (sensor_attr_set(ism330dhcx, SENSOR_CHAN_GYRO_XYZ,
|
||||
SENSOR_ATTR_SAMPLING_FREQUENCY, &odr_attr) < 0) {
|
||||
if (sensor_attr_set(ism330dhcx, SENSOR_CHAN_GYRO_XYZ, SENSOR_ATTR_SAMPLING_FREQUENCY,
|
||||
&odr_attr) < 0) {
|
||||
printk("Cannot set sampling frequency for ISM330DHCX gyro\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sensor_degrees_to_rad(250, &fs_attr);
|
||||
|
||||
if (sensor_attr_set(ism330dhcx, SENSOR_CHAN_GYRO_XYZ,
|
||||
SENSOR_ATTR_FULL_SCALE, &fs_attr) < 0) {
|
||||
if (sensor_attr_set(ism330dhcx, SENSOR_CHAN_GYRO_XYZ, SENSOR_ATTR_FULL_SCALE, &fs_attr) <
|
||||
0) {
|
||||
printk("Cannot set fs for ISM330DHCX gyro\n");
|
||||
return;
|
||||
}
|
||||
@ -224,27 +222,23 @@ int main(void)
|
||||
printf("X-NUCLEO-IKS02A1 sensor Mode 1 dashboard\n\n");
|
||||
|
||||
printf("IIS2DLPC: Accel (m.s-2): x: %.3f, y: %.3f, z: %.3f\n",
|
||||
sensor_value_to_double(&accel2[0]),
|
||||
sensor_value_to_double(&accel2[1]),
|
||||
sensor_value_to_double(&accel2[2]));
|
||||
sensor_value_to_double(&accel2[0]), sensor_value_to_double(&accel2[1]),
|
||||
sensor_value_to_double(&accel2[2]));
|
||||
|
||||
/* iis2mdc */
|
||||
printf("IIS2MDC: Magn (gauss): x: %.3f, y: %.3f, z: %.3f\n",
|
||||
sensor_value_to_double(&magn[0]),
|
||||
sensor_value_to_double(&magn[1]),
|
||||
sensor_value_to_double(&magn[0]), sensor_value_to_double(&magn[1]),
|
||||
sensor_value_to_double(&magn[2]));
|
||||
|
||||
printf("IIS2MDC: Temperature: %.1f C\n", sensor_value_to_double(&die_temp));
|
||||
|
||||
printf("ISM330DHCX: Accel (m.s-2): x: %.3f, y: %.3f, z: %.3f\n",
|
||||
sensor_value_to_double(&accel1[0]),
|
||||
sensor_value_to_double(&accel1[1]),
|
||||
sensor_value_to_double(&accel1[2]));
|
||||
sensor_value_to_double(&accel1[0]), sensor_value_to_double(&accel1[1]),
|
||||
sensor_value_to_double(&accel1[2]));
|
||||
|
||||
printf("ISM330DHCX: GYro (dps): x: %.3f, y: %.3f, z: %.3f\n",
|
||||
sensor_value_to_double(&gyro[0]),
|
||||
sensor_value_to_double(&gyro[1]),
|
||||
sensor_value_to_double(&gyro[2]));
|
||||
sensor_value_to_double(&gyro[0]), sensor_value_to_double(&gyro[1]),
|
||||
sensor_value_to_double(&gyro[2]));
|
||||
#ifdef CONFIG_IIS2DLPC_TRIGGER
|
||||
printk("%d:: iis2dlpc trig %d\n", cnt, iis2dlpc_trig_cnt);
|
||||
#endif
|
||||
@ -258,7 +252,6 @@ int main(void)
|
||||
printk("%d:: ism330dhcx gyr trig %d\n", cnt, ism330dhcx_gyr_trig_cnt);
|
||||
#endif
|
||||
|
||||
|
||||
cnt++;
|
||||
k_sleep(K_MSEC(2000));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user