Commit Graph

77 Commits

Author SHA1 Message Date
Karl Palsson 81d1b2cfb6 gendoxylist: make it not "crash" if you try interactively at least 2020-11-28 22:13:25 +00:00
Caleb Szalacinski 174d3400dd Update checkpatch.pl with changes to the Linux Kernel Coding Style
The Linux kernel just deprecated the 80 character line limit.
This was always a mild issue of mine because of operations on lengthily-named registers that go just over the 80 character limit.
https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Deprecates-80-Col
2020-11-28 22:13:25 +00:00
Lars Kruse 5968b8a856 Update python references to python3
Python2 is end-of-life [1] since the 1st of January 2020.

Some distributions (most notably: Debian and its derivatives) will stop
providing a `python` executable in order to encourage users to specify
the interpreter language of local scripts explicitly.  Users of such
environments will be forced to work around this in one of these ways:

* create a virtual environment or
* manipulate the shebangs of the scripts or
* install the python2 package (as long as it is provided by distributions)

All currently maintained distribution releases provide python3.
In the near future distributions will need to remove python2, since it
is not maintained anymore.

PEP-394 [2] recommends to reference a specific python version
(python2 or python3), if the script is not expected to run in a virtual
environment.

Closes: #1265

[1] https://www.python.org/dev/peps/pep-0373/#update-april-2014
[2] https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers

Amended-by: Karl Palsson <karlp@tweak.net.au>
* moved lpc43xx scripts to explicitly call python2, they have not been
  ported, and are effectively unmaintained, but switching them to
  python3 unconditionally would be unhelpful.
2020-11-28 22:13:25 +00:00
Karl Palsson 8d80db0319 gendoxylist: sort headers
This makes the doxygen lists much more rationally ordered.
2019-06-25 21:15:19 +00:00
Karl Palsson b4b2a2101c doc: nvic: generate a discoverable link name
The nvic_ functions all had a broken link to an f1 list of irqs.  Change
the header generator to generate a fixed name, and link to them.
Because of their scoping, this ok, they find the correct family's irq
definitions.
2019-06-10 11:17:41 +00:00
Guillaume Revaillot bdc38eed16 doc: attempt to get rid of doxygenlayouts and doxyfiles.
Generate doc root doxygenlayout file, as well as devices stuff, based on main
Makefile $(TARGETS) and template files. Avoids painfull sync/merge of 20 files+
when adding a new device.
bonus : allow to build only one device doc easily (make TARGETS=stm32f0 doc)

regression: we currently loose device "fancy" naming as device name is
guessed (toUpper()..) from folder name.
2019-04-15 12:41:21 +00:00
Karl Palsson 0994762ae7 nvic: include the source json filename in the generated output
Make it a bit more obvious to people what they need to change.

Reported via: https://github.com/libopencm3/libopencm3/issues/974
2018-10-03 16:21:08 +00:00
Karl Palsson a21aeab3b1 doc: make sure include/cm3 is pulled in properly.
Much as we had to pull in the individual target's include files
manually, because they're useful without necessarily having .c files
using them, the cortex core headers also need to be included.  This also
pulls in the doc-cm3.h file that setup nice groupings.
2018-09-09 15:27:41 +00:00
keepkeyjon 8071c6cf01 irq2nvic: Use weak-alias declarations instead of #pragma weak
... since Clang doesn't infer the function type on '#pragma weak x = y'-style
declarations, and instead leaves it as "<overloaded function type>", thus
leading to a type conflict when assigning the ISRs to the interrupt vector.

This has no impact on normal use, but it makes it more compatible, nd
that's always a good thing.

Before (vector_nvic.c generated)
 ...
 #pragma weak usart1_isr = blocking_handler
 ...

After:
 ...
 void usart1_isr(void) __attribute__((weak, alias("blocking_handler")));
 ...
2018-07-29 20:31:17 +00:00
George Jiglau 396701808d genlink: Rewrite genlink script from awk to python
This removes the dependency on awk and should fix #732
python was already a dependency, for the irq generation
2018-04-14 18:40:54 +00:00
Karl Palsson d68604dedd doc: gendoxylist: fix syntax error for first file
Was hidden earlier by missing new line.
2018-02-13 23:05:21 +00:00
Karl Palsson efa49e6431 doc: gendoxylist: fix missing first file
Missing a \n in the descriptive print.
2018-02-13 23:05:21 +00:00
Karl Palsson 953bf531ea awk->gawk: Make the gawk dependency explicit
Until https://github.com/libopencm3/libopencm3/issues/732 has been
fixed, it's not enough to just have it in the README that you need GNU
awk.  Explicitly use the "gawk" command name.  This exists on (sane)
systems that have gawk as awk, and for systems that use mawk as default,
the gawk name should also exist.

