Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wink
firmware
Commits
98cbbbf8
Verified
Commit
98cbbbf8
authored
Jul 19, 2019
by
Rahix
Browse files
fix(pycardium): Make sure clang-format won't break upy macros
Closes #45 Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
6df7e446
Changes
4
Hide whitespace changes
Inline
Side-by-side
Documentation/pycardium-guide.rst
View file @
98cbbbf8
...
...
@@ -82,8 +82,15 @@ looks like this:
};
/* This is a special macro that will make MicroPython aware of this module */
/* clang-format off */
MP_REGISTER_MODULE(MP_QSTR_example, example_module, MODULE_EXAMPLE_ENABLED);
.. note::
Please keep the ``/* clang-format off */``. It ensures that *clang-format*
won't touch the following line. This is necessary because MicroPython's
codegen scripts can'd deal with newlines in the ``MP_REGISTER_MODULE`` macro.
Build Integration
~~~~~~~~~~~~~~~~~
Next, you need to add your module to ``pycardium/meson.build``. There is a list
...
...
pycardium/modules/leds.c
View file @
98cbbbf8
...
...
@@ -44,4 +44,5 @@ const mp_obj_module_t leds_module = {
};
/* Register the module to make it available in Python */
/* clang-format off */
MP_REGISTER_MODULE
(
MP_QSTR_leds
,
leds_module
,
MODULE_LEDS_ENABLED
);
pycardium/modules/utime.c
View file @
98cbbbf8
...
...
@@ -25,4 +25,5 @@ const mp_obj_module_t mp_module_utime = {
};
/* Register the module to make it available in Python */
/* clang-format off */
MP_REGISTER_MODULE
(
MP_QSTR_utime
,
mp_module_utime
,
MODULE_UTIME_ENABLED
);
pycardium/modules/vibra.c
View file @
98cbbbf8
...
...
@@ -37,5 +37,6 @@ const mp_obj_module_t vibra_module = {
.
globals
=
(
mp_obj_dict_t
*
)
&
vibra_module_globals
,
};
// Register the module to make it available in Python
/* Register the module to make it available in Python */
/* clang-format off */
MP_REGISTER_MODULE
(
MP_QSTR_vibra
,
vibra_module
,
MODULE_VIBRA_ENABLED
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment