For missing optional properties, it can be handy to generate a default
value instead of no value, to cut down on #ifdefs.
Allow a default value to be specified in the binding, via a new
'default: <default value>' setting for properties in bindings.
Defaults are supported for both scalar and array types. YAML arrays are
used to specify the value for array types.
'default:' also appears in json-schema, with the same meaning.
Include misc. sanity checks, like the 'default' value matching 'type'.
The documentation changes in binding-template.yaml explain the syntax.
Suggested by Peter A. Bigot in
https://github.com/zephyrproject-rtos/zephyr/issues/17829.
Fixes: #17829
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The bt_mesh_fixed_group_match() function is intended to match the
various well-known group addresses, however it was never updated when
Proxy support was added.
Fixes#19015
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
As element addresses are sequential, there's no need for iterating
through the elements to find the one matching a unicast address.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Fix this warning, as a preparation for a CI check:
arch/common/gen_isr_tables.py:167:11: C0123: Using type() instead of
isinstance() for a typecheck. (unidiomatic-typecheck)
isinstance() has the advantage that it also handles inheritance, though
it doesn't really matter here. It's more common at least.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
pylint does not like how this library works and generates spurious
warnings like
scripts/ci/get_modified_tests.py:55:13: E1121: Too many positional
arguments for function call (too-many-function-args)
scripts/ci/get_modified_tests.py:57:13: E1123: Unexpected keyword
argument '_tty_out' in function call (unexpected-keyword-arg)
These warnings are useful enough to want to have enabled in the upcoming
pylint CI check, so suppress them here.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Getting slightly subjective, but fixes this pylint warning:
arch/x86/gen_idt.py:281:11: R1714: Consider merging these
comparisons with "in" to 'handler not in (spur_code, spur_nocode)'
(consider-using-in)
Getting rid of pylint warnings for a CI check. I could disable any
controversial ones (it's already a list of warnings to enable anyway).
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fixes this pylint warning:
R0201: Method could be a function (no-self-use)
Another option would be to turn them into regular functions, but that'd
be a bigger change.
Fixing pylint warnings for a CI check.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fixes this pylint warning:
Comparison to True should be just 'expr' (singleton-comparison)
Getting rid of pylint warnings for a CI check.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Non-empty sequences are truthy in Python, so len() can be skipped in
tests.
Fixes this pylint warning:
scripts/gitlint/zephyr_commit_rules.py:115:11: C1801: Do not use
`len(SEQUENCE)` to determine if a sequence is empty
(len-as-condition)
Fixing warnings for a CI check.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This has been subsumed by the new implementation in drivers/pcie.
We remove the legacy subsystem, related tests, shell module, and
outdated documentation/config references.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
This was only used on Quark SoCs. It is no longer used, can no
longer be tested, and it's reliant upon the deprecated legacy PCI
subsystem. Remove it to prevent bitrot.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
This was only used on the Quark SoCs. It is no longer used, can no
longer be tested, and it's reliant upon the deprecated legacy PCI
subsystem. Remove it to prevent bitrot.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
Only Quark SoCs used this IP block hanging off a PCI bus, and the PCI
support is written for the deprecated legacy PCI subsystem, so remove.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
When using offloaded network, an L2 is never assigned to the net_if.
Only certain portions of the net_if code are referenced such as:
net_if_up()
net_if_down()
And these functions make use of several L2 references:
get_flags()
enable()
Let's add checks to make sure we don't deref a NULL when using these
functions.
Fixes the following exception on K64F and other HW which can make
use of offloaded network HW:
FATAL: ***** Reserved Exception ( -16) *****
FATAL: r0/a1: 0x00000010 r1/a2: 0x0000644f r2/a3: 0x00000000
FATAL: r3/a4: 0x00000000 r12/ip: 0x2000474c r14/lr: 0x0001475b
FATAL: xpsr: 0x00000000
FATAL: Faulting instruction address (r15/pc): 0x0001b1cd
FATAL: >>> ZEPHYR FATAL ERROR 0: CPU exception
FATAL: Current thread: 0x20004c4c (unknown)
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/18957
Signed-off-by: Michael Scott <mike@foundries.io>
ZLP flag should only be set if less data is sent
than requested by host and the length is a multiple
of wMaxPacketSize. Current implementation does not
check it correctly.
For some platforms like nRF52, this patch will not
be enough to fix the problem. The driver must be informed
about the transfer type before sending the last packet,
without changing the API, it is not possible.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Don't send zlp immediately after last packet for EP0.
Wait for write done event (in) before sending zlp.
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Set limited amount of tries to write to USB control endpoint EP0.
Fixes#16223
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Moved arduino_spi to spi2
Set sck-pin in arduino_spi correctly as pin 25
Moved disabled spi0 miso pin assignment to pin 28
Signed-off-by: Nick Ward <nick.ward@setec.com.au>
Adjust I2C timeouts after k_busy_wait precision has increased.
Report error on first I2C message failure.
Send STOP condition when error is detected.
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
This patch add tty runtime initialization check for console support
routines. Without it callers of routines API are not aware that
initialization of tty was failed. This patch basically checks
availability of console device and also its support for
interrupt driven transfers if routines are configured to use it.
Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
This patch adds HAS_SWO selections to all STM32 SoCs supporting Serial
Wire Output via the Trace Port Interface Unit (TPIU).
Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
Switch form using privater FCB error codes to
errno codes. FCB private codes convention were compatible
with <errno.h> codes:
- 0 mean success
- negative values mean errors
- similar error types.
There was no sense to kept private FCB error codes.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
As modem receiver is using UART, it requires disabling
of the UART and its callbacks to save power.
This adds simple sleep/wake functions which should be
called from defined device_pm functions in modem drivers later.
Signed-off-by: Christoph Schramm <schramm@makaio.com>
1) Dump time sinse last scheduler call
Could be handy for tickless kernel debug.
Will indicate that no rtc irq is called
2) Dump current timeout of each thread
Could be used to find yout when thread will wake up
3) Dump human friendly thread state
4) Use shell_prin instead shell_fprintf
Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
Added ll_rx_link_inc_quota to allow vendor to manipulate
mem_link_rx.quota_pdu when cleaning up nodes via ull_vendor.h.
Signed-off-by: Morten Priess <mtpr@oticon.com>
In setup messages addressing classes, USB standard defines that wIndex
constains interface number encoded in bits 0..7. Bits 8..15
are reserved and normally set to 0. However, in Audio Class they contain
entity number. Hence the need to filter 8 bits for getting interface
number.
Signed-off-by: Bartosz Sokolski <bartosz.sokolski@nordicsemi.no>
Corrected the amount of bytes copied for port handling in parse_ipv6
to prevent reading past the boundaries of the input string.
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
Add new RD Client API of lwm2m_rd_client_stop() for this
Fix issues of de-register and event reporting in RD Client
Signed-off-by: Jun Qing Zou <jun.qing.zou@nordicsemi.no>
Promote a handy and often-overlooked sys.exit() feature: Passing it a
string (or any other non-int object) prints it to stderr and exits with
status 1.
See the documentation at
https://docs.python.org/3/library/sys.html#sys.exit.
This indirectly prints some errors to stderr that previously went to
stdout.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
It turns out that 'check_compiler_flag' has not been working for flags
that start with -Wno-. This has caused old compilers to accidentally
use flags that they do not support.
To fix this we check for compatibility with the appropriate -W flag
instead and infer the -Wno- compatibility from this check.
The root cause of this problem is explained well here:
https://github.com/zephyrproject-rtos/zephyr/pull/18922#discussion_r321537098
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Instead of
properties:
compatible:
constraint: "foo"
, just have
compatible: "foo"
at the top level of the binding.
For backwards compatibility, the old 'properties: compatible: ...' form
is still accepted for now, and is treated the same as a single-element
'compatible:'.
The old syntax was inspired by dt-schema (though it isn't
dt-schema-compatible), which is in turn a thin wrapper around
json-schema (the idea is to transform .dts files into YAML and then
verify them).
Maybe the idea was to gradually switch the syntax over to dt-schema and
then be able to use unmodified dt-schema bindings, but dt-schema is
really a different kind of tool (a completely standalone linter), and
works very differently from our stuff (see schemas/dt-core.yaml in the
dt-schema repo to get an idea of just how differently).
Better to keep it simple.
This commit also piggybacks some clarifications to the binding template
re. '#cells:'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
A bare 'except:' can do some annoying stuff like eat Ctrl-C (because it
catches KeyboardInterrupt). Better to use 'except Exception:' as a
catch-all.
Even better might be to catch some more specific exception, because even
'except Exception:' eats stuff like misspelled identifiers.
Fixes this pylint warning:
W0702: No exception type(s) specified (bare-except)
Fixing pylint warnings for a CI check.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Doesn't use 'self'. Fixes this pylint warning:
scripts/dts/edtlib.py:272:4: R0201: Method could be a function
(no-self-use)
Fixing pylint warnings for a CI check.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Having backwards compatibility for !include and 'constraint:' is silly
without also having backwards compatibility for 'category:', because
that forces a binding change anyway.
Add backwards compatibility for 'category:', and just print a
deprecation warning when it's used.
Also move tests for deprecated features into a dedicated
test-bindings/deprecated.yaml binding, instead of piggybacking on other
tests.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Suppress this pylint warning so that it can be enabled in the upcoming
CI check. The code is safe.
scripts/dts/dtlib.py:1904:13: W0631: Using possibly undefined loop
variable 'i' (undefined-loop-variable)
Also add some more comments to clarify _init_tokens().
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>