UNIX port: is it possible to generate bindings for "evdev" driver?

Dear all,

unfortunately I have one last problem to solve before I can fully use Micropython + LVGL on the Raspberry Pi… Since the UNIX port I’m currently modifying doesn’t have drivers for input devices, I was trying to generate bindings for the “evdev” driver from lv_drivers. For this, I copied “evdev.c” and “evdev.h” to the same directory as the “gen_mpy.py” script and ran the command

sudo python3 gen_mpy.py -MD lv_evdev.json -M lv_evdev -MP lv_evdev -I …/pycparser/utils/fake_libc_include evdev.c

However, the process stops with the following error:

BlockquoteTraceback (most recent call last):
File “gen_mpy.py”, line 225, in
ast = parser.parse(s, filename=’’)
File “/home/pi/Code/lv_micropython/lib/lv_bindings/gen/…/pycparser/pycparser/c_parser.py”, line 152, in parse
File “/home/pi/Code/lv_micropython/lib/lv_bindings/gen/…/pycparser/pycparser/ply/yacc.py”, line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File “/home/pi/Code/lv_micropython/lib/lv_bindings/gen/…/pycparser/pycparser/ply/yacc.py”, line 1199, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
File “/home/pi/Code/lv_micropython/lib/lv_bindings/gen/…/pycparser/pycparser/ply/yacc.py”, line 193, in call_errorfunc
r = errorfunc(token)
File “/home/pi/Code/lv_micropython/lib/lv_bindings/gen/…/pycparser/pycparser/c_parser.py”, line 1847, in p_error
File “/home/pi/Code/lv_micropython/lib/lv_bindings/gen/…/pycparser/pycparser/plyparser.py”, line 67, in _parse_error
raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: /usr/include/arm-linux-gnueabihf/bits/types.h:47:1: before: extension

Does anyone of you have an idea what might have gone wrong?
Thanks for your help!

gen_mpy.py does not process C files, only H files. What are your trying to do?

Thanks, I hadn’t considered that, sorry :slight_smile: . My goal was to make the “evdev” driver available as a module in Microypthon. That means I probably have to write a new module based on the code in lv_drivers (evdev.c & .h).