File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed
samples/sensor/lps22hb/src Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -41,35 +41,17 @@ static void process_sample(struct device *dev)
4141
4242}
4343
44- static void lps22hb_handler (struct device * dev ,
45- struct sensor_trigger * trig )
46- {
47- process_sample (dev );
48- }
49-
5044void main (void )
5145{
52- struct device * dev = device_get_binding ("LPS22HB" );
46+ struct device * dev = device_get_binding (DT_INST_0_ST_LPS22HB_PRESS_LABEL );
5347
5448 if (dev == NULL ) {
5549 printf ("Could not get LPS22HB device\n" );
5650 return ;
5751 }
5852
59- if (IS_ENABLED (CONFIG_LPS22HB_TRIGGER )) {
60- struct sensor_trigger trig = {
61- .type = SENSOR_TRIG_DATA_READY ,
62- .chan = SENSOR_CHAN_ALL ,
63- };
64- if (sensor_trigger_set (dev , & trig , lps22hb_handler ) < 0 ) {
65- printf ("Cannot configure trigger\n" );
66- return ;
67- };
68- }
69-
70- while (!IS_ENABLED (CONFIG_LPS22HB_TRIGGER )) {
53+ while (true) {
7154 process_sample (dev );
7255 k_sleep (K_MSEC (2000 ));
7356 }
74- k_sleep (K_FOREVER );
7557}
You can’t perform that action at this time.
0 commit comments