mirror of
https://github.com/micropython/micropython.git
synced 2026-05-01 05:10:15 +02:00
ca85a1eb23
This commit lets classes extending the base `PinGenerator` class to override the process of generating extra per-pin content when creating the pins' information source file. There are cases in which one may want to have more control on the part of the source generation process that dumps additional per-pin information to the source file. The current approach works fine if each pin generates self-contained additional data to be placed in the source file, but there is no clean way to provide a prologue or an epilogue to that content. For example, if one wants to emit a single consolidated additional pin data table it is not that convenient to be able to consistently emit the table start definition and the table end markers. With these changes all one has to do to achieve this is to override `PinGenerator.print_pin_source` in their PinGenerator-derived class to either wrap the output or to replace what is being output altogether. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>