Skip to content

Commit 75f596c

Browse files
committed
This should fix the problem with the I2C
1 parent ee95b02 commit 75f596c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

ext_mod/lcd_bus/esp32_src/i2c_bus.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,41 @@
55
#include "modlcd_bus.h"
66
#include "i2c_bus.h"
77

8+
// micropython includes
9+
#include "py/obj.h"
10+
#include "py/runtime.h"
11+
12+
// stdlib includes
13+
#include <string.h>
14+
15+
16+
static mp_obj_t mp_lcd_i2c_bus_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args)
17+
{
18+
LCD_UNUSED(type);
19+
LCD_UNUSED(n_args);
20+
LCD_UNUSED(n_kw);
21+
LCD_UNUSED(all_args);
22+
23+
mp_raise_msg(&mp_type_NotImplementedError, MP_ERROR_TEXT("I2C display bus is not supported"));
24+
return mp_const_none;
25+
}
26+
27+
28+
MP_DEFINE_CONST_OBJ_TYPE(
29+
mp_lcd_i2c_bus_type,
30+
MP_QSTR_I2CBus,
31+
MP_TYPE_FLAG_NONE,
32+
make_new, mp_lcd_i2c_bus_make_new,
33+
locals_dict, (mp_obj_dict_t *)&mp_lcd_bus_locals_dict
34+
);
35+
36+
37+
/*
38+
// local includes
39+
#include "lcd_types.h"
40+
#include "modlcd_bus.h"
41+
#include "i2c_bus.h"
42+
843
// esp-idf includes
944
#include "esp_lcd_panel_io.h"
1045
#include "driver/i2c.h"
@@ -170,3 +205,4 @@ MP_DEFINE_CONST_OBJ_TYPE(
170205
locals_dict, (mp_obj_dict_t *)&mp_lcd_bus_locals_dict
171206
);
172207
208+
*/

0 commit comments

Comments
 (0)