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 1717#include <device.h>
1818#include <drivers/i2c.h>
1919#include <errno.h>
20- #include <logging/log.h>
2120#include <zephyr.h>
2221#include <zephyr/types.h>
2322
2625
2726#define I2C_DEV "I2C_0"
2827
29- LOG_MODULE_REGISTER (zephyr_main ); // init logging
30-
3128struct device * gpio_dev ;
3229struct device * i2c_dev ;
3330/* I2C pins used are defaults for I2C_0 on nrf52840
@@ -39,7 +36,7 @@ uint8_t init_gpio(void) {
3936 const char * gpioName = "GPIO_0" ;
4037 gpio_dev = device_get_binding (gpioName );
4138 if (gpio_dev == NULL ) {
42- LOG_ERR ( " Could not get %s device" , gpioName );
39+ printk ( "Error: Could not get %s device\n " , gpioName );
4340 return - EIO ;
4441 }
4542 int err = set_gpio_dev (gpio_dev );
@@ -53,28 +50,28 @@ uint8_t init_i2c(void) {
5350 i2c_dev = device_get_binding (I2C_DEV );
5451 if (!i2c_dev )
5552 {
56- LOG_ERR ("I2C_0 error" );
53+ printk ("I2C_0 error\n " );
5754 return -1 ;
5855 }
5956 else
6057 {
61- LOG_INF ("I2C_0 Init OK" );
58+ printk ("I2C_0 Init OK\n " );
6259 return 0 ;
6360 }
6461}
6562
6663uint8_t init_gps (void ) {
6764 if (gps_begin (i2c_dev ) != 0 )
6865 {
69- LOG_ERR ("Ublox GPS init error!" );
66+ printk ("Ublox GPS init error!\n " );
7067 return -1 ;
7168 }
7269 return 0 ;
7370}
7471
7572
7673void main (void ) {
77- LOG_INF ("Ublox Zephyr example" );
74+ printk ("Ublox Zephyr example\n " );
7875
7976 int err ;
8077 err = init_gpio ();
You can’t perform that action at this time.
0 commit comments