From 7f6873284c3c1dcc0d255be539d4bad2f7d7480d Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Thu, 2 Jun 2022 09:56:15 +0200 Subject: [PATCH] bi_decl added (but not sure why) --- src/lcd.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lcd.cpp b/src/lcd.cpp index 6eed5ed..e7de943 100644 --- a/src/lcd.cpp +++ b/src/lcd.cpp @@ -1,3 +1,5 @@ +#include "pico/binary_info.h" + #include "lcd.h" // commands @@ -30,11 +32,13 @@ constexpr int LCD_ENABLE_BIT = 0x04; LCD::LCD(i2c_inst_t *i2c, const uint gpio_sda, const uint gpio_scl, const uint8_t i2c_addr, uint8_t num_cols, uint8_t num_lines) : i2c{i2c}, i2c_addr{i2c_addr}, num_cols{num_cols}, num_lines{num_lines} { - i2c_init(i2c1, 100 * 1000); + i2c_init(i2c, 100 * 1000); gpio_set_function(gpio_sda, GPIO_FUNC_I2C); gpio_set_function(gpio_scl, GPIO_FUNC_I2C); gpio_pull_up(gpio_sda); gpio_pull_up(gpio_scl); + // Make the I2C pins available to picotool + bi_decl(bi_2pins_with_func(gpio_sda, gpio_scl, GPIO_FUNC_I2C)); sendByte(0x03, Mode::COMMAND); sendByte(0x03, Mode::COMMAND);