Commit graph

41120 commits

Author SHA1 Message Date
Joakim Andersson
361cbea9cd Bluetooth: SMP: Fix pairing using debug keys
Fix issue when checking if SMP pairing procedure is allowed to use the
SMP debug keys. This check did not consider the case where the keys
pointer was assigned, but did not contain a valid LTK key.
This resulted in being unable to pair with debug keys without an
existing bond.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-09-07 15:49:34 +03:00
Joakim Andersson
8f75cf732d Bluetooth: Shell: Fix shell build dependencies
Fix shell build dependencies, subsys/bluetooth/controller is only added
for CONFIG_BT_LL_SW_SPLIT or CONFIG_BT_LL_SW_LEGACY.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-09-07 15:48:35 +03:00
Joakim Andersson
dcde30e5e4 Bluetooth: host: Handle return code of set_random_address
The return code of set_random_address is not always handled. This could
lead to connection using the wrong Identity address.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-09-07 15:48:17 +03:00
Ioannis Glaropoulos
1d45a2fe77 bluetooth: controller: minor fixes in inline comments
Several minor fixes to inline comments of #ifdef .. #endif
blocks.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-07 14:18:36 +02:00
Ioannis Glaropoulos
98356a14b7 bluetooth: controller: remove redundant header inclusions
nrf_timer.h and nrf_ppi.h are included by including
radio_nrf5.h, so we do not need to include them in
radio.c.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-07 14:18:36 +02:00
Ulf Magnusson
ea4d1d6ff0 sanitycheck: harness.py: Fix bad indentation
Getting rid of pylint warnings for a CI check. No functional change.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:14:29 -04:00
Ulf Magnusson
9c4400fb51 intel_s1000_crb: messenger.py: Fix 3-space indentation
Accidental 3-space instead of 4-space indent.

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:14:09 -04:00
Flavio Ceolin
e1e36f237d ext: tinycrypt: Update tinycrypt revision
Bump tinycrypt library revision.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-09-07 14:13:59 +02:00
Ulf Magnusson
16ca6a76da intel_s1000_crb: messenger.py: Simplify loops to fix pylint warnings
Simplify two loops in create_memread_cmd() by looping over elements
instead of indices, to fix two pylint warnings.

Fixing warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:13:41 -04:00
Ulf Magnusson
ca4200a2c7 doc: extract_content.py: Suppress spurious pylint warning
UnicodeDecodeError.object supports indexing, but pylint gets confused
for some reason.

    doc/scripts/extract_content.py:70:16: E1136: Value 'e.object' is
    unsubscriptable (unsubscriptable-object)

This warning is useful enough to want to have enabled in the upcoming
pylint CI check, so suppress it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:13:22 -04:00
Ulf Magnusson
2481a12529 samples: intel_s1000: Simplify code and fix pylint warning
Empty sequences in Python are falsy, so

    if len(config_file) != 0:

can be simplified to

    if config_file:

pylint warning:

    C1801: Do not use `len(SEQUENCE)` to determine if a sequence is
    empty (len-as-condition)

Simplify the code a bit with os.path.join(), which indirectly gets rid
of the warning. os.path.join('', 'foo') returns 'foo', so things work
out when os.path.basename() returns '' (no directory) as well.

I'm getting rid of pylint warnings for a CI check.

Also replace a '== None' with 'is None', which is more common.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:13:02 -04:00
Ulf Magnusson
d4c851ca57 scripts: gen_kobject_list.py: Remove redundant parentheses
No need to put () around 'if' conditions in Python.

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:12:44 -04:00
Ulf Magnusson
16041cda0c west: zcmake.py: Simplify test with 'in'
Getting slightly subjective, but fixes this pylint warning:

    scripts/west_commands/zcmake.py:186:13: R1714: Consider merging
    these comparisons with "in" to "type_ in ('STRING', 'INTERNAL')"
    (consider-using-in)

Use a set literal instead of a tuple literal, as recent Python 3
versions optimize set literals with constant keys nicely.

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>
2019-09-07 08:12:09 -04:00
Ulf Magnusson
f5d8ece3b7 west: nrfjprog.py: Remove len() from conditional to fix pylint warning
Empty sequences are falsy in Python, so len() can be skipped.

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:11:44 -04:00
Ulf Magnusson
5d307c98fe west: build.py: Remove len() from conditional to fix pylint warning
Non-empty sequences are truthy in Python, so len() can be skipped.

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:11:02 -04:00
Ulf Magnusson
751ee21e08 doc: application.py: Simplify test with 'in'
Getting slightly subjective, but fixes this pylint warning:

    doc/extensions/zephyr/application.py:274:15: R1714: Consider merging
    these comparisons with "in" to "goal in ('build', 'sign')"
    (consider-using-in)

Use a set literal instead of a tuple literal, as recent Python 3
versions optimize set literals with constant keys nicely.

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>
2019-09-07 08:10:30 -04:00
Ulf Magnusson
1f0a8e5a3f west: completion.py: Fix bad indentation and blank lines at end of file
Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:09:56 -04:00
Ulf Magnusson
22274696a9 west: boards: Remove accidental comma to fix pylint warning
Remove a trailing comma that generated a single-element tuple and made
pylint warn:

    scripts/west_commands/boards.py:50:8: W0106: Expression
    "(parser.add_argument(...), )" is assigned to nothing
    (expression-not-assigned)

