Commit graph

87 commits

Author SHA1 Message Date
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Anas Nashif dc96f16bcd samples: define harness for samples
Most of the basic tests trigger LEDs or expect button press and would
hang in device testing because we can't parse success or failure from
the console. Define harness for this with the intent to skip those in
sanitycheck device testing and until we have a better way to test those.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-04 08:14:29 -05:00
Michael Scott d318da1db9 samples: basic: fix nRF52 PWM name in blink_led/fade_led samples
commit ddf744deee ("drivers: pwm_nrfx: Use Device Tree label as
instance name") removed the config setting for PWM names and replaced
it with DT_NORDIC_NRF_PWM_PWM_*_LABEL.

This change is causing the blink_led and fade_led samples to break
when compiled for nRF52 boards.

Let's update the samples to use the DT setting.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-27 12:22:42 -06:00
Nathaniel Graff 0ebb98ff1f samples/basic/fade_led: Add support for HiFive 1
Blinks the blue channel of the RGB LED

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-02-08 09:09:35 -06:00
Andrzej Głąbek df901f4d9c boards: nrf: Indicate pwm as supported on Nordic DK boards
Indicate that PWM is supported on several Nordic DK boards so that
the pwm_nrf5_sw and pwm_nrfx drivers are covered by CI builds.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-06 07:19:07 -05:00
Andrzej Głąbek e2b38e02bf drivers: pwm: nrf: Use HW PWM by default when available
Enable HW PWM driver instead of the SW one on nRF SoCs where the PWM
peripheral is present.
Default PWM instances are also enabled on Nordic DK boards so that it
is possible to build the basic fade_led sample for them without extra
adjustments.

After the above changes are applied, some configuration alterations
in basic samples blink_led and fade_led become no longer needed.
These are removed. And the blink_led sample is corrected so that it
works with the nRF HW PWM driver as well.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-06 07:19:07 -05:00
Ioannis Konstantelias 5151e8a094 boards: nucleo_l496zg: Add pwm mapping and RTC
Supported PWM at pins A0, D3, D5 and D6 which are also Arduino
compatible. Also the onboard red LED can be used with PWM.

The basic/{fade_led, blink_led} samples to apply to this board
seemlessly and operate on the onboard red LED.

Also supported RTC.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-01-23 09:18:35 -06:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Carles Cufi b51b7becf4 doc: samples: Update samples to point to active boards
Since the Arduino 101 and the Quark SE C1000 are not actively developed
boards, default to other boards that are maintained and used.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-12-12 23:06:16 +01:00
Gaute Gamnes 596a11c6bd drivers: pwm: nrf: Modify fade_led PWM example, use new HW drv
1. Modified fade_led PWM example to include
   nRF HW PWM option.
2. Added fade_led nrf52_pca10040.overlay
   in order to enable PWM node and choose
   output PWM GPIO for channel 0. Channel 1
   GPIO enable but not used in sample src.

Signed-off-by: Gaute Gamnes <gaute.gamnes@nordicsemi.no>
2018-12-11 15:18:14 +01:00
Patrik Flykt 079f55d519 samples: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Kumar Gala 937f45dc86 samples: baisc: Update to use DT generated pwm defines
We update 'blink_led', 'fade_led' and 'rgb_led' to support dt generated
defines for the PWM info needed for each.  Since hexiwear_k64 supports
generating the info, moved the support for hexiwear_k64 to just use the
dt generated defines.

For 'blink_led' and 'fade_led' we use an alias in dt called 'pwm-led0'.
For 'rgb_led' we use aliases 'red-pwm-led', 'green-pwm-led' and
'blue-pwm-led'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Kumar Gala ab439ca7fd samples: basic: limit board.h to where its needed
For blink_led, fade_led, and rgb_led, we only need board.h for the
hexiwear_k64 board.  Remove other references to board.h and only
include it if we are building on hexiwear_k64

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Reto Schneider 7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Anas Nashif ff9c20826c driver: pwm: use new logger
move PWM driver to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Carles Cufi f49150cab6 arch: arm: nrf: Rename nrf5 SoC Family to nrf
Upcoming Nordic ICs that share many of the peripherals and architecture
with the currently supported nRF5x ones are no longer part of the nRF5
family. In order to accomodate that, rename the SoC family from nrf5 to
nrf, so that it can contain all of the members of the wider Nordic
family.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 11:57:14 +01:00
Vitor Massaru Iha 6f9823e4a6 samples: basic: fade_led: Update sample to work with ESP32
Update fade_led sample to work with ESP32.

Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
2018-02-23 13:13:12 -05:00
Anas Nashif c9d6b289c7 samples: pwm: depend on boards supporting PWM
Still need a better way to filter and a better way to support multiple
platforms with these tests, but for now we remove the build_only tag and
make it depend on real HW.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Carles Cufi 08183f7e73 samples: basic: Convert doc to CMake
Convert doc for samples/basic to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Maureen Helm 3b5577d102 samples: fade_led: Add support for hexiwear_k64
The hexiwear_k64 board can drive the leds with a pwm, so update the
fade_led sample to work with this board.

Jira: ZEP-2025

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-08-09 18:13:29 -04:00
Anas Nashif 3c50f7aa12 tests: samples: remove duplicate filtering
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Erwan Gouriou 19a91c0272 soc: stm32l476rg: rename SOC config flag
Rename SOC_STM32L476XX to SOC_STM32L476XG to keep flash
size information.
Aim is to be able to distinguish flash size variants of
the SoC when needed (for instance in dts/arm/st/mem.h file)

Change-Id: I834bb5b83c24c39e90c0492a2b22a7c7802de361
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-05-15 13:22:54 -04:00
Kumar Gala e547533435 samples: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08c682bfc0b80dfa88de859e90a011bcd2db2762
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:53 -05:00
Vinayak Chettimada 9584456fc9 drivers: pwm: Add nRF5x GPIOTE based PWM driver
Add support for nRF5x series GPIOTE based PWM driver
implementation.

Provides upto 3 pins/channels using one HF timer, two PPI
channels per pin, and one GPIOTE config per pin.

Change-id: I6056b199ec2cff595ba8fea9f659a0338ed4635b
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-14 01:53:07 +00:00
David B. Kinder b78ffc0e6b doc: add labels to basic sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I57d65a8888f78aa61d776f607a5db86bdb35726c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:51:47 +00:00
Kuo-Lang Tseng 0eed7eefee samples: fade_led: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is more portable and safer because device
name can change and the app does not need to change.

Jira: ZEP-1764

Change-Id: I3287da5c5a9df24507efa84bbf7bbb051726bc2c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:25:05 +00:00
David B. Kinder 2cb045420c doc: fix .rst files canonical heading order
The headings on some .rst files were not following the expected
heading order of using # for h1, * for h2, = for h3, and - for h4
This patch fixes that, and the doc/templates/*.tmpl files created
for folks to use as templates for creating board and sample docs.

Change-Id: I0263b005648558d5ea41a681ceaa4798c9594dd9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-20 16:06:36 -08:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Punit Vara 959988662f samples: basic: Move pwm driver samples
This patch moves pwm driver samples to samples/basic and also convert
documentation of PWM samples to RST.

Jira: ZEP-1536
Change-Id: Ib2b3ff8b1722a26618e9a6fe416e2138d82ca28b
Signed-off-by: Punit Vara <punitvara@gmail.com>
2017-01-11 15:15:31 +00:00