This should make it significantly easier to diagnost the cause of build
problems.
2017-11-19 20:52:05 +00:00
Karl Palsson 313d82ba02 doxygen: include all target headers
Even if they haven't been referenced from a .c file.  Some peripherals
start their life as register definitions only, and they should still
have the documentation generated.

There _will_ be overlap in the generated lists, but doxygen doesn't seem
to mind this.
2017-10-23 21:05:54 +00:00
Karl Palsson d002d9552f doc: dynamically generate correct file lists
Instead of the fragile and error prone attempts to specifically
include/exclude files from doxygen by name and pattern, simply use the
already generated .d files to provide accurate and up to date lists of
all source files used.

Pros:
* Nothing left to worry about
* Much more encouraging to actually _work_ on the documentation now that
you can be sure the right docs will be generated instead of a confusing
mix.

Downsides/Upsides:
* Automatically includes all CM3/USB in each device's page _as well_ now

Downsides:
* lpc43xx still manually listed.  However, completely contained in it's
own dir, so no problems
* No attempt to carry this in latex.  easy, but more tempted to drop
latex support outright. (I don't think the generation there has even
worked for a while now)
* Due to the mismatch between lib directories and document roots, the
sourcelist can't be magically created per directory.  There has to be
some sort of mapping between the two, so as this is doc generation only,
a static list seems sane for maintennance.  (Especially compared to the
old method)
* Source list generation probably doesn't work on windows.
2017-10-18 20:05:14 +00:00
Mike Naberezny 860d10940b Remove unused Python imports 2017-06-23 14:42:59 +00:00
Jonas Meyer 6aeb55c5d7 mk rules: Improve behaviour when DEVICE is set to family. Improved Warning
The warning now uses family instead of subfamily, which is available
sooner.
2016-08-18 22:07:36 +00:00
Jonas Meyer 60ca09c61e genlink.awk: no need to make mode a regexp
Since I don't understand regular expressions and don't see how they are
useful in this case I made the mode selection a simple string match
2016-08-18 22:07:36 +00:00
Jonas Meyer c025dc0327 mk/genlink: change devices.data format to remove gcc specific options
As discussed with karlp on irc the devices.data file should not contain
gcc specific command line options.

For that reason the command line options for gcc are now generated from
the variables CPU and FPU by the rules in the mk directory.

This breaks the genlink tests.

genlink: simplified devices.data

devices.data already had the information about the family name.
By using the first field (by the pattern used to match it) as family name information that data doesn't
have to be provided explicitly. The same data is used to generate the
CPPFLAGS, such as -DSTM32F1

The architectures block of the devices.data file was redundant.

