Verified Commit 98cbbbf8 authored by Rahix's avatar Rahix
Browse files

fix(pycardium): Make sure clang-format won't break upy macros



Closes #45

Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 6df7e446
......@@ -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
......
......@@ -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);
......@@ -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);
......@@ -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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment