This repository was archived by the owner on Jan 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
examples/Example_Zephyr/src Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 17
17
#include <device.h>
18
18
#include <drivers/i2c.h>
19
19
#include <errno.h>
20
- #include <logging/log.h>
21
20
#include <zephyr.h>
22
21
#include <zephyr/types.h>
23
22
26
25
27
26
#define I2C_DEV "I2C_0"
28
27
29
- LOG_MODULE_REGISTER (zephyr_main ); // init logging
30
-
31
28
struct device * gpio_dev ;
32
29
struct device * i2c_dev ;
33
30
/* I2C pins used are defaults for I2C_0 on nrf52840
@@ -39,7 +36,7 @@ uint8_t init_gpio(void) {
39
36
const char * gpioName = "GPIO_0" ;
40
37
gpio_dev = device_get_binding (gpioName );
41
38
if (gpio_dev == NULL ) {
42
- LOG_ERR ( " Could not get %s device" , gpioName );
39
+ printk ( "Error: Could not get %s device\n " , gpioName );
43
40
return - EIO ;
44
41
}
45
42
int err = set_gpio_dev (gpio_dev );
@@ -53,28 +50,28 @@ uint8_t init_i2c(void) {
53
50
i2c_dev = device_get_binding (I2C_DEV );
54
51
if (!i2c_dev )
55
52
{
56
- LOG_ERR ("I2C_0 error" );
53
+ printk ("I2C_0 error\n " );
57
54
return -1 ;
58
55
}
59
56
else
60
57
{
61
- LOG_INF ("I2C_0 Init OK" );
58
+ printk ("I2C_0 Init OK\n " );
62
59
return 0 ;
63
60
}
64
61
}
65
62
66
63
uint8_t init_gps (void ) {
67
64
if (gps_begin (i2c_dev ) != 0 )
68
65
{
69
- LOG_ERR ("Ublox GPS init error!" );
66
+ printk ("Ublox GPS init error!\n " );
70
67
return -1 ;
71
68
}
72
69
return 0 ;
73
70
}
74
71
75
72
76
73
void main (void ) {
77
- LOG_INF ("Ublox Zephyr example" );
74
+ printk ("Ublox Zephyr example\n " );
78
75
79
76
int err ;
80
77
err = init_gpio ();
You can’t perform that action at this time.
0 commit comments