genlink-config.mk uses family and subfamily to figure out which libopencm3
variant actually exists.
2016-08-18 22:07:36 +00:00
Karl Palsson 2db3d290e7 stylecheck: fix deprecation warnings for newer perl
Simply escape the { chars as directed.
2016-08-16 21:23:03 +00:00
Torsten Raudssus 0cb1db0967 genlink: properly escape regexp special characters
Fixes compatibility with mawk, as used on debian and ubuntu now.
2016-07-08 22:24:48 +00:00
Anatol Pomozov ae41782e1a Fix misspellings using codespell tool 2016-03-08 08:52:54 -08:00
Karl Palsson bd2cfc8ac4 drop BMP helper scripts.
They should have been mmoved to the -examples repo when it was originally split
out.  (Clearly, they weren't being used)
2016-02-29 21:34:19 +00:00
Jim Paris 01f08c4638 Remove WEAK from handler prototypes
These prototypes affect functions defined by application code.  Only
the implementations in libopencm3 are supposed to be weak; the
functions in application code should definitely not be.  Otherwise,
you'll end up with two weak symbols being linked together, and
it's luck as to which one the linker picks.
2015-11-24 09:55:27 +00:00
Karl Palsson 00cbf86e77 scripts: clean generated cmsis headers too 2015-11-10 23:47:57 +00:00
Karl Palsson 9edde424f8 scripts: make genlinktest requires execute perms 2015-07-16 19:14:56 +00:00
Karl Palsson d3e228176f libopencmsis: Fill in missing CMSIS interrupt links
And correct a minor typo in the generated code.
2014-05-14 16:11:43 +00:00
Frantisek Burian b7785100c8 Add support of splitting parameter classes to ARCH, DEFS, LIB
in ARCH, there are all -m flags (will be expanded into ARCH_FLAGS in Makefile)
in DEFS, there are all -D flags (will be expanded into DEFS in Makefile)
in LIB, there are all -l flags (will be expanded into LIBNAME in Makefile)

If no MODE option specified, the generator behaves as in previous version.
2014-01-12 00:21:33 +01:00
BuFran d15a0e63fe [LINKER] Add single underscore to all definitions, no -D for dashed param.
This makes possibility for the script to append the definitions to CFLAGS
and LDFLAGS, and with the feature of disabling of -D prependation it will
make possible to generate ARCH_FLAGS generic to each specific chip.
2014-01-02 21:50:02 +01:00
BuFran 8d94bdc11c [GENLINK] Make tests in paralell
usage:

make genlinktests -j

speedup: 4 times on 8-core system
2014-01-02 21:50:02 +01:00
BuFran 08e08f5f84 [GENLINK] Edit the documentation to match current version 2014-01-02 21:50:02 +01:00
BuFran 30d4540d9e [GENLINK] Code Cleanup 2014-01-02 21:50:01 +01:00
BuFran 89236f0339 [GENLINK] Add Test suite + simple test 2014-01-02 21:50:01 +01:00
BuFran bfdc2cd991 [GENLINK] correct the whitespace bug 2014-01-02 21:50:01 +01:00
Karl Palsson 5c14780403 [build] Remove PyYAML dependency
This converts all the YAML files to JSON files, as json parsing is built
into python instead of being a separate library requiring installation.

YAML is a superset of JSON, but putting comments in is not quite as obvious
as it is in yaml.

The following glue was used to convert yaml to json:
python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < $1 > $2

Clearly I haven't tested this on every single platform, and this
doesn't address the large blobs of yaml in the lpc4300 scripts directory,
only the cortex NVIC generation process.

I've tested a few IRQ driven example apps, and I've checked the generated
output of some known cases like the LM3s that has explicit gaps, and they are
all generated correctly.
2014-01-02 20:55:15 +01:00
Ben Gamari 580be39e47 lpc43xx: Convert register definitions to YAML 2013-07-07 13:52:14 -07:00
Ben Gamari 4fd218ad4c lpc43xx/gen.py: Take YAML input 2013-07-07 13:52:14 -07:00
Ben Gamari 4d6a5d9606 lpc43xx: Move YAML OrderedDict code to separate module 2013-07-07 13:52:14 -07:00
Ben Gamari 21e4d4600f lpc43xx: Add script to convert CSV files to YAML 2013-07-07 13:52:14 -07:00
Ben Gamari 036cb51676 lpc43xx/gpdma.csv: Fix INTSTAT register name 2013-07-07 13:52:14 -07:00
Jared Boone e9eacc60ac Change header generation script to produce function-like #define macros for single-bit fields, too. 2013-07-07 13:52:10 -07:00
Jared Boone 5359dd245e Fixed typo in SGPIO_MUX_CFGx CLK_SOURCE_SLICE_MODE bit offset and width. 2013-07-07 13:52:10 -07:00
Michael Ossmann 2946de9f5d ritimer.csv 2013-07-07 13:52:10 -07:00
Michael Ossmann 922beb0730 gima.csv 2013-07-07 13:52:09 -07:00
Michael Ossmann e3ad0c6dc8 gpio.csv 2013-07-07 13:52:09 -07:00
Michael Ossmann 6a5deb7282 eventrouter.csv 2013-07-07 13:52:09 -07:00
Michael Ossmann 56361f7123 ccu.csv 2013-07-07 13:52:08 -07:00
Michael Ossmann 7b0cc0c6a3 atimer.csv 2013-07-07 13:52:08 -07:00
Michael Ossmann 299806bc4e csv contributions from GNU Radio Conference 2012 HackFest. Thanks, David! 2013-07-07 13:52:08 -07:00
Michael Ossmann df2ac8bbac scu.csv 2013-07-07 13:52:08 -07:00