No functional change.

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:08:48 -04:00
Ulf Magnusson
4c7926234b doc: conf.py: Remove unused subprocess imports
Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:08:22 -04:00
Ulf Magnusson
4d207895b4 intel_s1000_crb: scripts: Remove '== False/True' tests
Fix pylint warnings like these:

    Comparison to True should be just 'expr' (singleton-comparison)
    Comparison to False should be 'not expr' (singleton-comparison)

I checked that GPIO.read() only returns True/False in the
python-periphery docs.

Getting rid of pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:07:57 -04:00
Ulf Magnusson
3206e42935 scripts: gen_kobject_list.py: Simplify test with chained comparison
'a < b and b < c' can be simplified to 'a < b < c' in Python.

Fixes this pylint warning:

    scripts/gen_kobject_list.py:198:22: R1716: Simplify chained
    comparison between the operands (chained-comparison)

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:07:36 -04:00
Ulf Magnusson
d2d5fae838 west: runners: core.py: Remove no-op try-excepts
Removing these doesn't change behavior, since the
subprocess.CalledProcessError is just immediately re-raised when caught.

Fixes this pylint warning:

    W0706: The except handler raises immediately (try-except-raise)

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:06:51 -04:00
Ulf Magnusson
4094ee686e west: runners: Remove unnecessary constructors
These just pass their arguments through to the base class constructor.
Removing them means the base class constructor gets called directly
instead.

Fixes this pylint warning:

    W0235: Useless super delegation in method '__init__'
    (useless-super-delegation)

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:06:51 -04:00
Ulf Magnusson
bf128d09b3 west: runners: Fix typo'd log.wrn() call
Should be wrn() instead of warn(). Reported by pylint.

Also remove a {} from the message. It's not being formatted.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:05:57 -04:00
Ulf Magnusson
11d98ae9de scripts: gen_relocate_app.py: Simplify test with 'in'
Getting slightly subjective, but fixes this pylint warning:

    scripts/gen_relocate_app.py:228:38: R1714: Consider merging these
    comparisons with "in" to "region in ('data', 'bss')"
    (consider-using-in)

Use a set literal instead of a tuple literal, as recent Python 3
versions optimize set literals with constant keys nicely.

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>
2019-09-07 08:05:22 -04:00
Ulf Magnusson
bb634167ae west: commands: Make functions that don't use 'self' static
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.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:04:58 -04:00
Ulf Magnusson
e3ff959d30 intel_s1000_crb: messenger.py: Make endian_swap() static
Doesn't use 'self'. Fixes this pylint warning:

    boards/xtensa/intel_s1000_crb/support/messenger.py:50:4: R0201:
    Method could be a function (no-self-use)

If this function is meant to be internal to messenger.py, then a better
option than @staticmethod might be to turn it into a regular function.

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:04:15 -04:00
Ulf Magnusson
4cac371d43 scripts: Suppress/fix undefined variable pylint warnings
dtlib.py and guiconfig.py do some hackery to build token and image
variable names, which triggers spurious pylint warnings like

    scripts/dts/dtlib.py:243:28: E0602: Undefined variable '_T_LABEL'
    (undefined-variable)

Suppress the warning for those files. The generated names get used in
lots of places.

Also suppress some warnings in doc/conf.py ('tags' is from Sphinx), and
fix a legitimate issue in scripts/dts/testdtlib.py.

This pylint check is useful enough to want enabled in the upcoming CI
check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:03:04 -04:00
Ulf Magnusson
3feb8f96f6 scripts: gen_kobject_list.py: Simplify test with 'in'
Getting slightly subjective, but fixes this pylint warning:

    scripts/gen_kobject_list.py:308:11: R1714: Consider merging these
    comparisons with "in" to "kobj in ('device',
    '_k_thread_stack_element')" (consider-using-in)

Use a set literal instead of a tuple literal, as recent Python 3
versions optimize set literals with constant keys nicely.

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>
2019-09-07 08:01:31 -04:00
Ulf Magnusson
89efaeda74 west: build.py: Rename unused variable from unpacking to _
This is a common Python idiom, and it's easy to look up what the unused
value is in this case if you need to. Fixes this pylint warning:

    scripts/west_commands/build.py:227:15: W0612: Unused variable
    'origin' (unused-variable)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:00:57 -04:00
Ulf Magnusson
883b53101c menuconfig: Suppress spurious pylint tuple unpacking warning
pylint might be afraid that there'd be less than three elements in
'args', but there never is. Fixes this warning:

    scripts/kconfig/menuconfig.py:3184:8: W0632: Possible unbalanced
    tuple unpacking with sequence: left side has 3 label(s), right side
    has 0 value(s) (unbalanced-tuple-unpacking)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:00:30 -04:00
