Commit Graph

20 Commits

Author SHA1 Message Date
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 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
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
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
Anatol Pomozov ae41782e1a Fix misspellings using codespell tool 2016-03-08 08:52:54 -08: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 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
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
Piotr Esden-Tempski 7df63fcae0 First coarse run to fix coding style in locm3.
Added --terse and --mailback options to the make stylecheck target. It
also does continue even if it enounters a possible error.

We decided on two exceptions from the linux kernel coding standard:
- Empty wait while loops may end with ; on the same line.
- All blocks after while, if, for have to be in brackets even if they
  only contain one statement. Otherwise it is easy to introduce an
  error.

Checkpatch needs to be adapted to reflect those changes.
2013-06-12 18:22:56 -07:00
chrysn a1f4c29872 Merge branch 'efm32'
this adds support for energy micro's efm32 tiny gecko, gecko, leopard gecko and
giant gecko series.

also, the experimental libopencmsis is included in this branch, as it is
required for full operation of the free energymicro standard library
2012-10-29 14:44:37 +01:00
chrysn f594af86c8 fixes for generated header cleanup
* make target phony
* don't complain about missing files
2012-10-23 01:59:41 +02:00
chrysn efce73f815 make `make clean` work again
the irq2nvic_h generates files in a way make doesn't understand, so it
now also provides an option to clean up again
2012-10-23 01:38:27 +02:00
chrysn 2ad04777bf only generate irq headers on demand
as header file generation is not directly controlled by make (which, by
the way, makes the generatedheaders target phony), the script has to
take care of not needlessly generating files itself lest to have make
rebuild everything everytime
2012-10-23 01:31:30 +02:00
chrysn a818dbe729 use generalized libopencm3 functions in cmsis 2012-10-19 00:18:49 +02:00
chrysn 75c9cfc287 BEGIN_DECLS wrap nivc.h declarations for c++ 2012-10-18 21:19:04 +02:00
chrysn 41c8c229cc nvic.h generation script: be on safe side with directories
now tries to mkdir its way to the output files

this wouldn't be a problem currently if it wasn't for the efm32 data
lingering in the wrong branch, but otoh it's just on the safe side in
case we meet architectures that don't need other specializations at all.
2012-10-18 21:12:00 +02:00
chrysn c69916ffb6 integrate irq2nvic_h script in buildprocess 2012-10-18 17:58:12 +02:00
chrysn ae832b4ee8 split irq.yaml output in nvic.h and vector_nvic.h
the weak pragmas need to be used in the very compilation unit where
their target is defined, requiring another dispatch
2012-10-18 17:33:20 +02:00
chrysn 5ceb377a37 switch all interrupt lists to yaml format 2012-10-18 16:52:48 +02:00