File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11
11
#include <zephyr/logging/log.h>
12
12
LOG_MODULE_REGISTER (main , CONFIG_APP_LOG_LEVEL );
13
13
14
- void main (void )
14
+ int main (void )
15
15
{
16
16
int ret ;
17
17
const struct device * sensor ;
@@ -21,7 +21,7 @@ void main(void)
21
21
sensor = DEVICE_DT_GET (DT_NODELABEL (examplesensor0 ));
22
22
if (!device_is_ready (sensor )) {
23
23
LOG_ERR ("Sensor not ready" );
24
- return ;
24
+ return 0 ;
25
25
}
26
26
27
27
while (1 ) {
@@ -30,18 +30,20 @@ void main(void)
30
30
ret = sensor_sample_fetch (sensor );
31
31
if (ret < 0 ) {
32
32
LOG_ERR ("Could not fetch sample (%d)" , ret );
33
- return ;
33
+ return 0 ;
34
34
}
35
35
36
36
ret = sensor_channel_get (sensor , SENSOR_CHAN_PROX , & val );
37
37
if (ret < 0 ) {
38
38
LOG_ERR ("Could not get sample (%d)" , ret );
39
- return ;
39
+ return 0 ;
40
40
}
41
41
42
42
printk ("Sensor value: %d\n" , val .val1 );
43
43
44
44
k_sleep (K_MSEC (1000 ));
45
45
}
46
+
47
+ return 0 ;
46
48
}
47
49
You can’t perform that action at this time.
0 commit comments