zephyr/scripts/dts
Ulf Magnusson f3f88a8e58 scripts: dts: Format multi-line comments nicely
Multi-line comments were stuck as-is between /* and */ in the generated
header, which looks ugly and confusing e.g. for multi-line
binding/property descriptions.

Use this format for multi-line comments in the header instead:

    /*
     * First line
     * Second line
     *
     * Line after blank line
     */

Also clean up the output a bit by turning some things that were separate
comments into a single multi-line comment. Add some air and reduce line
lengths too.

Before:

    /*  Generated by gen_defines.py  */
    /*  DTS input file: hifive1.dts.pre.tmp  */
    /*  Directories with bindings: $ZEPHYR_BASE/dts/bindings  */

    /*  Devicetree node: /cpus/cpu@0/interrupt-controller  */
    /*  Binding (compatible = riscv,cpu-intc): $ZEPHYR_BASE/... */
    /*  Binding description: This binding describes the RISC-V ...

    Some extra lines
    for testing  */
    #define DT_INST_0_RISCV_CPU_INTC                    1

After:

    /*
     * Generated by gen_defines.py
     *
     * DTS input file:
     *   hifive1.dts.pre.tmp
     *
     * Directories with bindings:
     *   $ZEPHYR_BASE/dts/bindings
     */

    /*
     * Devicetree node:
     *   /cpus/cpu@0/interrupt-controller
     *
     * Binding (compatible = riscv,cpu-intc):
     *   $ZEPHYR_BASE/dts/bindings/interrupt-controller/...
     *
     * Description:
     *   This binding describes the RISC-V CPU Interrupt Controller
     *
     *   Some extra lines
     *   for testing
     */
    #define DT_INST_0_RISCV_CPU_INTC                    1

Also tweak Node.description and Property.description in edtlib to be
strip()ed instead of rstrip()ed. There's probably no reason to
preserving leading whitespace in them either.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-30 08:15:31 +01:00
..
extract scripts: dts: Generalize '#cells' to allow multiple sources 2019-10-02 11:49:58 -07:00
test-bindings scripts: dts: Generalize '#cells' to allow multiple sources 2019-10-02 11:49:58 -07:00
test-bindings-2 scripts: dts: Simplify and improve 'compatible' matching 2019-09-07 10:25:02 -05:00
devicetree.py scripts: dts: devicetree.py: Fix pylint warning for iffy \w escape 2019-09-07 10:25:02 -05:00
dtlib.py scripts: edtlib: Call nodes "nodes" instead of "devices" 2019-09-26 05:23:28 -07:00
edtlib.py scripts: dts: Format multi-line comments nicely 2019-10-30 08:15:31 +01:00
extract_dts_includes.py scripts: edtlib/extract_dts_includes.py: Speed up 2x+ with yaml.CLoader 2019-10-30 07:52:27 +01:00
gen_defines.py scripts: dts: Format multi-line comments nicely 2019-10-30 08:15:31 +01:00
test-multidir.dts scripts: dts: Add test for multiple binding directories 2019-08-03 14:17:49 -04:00
test.dts scripts: dts: Generalize '#cells' to allow multiple sources 2019-10-02 11:49:58 -07:00
testdtlib.py scripts: edtlib: Add a Device.children attribute with child Devices 2019-09-21 09:10:36 -05:00
testedtlib.py scripts: testedtlib.py: Simplify warning test a tiny bit 2019-10-03 05:57:26 -07:00