Ulf Magnusson
47ef9ba6c2 scripts: sanitycheck: Remove redundant ifs
Fixes these pylint warnings:

    scripts/sanity_chk/ini2yaml.py:25:22: R1719: The if expression can
    be replaced with 'test' (simplifiable-if-expression)

    scripts/sanity_chk/expr_parser.py:208:15: R1719: The if expression
    can be replaced with 'bool(test)' (simplifiable-if-expression)

    scripts/sanity_chk/expr_parser.py:210:15: R1719: The if expression
    can be replaced with 'bool(test)' (simplifiable-if-expression)

Also replace a redundant re.compile().match() with re.match(). compile()
doesn't help when re-compiling the regular expression each time through.

(compile() often doesn't help much in general, because the 're' module
caches compiled regexes.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 07:59:53 -04:00
Ulf Magnusson
16b548fcc7 gen_gcov_files.py: Replace bare 'except' with 'except Exception'
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:

    scripts/gen_gcov_files.py:54:12: W0702: No exception type(s)
    specified (bare-except)

Piggyback a formatting nit.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 07:58:16 -04:00
Ulf Magnusson
4699375162 west: run_common.py: Remove redundant 'if'
Fixes this pylint warning:

    scripts/west_commands/run_common.py:175:12: R1719: The if expression
    can be replaced with 'test' (simplifiable-if-expression)

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 07:57:46 -04:00
Ulf Magnusson
a07c3dc46f doc: conf.py: Replace bare 'except' with 'except Exception'
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:

    doc/conf.py:99:0: W0702: No exception type(s) specified
    (bare-except)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 07:56:58 -04:00
Ulf Magnusson
53ce10814d doc: application.py: Remove unused variables
Reported by pylint. Fixing warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 07:56:09 -04:00
Ulf Magnusson
a3793098cb xtensa: xtensa_intgen.py: Change 'not lvl in ...' to 'lvl not in ...'
Use the 'not in' operator. Fixes this pylint warning:

    arch/xtensa/core/xtensa_intgen.py:77:7: C0113: Consider changing
    "not lvl in ints_by_lvl" to "lvl not in ints_by_lvl" (unneeded-not)

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 07:55:01 -04:00
Ulf Magnusson
0d39a10fbb scripts: Fix random typo'd whitespace
Reported by pylint's 'bad-whitespace' warning.

Not gonna enable this warning in the CI check, because it flags stuff
like deliberately aligning assignments and gets too cultish. Just a
cleanup pass.

For whatever reason, the common convention in Python is to skip spaces
around '=' when passing keyword arguments and giving default arguments:

    f(x=3, y=4)
    def f(x, y=8):
        ...

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 07:54:17 -04:00
Ioannis Glaropoulos
46263acd5a release: Post-release patch level update
Set the patch level correctly, after the 2.0.0 release.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-07 12:29:56 +02:00
Ioannis Glaropoulos
7c0ec4358a release: Zephyr 2.0.0
Bump version to 2.0.0 final.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-07 00:40:33 +02:00
David B. Kinder
624ac4801b doc: remove licensing for moved ext/ components
ext/fs/fat and ext/hal/nordic were moved out of the ext folder and into
external modules so we should remove the licensing exceptions noted in
this document.

kconfig and kbuild were removed from the zephyr repo too.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-09-07 00:17:15 +02:00
Carles Cufi
c1d87a5be9 dts: bindings: spi: nrf: Set license to Apache 2.0
The file contained an invalid license which came from a Nordic custom
repository. Switch it to Apache 2.0.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-09-06 23:35:39 +02:00
Ioannis Glaropoulos
0ea5f84143 doc: release notes: style update; Zephyr Kernel to Zephyr RTOS
Zephyr is more than a kernel, so we update the title of
the release notes' section accordingly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-06 23:34:18 +02:00
David B. Kinder
02ee3754c6 west: update requirements.txt to avoid west 0.6.1
Update scripts/requirements.txt to use 0.6.2 or later (avoiding 0.6.1
that has an known issue)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-09-06 19:12:33 +02:00
Ioannis Glaropoulos
9f7d4bc475 release: adding 2.0.0 doc link
Add 2.0.0 release to the list and remove
the last release.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-06 19:11:59 +02:00
Ioannis Glaropoulos
07d750efb3 doc: release notes: add list of issues for 2.0.0
Adding the list of closed issues for v2.0.0 release.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-06 18:01:26 +02:00
David B. Kinder
168751a7b7 doc: fix broken doc links
The project's README.rst references the support board docs with an URL
that's not working these days (see
https://github.com/zephyrproject-rtos/infrastructure/issues/134) so fix
that URL reference.  While looking for other similar linking cases, I
found a hard URL references that should be using :ref: role, and a
release notes reference to a (now) broken link (fixing that in the
/latest/ version of the 1.10 release notes).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-09-06 16:14:39 +02:00
David B. Kinder
891e50e088 doc: fix misspellings in documentation
Fix some misspellings found in .rst files missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-09-06 16:13:15 +02:00
Anas Nashif
053ab4ac41 release: update sanitycheck release file
Update release file used by sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-06 13:31:04 +02:00
Marti Bolivar
4b3f89646d doc: getting_started: run west update after pulling zephyr
This is causing confusion.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-09-06 12:14:20 +02:00