Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit 9ccdb9f

Browse files
committed
changed prints
1 parent ccb20f2 commit 9ccdb9f

File tree

1 file changed

+5
-8
lines changed
  • examples/Example_Zephyr/src

1 file changed

+5
-8
lines changed

examples/Example_Zephyr/src/main.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
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

@@ -26,8 +25,6 @@
2625

2726
#define I2C_DEV "I2C_0"
2827

29-
LOG_MODULE_REGISTER(zephyr_main); // init logging
30-
3128
struct device *gpio_dev;
3229
struct 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

6663
uint8_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

7673
void main(void) {
77-
LOG_INF("Ublox Zephyr example");
74+
printk("Ublox Zephyr example\n");
7875

7976
int err;
8077
err = init_gpio();

0 commit comments

Comments
 (0)