Commit graph

466 commits

Author SHA1 Message Date
Anas Nashif eff81c498b power: remove obsolete power samples
We have a new power management system and those samples have been
written for specific boards and using the application based power
management subsystem. We are getting new tests/samples that are generic
with the new subsystem, so remove those in favor of the new ones.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-18 06:50:04 -05:00
Kumar Gala 5431762769 sensor: fxos8700: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert fxos8700 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 13:29:46 -06:00
Kumar Gala a5e8921de9 sensors: hts221: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert hts221 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 11:06:38 -06:00
Sebastian Bøe c7af520915 cmake: samples: mesh: Remove redundant CMake code
This sample is linking the 'app' with 'subsys__bluetooth', which will
add zephyr/subsys/bluetooth to the include path of the app. But this
is unnecessary as the app already has this path on it's include path.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-01-17 17:26:01 +02:00
Kumar Gala be2b6f870d sensor: bme280: Converting to using device tree
Convert the BME280 driver to use device tree and new DT_<COMPAT>
defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 12:39:37 -06:00
Vikrant More b5017ec7dc samples: mesh: restriction to re-transmit publish messages
If Server receives re-transmitted message then it will not
transmit corresponding publish message for it.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Vikrant More a61f7c39aa samples: mesh: feature to save Lightness & Temp. Range on Flash
With this commit, it is now possible to save Lightness &
temperature Range values on SoC flash.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Vikrant More f4f6426582 samples: mesh: code improvements
Added app_gpio.c & no_transition_work_handler.c to reduce
burden on main.c. It will simplify & help to understand
overall architecture.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Vikrant More b9511f2117 samples: mesh: revised states binding & target value calculation
Simplified algorithm behind states binding & target values calculation.
This has improved code readability.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Vikrant More 41b1e3e238 samples: mesh: Remove redundant code
Removed redundant code.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Sathish Kuttan 108ca81a17 samples: intel_s1000_crb: add doc for dmic sample
Add short documentation on sample app for DMIC driver usage
on Intel S1000 CRB.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan 6292a2fc3b samples: intel_s1000_crb: set BOARD for dmic sample
Set BOARD variable in CMakeLists.txt for DMIC Sample App
Since this sample app is for intel_s1000_crb, setting BOARD
in CMakeLists.txt will eliminate the need to specify in
cmake command line every time during build.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan 4e6728eb3e samples: intel_s1000_crb: add DMIC sample app
Add a sample application to demonstrate usage of digital microphones
in an Intel S1000 CRB

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05: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
Anas Nashif 74a74bb6b8 power: rename api sys_soc -> sys_
sys_soc is just redundant, just call APIs with sys_*.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-28 16:16:28 -05:00
Anas Nashif 9151fbebf2 power: rename APIs and removing leading _
Remove leading underscore from PM APIs. _ was used for internal APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-28 16:16:28 -05:00
Jakub Rzeszutko e8a77808c0 samples: reel board: correct timeout condition
After this fix each LED will blink 5 times. Previously
LED_0 has been blining 6 times while others 5 times.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-20 18:58:01 +02:00
Erwan Gouriou b1008ccb02 drivers/serial: stm32: Modify Kconfig instance flags
STM32 uart Kconfig instance flags were not following
same naming scheme than other drivers (i2c, spi, ..)

Update driver to use UART_X instead of UART_STM32_PORT_X

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-14 09:59:37 -06:00
Vikrant More e498271652 samples: mesh: enable retransmission of GET & Publish messages
Now if Server receives re-transmitted messages from client then
it will not get completely ignored but respective GET & Publish
message will get release from Server side.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-13 16:52:24 +02:00
Vikrant More 59d4589e14 samples: mesh: follow Mesh study guide to avoid retransmitted message
As per Mesh Model Specification,
when a Server receives a Set message or a Set Unacknowledged message,
it shall set the state to the target field of the message,
unless the message has the same values for the SRC, DST, and TID
fields as the previous message received within the last 6 seconds.

This commit take care of this requirement.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-13 16:52:24 +02:00
Vikrant More 5ea8454e46 samples: mesh: nrf52: coding style improvement (Vendor Model)
This commit's implementation update Vendor Model dummy response
value in vnd_get() instead of vnd_set_unack().

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-12 16:47:53 +02:00
Vikrant More d2f89e16e2 samples: mesh: nrf52: removed bug introduced by PR:9521
Removed bug which get introduced by PR:9521. Because of it
not able to save App's variable on SoC flash.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-12 16:47:53 +02:00
Vikrant More c41a837004 samples: nrf52: mesh: removed unwanted lines of Code
Removed redundant lines of code which are inappropriate
as per latest implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-12 16:47:53 +02:00
Andrzej Puzdrowski 2267668e87 sample: host: mesh: onoff_level_lighting align code to reworked settings
The Code need to be align after introduction of stream codec to
setting serialization subsystem.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Vikrant More 067d527a34 samples: mesh: nrf52: improved code readability
Improved code readability by defining some macros.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More d4b85837fb samples: mesh: nrf52: state binding improvements
Corrected state binding. With this commit Light Lightness
actual state would not cross its upper & lower limit.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More e8d4290d83 samples: mesh: nrf52: removed bugs in Target values calculation
Target values should change as per min. & max. values of
bound states. This commit handles this.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More 6456d14a9d samples: mesh: nrf52: improved coding style
Improved coding style.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More 313ce9d54a samples: mesh: nrf52: rename some functions name
Function names should have a verb as the last component.
As per this standard, rename some fuunctions names.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More 7871128b19 samples: mesh: nrf52: removed bug in Gen. level Move GET & Publish
Due to recent changes some bugs had introduced in Gen. Level Move
GET & Publish functionalities. Now separatly introduced
gen_level_move_get() and gen_level_move_publisher() to resolved it.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02: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
Vikrant More 089d18b403 samples: mesh: nrf52: upgrade re-transmission parameters
Upgrade NODE's transmission parameters.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-01 15:14:43 +02:00
Vikrant More cb0b52837b samples: mesh: update Kconfig parameter for better performance
Upgrade & add few Kconfig parameters to improve Bluetooth Mesh
performance.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-01 15:14:43 +02:00
Vikrant More 0c29ca367d samples: mesh: nrf52: removed bug in Gen. onoff unack handler
In Gen. OnOff Unack handler, gen_onoff_publisher(model) was
misplaced previously & now it is set to proper location.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-28 13:39:03 +02:00
Vikrant More d0b74e2f7e samples: mesh: nrf52: improve in execution if trnasition time is Zero
If transition time is not equal to Zero then & then only values
related to transition get calculated.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-24 10:29:30 +02:00
Johan Hedberg a633ded383 samples: reel_board/mesh_badge: Fix long name truncation
If the first name is longer than HELLO_MAX sending would fail due to
there not being sufficient MIC space (or worse overrun the net_buf).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-24 00:54:32 +01:00
Johan Hedberg 2f030f94f4 samples: reel_board/mesh_badge: Fix string parsing from buffer
This code was still incorrectly causing corrupt strings to be
generated. Now it should be correct.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-24 00:54:32 +01:00
Vikrant More 66a2bf03ba samples: mesh: nrf52: implementation as Mesh Model specs 3.1.1.1
Now if Gen. OnOff state set by client as '1' with some
transition time then value of Lightness will not jump to default
or last value instantly instead it would gradually increase during
that transition period.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-23 22:29:29 +02:00
Vikrant More fc0a310e15 samples: mesh: nrf52: coding style improvements
Create independent function handlers for some Servers. This
would not initiate state binding if current state is equal to
Client requested state.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-23 22:29:29 +02:00
Grzegorz Kolodziejczyk d7b3fe4ab4 samples: reel_board/mesh_badge: Match onoff state with LED light
Inverse logic for onoff state while driving LED GPIO. For LED light on
GPIO pin is 0, 1 for LED light off.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-23 22:04:26 +02:00
Andrei Emeltchenko 4e21f0651a samples: mesh_badge: Update project config
Add CONFIG_BT.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-23 09:10:01 -05:00
Piotr Mienkowski 970aef2905 kernel: ensure System Power Managment enables Tickless Idle.
System Power Management is only supported in Tickless Idle mode.
This patch modifies Kconfig dependencies to ensure System Power
Management option selects Tickless Idle one.

Fixes: #11046

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2018-11-21 23:16:35 -05:00
Vikrant More 227c1b28b3 samples: mesh: nrf52: make all transition timer dependent
This commit will take back changes made by previous commit
i.e. fad8ff39c3.

This is beacause k_sleep() based delay is not behaving as
expected while testing & take more time than expected.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-21 22:23:18 +02:00
Mariusz Skamra 8f5ba0be88 Bluetooth: Add common Kconfig option to disable LE Data Length Update
This adds common option to disable support for LE Data Length Update
procedure in controller and host.
This will reduce flash usage by compiling out le_data_len_change
event handler that will never be called if controller has been
compiled with BT_CTLR_DATA_LENGTH option disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-11-21 12:26:27 -05:00
Mariusz Skamra be314d3af5 Bluetooth: Add common Kconfig option to disable PHY Update
This adds common option to disable support for PHY Update
procedure in controller and host.
This will reduce flash usage by compiling out le_phy_update_complete
event handler that will never be called if controller has been
compiled with BT_CTLR_PHY option disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-11-21 12:26:27 -05:00
Vikrant More fad8ff39c3 samples: mesh: nrf52: use timer in case of transition
With this commit, if message contains transition time then
and only then timer would get started.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-20 20:35:20 +02:00
Vikrant More 53902c680b samples: mesh: nrf52: changes to make immediatly send GET responses
With this commit now it is simple to understand flow of logic when
NODE receives any message & how it proceed things one by one.

Plus NODE will immediately send GET status to Client instead of
waiting for things which has less priority.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-20 20:35:20 +02:00
Grzegorz Kolodziejczyk 3abb8a8521 samples: reel_board/mesh_badge: Fix sensor statuses struct organization
Patch modifies structure organization to be specification compliant.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-20 18:00:51 +02:00
Johan Hedberg d0253d310d samples: reel_board/mesh_badge: Fix various coding style issues
Fix coding style issues, mainly related to whitespace usage.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-19 15:06:14 +02:00
Johan Hedberg b164c9723f samples: reel_board/mesh_badge: Fix out-of-bounds array access
The show_sensors_data() function tries to access val[2] when
outputting the Z-axis value, so the array must have at least three
elements. This also triggered Coverity CID 189741.

Fixes #11482

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-19 15:06:14 +02:00
Johan Hedberg 381a9dd1ee samples: reel_board/mesh_badge: Fix comparison with unsigned number
This comparison was always supposed to be > rather than >=. Fixing
this also fixes Coverity CID 189740.

Fixes #11483

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-19 15:06:14 +02:00
Vikrant More 8da14d79fd samples: mesh: nrf52: improvement in transition type reassignment
Simplifies message handler for Servers & transition type reassignment.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 22:43:41 +02:00
Vikrant More 931eeee070 samples: mesh: nrf52: merged timer in transtion structure
In this commit, struct k_timer timer_lightness & struct k_timer
timer_temp picked & merged into struct transition lightness_transition
& struct transition temp_transition resp.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 22:43:41 +02:00
Kumar Gala a0b660730f samples: Add explicit zephyr_include_directories to get <board.h>
There are a small handful of samples that still utilize <board.h>
include, to minimize the use of <board.h> to these specific cases and
allow us to remove adding the board dir to the top level include search
path, we explicitly in each sample add the specific board dir it needs.

For the microbit cases these could be replaced by DTS support in the
future when the pwm_nrf5_sw supports DTS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 09:14:07 -05:00
Vikrant More 21f7bad751 samples: mesh: nrf52: Removed bug in reassignment of transition type
This PR will solve bug in reassignment of transition type to
Server.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 14:38:45 +02:00
Vikrant More a7d1ce667c samples: mesh: nrf52: optimisation in timer uses
Now states which are bound have single timer that means
means for lightness variation there is one timer & for
temperature variation there is one timer.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More 3ca4f7e215 samples: mesh: nrf52: corrected mapping of Message handler
Corrected mapping of message handler for Generic
Move Set, Generic Move Set Unack, Light CTL Set &
Light CTL Set Unack.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More ac1045acd2 samples: mesh: nrf52: coding style improvements.
Removed extra blank line. Add new
bound_states_transition_type_reassignment() function in
transition.c to improve code readability & understanding.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More bbef36e071 samples: mesh: nrf52: edition to improve Mesh performance
This edition would improve by default mesh network
performance. This is after testing with nRFMesh app
from Nordic Semiconductor.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Kumar Gala ff74f24bef samples: boards: Rename microbit dir to bbc_microbit
Have the sample directory match what we call the board name directory.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-14 12:41:12 -05:00
Kumar Gala f210d11970 boards: Remove including soc.h in board.h
We should let drivers or board code include soc.h directly so we can keep
board.h to local info for board specific code.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-14 06:44:02 -06: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
Andrzej Głąbek f39ba7230d dts_fixups: Update labels generated from DTS with DT_ prefix
All labels containing "_<8-hex-digits>_" or "16550_<3or6-hex-digits>_"
in their names, assumed to be generated by the extracting script,
are updated with the DT_ prefix, to reflect the recent changes made
to the script.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Grzegorz Kolodziejczyk 2cce0a6f9f samples: reel_board/mesh_badge: Introduce sensor model
Patch introduces sensor model to mesh badge application. Along with
model definition a sensor get message is implemented and handled on
server.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-13 12:33:14 +02:00
Grzegorz Kolodziejczyk 5148e68da5 samples: reel_board/mesh_badge: Add generic on off model
Add generic on/off model which drives green led on board.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-13 12:33:14 +02:00
Grzegorz Kolodziejczyk 92117dc27c samples: reel_board/mesh_badge: Add sensors
This patch introduces new screen to mesh_badge application. Sensor
screen shows measurements from board sensors updated every 2 seconds.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-13 12:33:14 +02:00
Andrzej Głąbek 386846fbff samples: reel_board: Change a DTS-derived label to the alias one
Change the label GPIO_KEYS_BUTTON_0_GPIO_CONTROLLER that is generated
for the DT node directly to the corresponding one generated through
the "sw0" alias (i.e. SW0_GPIO_CONTROLLER) to make it consistent with
other DT related labels used in this code (SW0_* and LED?_*).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-10 08:59:50 -05:00
Johan Hedberg 39155d55b6 samples: boards/mesh_badge: Fix checking for null in hello message
Use strncpy instead of memcpy to make sure copying stops at the first
null-character.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-06 22:31:24 +02:00
Johan Hedberg a19ca5cce6 samples: reel_board/mesh_badge: Fix null-termination of string buffer
The way the code is structured the buffer is always guaranteed to be
large enough, however perform explicit termination anyway to avoid
Coverity warnings.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-06 22:31:24 +02:00
Daniel Leung a87a6d82ac soc: apollo_lake: fix build errors for GPIO due to DTS changes
The DTS changes introduced in 7ae220c845
changes the naming of GPIO related macros. This updates the usage
of previous macros via DTS fixup.

Fixes #10993

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-11-02 21:58:02 -04:00
Daniel Leung 69ede2f1ce boards: up_squared: add GPIO sample to sanitycheck
This changes the sample.yaml so that it can be included when running
sanitycheck.

Fixes #10994

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-11-02 21:58:02 -04:00
Kumar Gala a8f1431a53 boards: bbc_microbit: Move button data into dts from board.h
Move the GPIO info for the buttons into the dts, this lets us match what
all other boards are doing.  Update some sample & test code to use the
dts generated SW0_GPIO_CONTROLLER define instead of SW0_GPIO_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 15:58:51 -05:00
Kumar Gala 366cc150ee samples: nrf52: power_mgr: Remove board.h
We don't need board.h, but do need soc.h for the sample to build.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Kumar Gala 856decf2f7 samples: Remove board.h include
Remove including board.h from samples that don't need it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Kumar Gala c78379bc26 samples: 96b_argonkey: Remove board.h
We don't need board.h, but by including it we would end up picking up
stdio.h from somewhere which we need for sprintf.  So just included
stdio.h and drop board.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Vikrant More 358329c7e9 samples: mesh: nrf52: unsolicitedly publishing the states
With this commit, some prime Servers would unsolicitedly
publishes thier states values.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-29 10:51:17 +02:00
Vikrant More 0f86ba3dfd samples: mesh: nrf52: defined common publisher for Gen. Level
Defined common publisher i.e. gen_level_publisher() for
all three gen. level related messahe handlers.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-29 10:51:17 +02:00
Vikrant More c38f178257 samples: mesh: nrf52: enum redefined
Redefined & relocate enums to improve code readability.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-29 10:51:17 +02:00
Anas Nashif d2c8d52336 grove: lcd: move grove lcd driver to drivers/display
Move to display drivers where it belongs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-28 11:46:36 -04: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
Johan Hedberg b0ad17d0a4 samples: reel_board/mesh_badge: Add statistics and new message
Add a new "heartbeat" message so that number of hops between nodes can
be discovered. Also add a statistics page which can be toggled using a
long key press, showing local information and the top message senders.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-27 11:16:30 +01:00
Vikrant More 5a341f5590 samples: mesh: nrf52: upgrade bound states publish mechanism
If user aggresively vary the state then previous mechanism
failed to publish status of other bounded states since it
has to publish multiple things back to back.
This PR repair the things.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 15:26:35 +01:00
Vikrant More 87f5fc63fc samples: mesh: nrf52: follow the standard while naming variables
Change variable names to follow standard.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More ee6e55ed33 samples: mesh: nrf52: removed unnecessary Models
Generic OnOff Server & Client has removed from Second
element which is redundant.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More acbaaed31a samples: mesh: nrf52: improvement in status responses details
If transition is in process, then as per current implementation bound
states only respond with Present value. But with this commit, now
bound states too would respond with present, target & remaining time
values in status response.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More ceab98f825 samples: mesh: nrf52: Vendor Model opcodes redefine
Redefine opcode values for Vendor Model to mimic like
Generic OnOff Server opcode values for sake of convenience.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More 06862268aa samples: mesh: nrf52: coding style improvements
Removed unwanted lines of codes. In transition.c
define Timers just before they get utilised.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More 0a11c958fe samples: mesh: nrf52: improvements in gen. delta message handler
Now in case of Generic Delta handler, if message with same TID
received after 6 seconds with same source address would consider
as new transaction instead of ignoring it.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More 7e40faa37f samples: mesh: nrf52: storing of some Prime states on SoC flash
With this commit it is now possible to save some Mesh Model
Servers State on SoC flash. This impacts initialization &
state binding after NODE reset & that is why some additional
modification has done as per requirements & removed some
code & comments which are redundant as per current
implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More c0f893480a samples: mesh: nrf52: short time multireset bt-mesh unprovisioning
In general, Bluetooth Mesh provisioning process could be failed
because of any reason. Using some h/w interrupt we can call
bt_mesh_reset() or something which will push device into factory
reset mode.

But with some actual products it is not always possible or feasible
to add extra h/w to achieve this goal.

This commit adds facility to push device into factory reset mode
using power reset. As per current implementation user have to
do 5 times reset so that gap between two consecutive reset
should not exceed 7 seconds.

Co-authored-by: Laczen JMS <laczenjms@gmail.com>

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More 0030aa9e0a samples: mesh: nrf52: support for extra status responses
With this commit, IUT will send additional status responses
whenever required as per PTS requirements.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More 9d5697f50a samples: mesh: nrf52: added separate Server's Publisher functions
Separately defined functions for Servers. This would help
to send extra status responses whenever required.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Johan Hedberg 7fd7be0fc6 samples: reel_board: Add Bluetooth Mesh badge demo app
Add a demo app for showcasing badge functionality together with
Bluetooth Mesh.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-24 22:06:46 +01:00
Johan Hedberg 18270d0bdf samples: boards: mesh/onoff-app: Remove SYS_LOG usage
SYS_LOG is being deprecated. Use printk instead.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Anas Nashif deaab90641 tests/samples: cleanup tags
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.

Avoid short abbriviations and using full names for fs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Anas Nashif 733a054ab0 samples: fix sample tags
Use correct tags instead of obvious 'sample' tag.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Anas Nashif 6f20aa1aaa samples: olimex_stm32_e407: move to new logger
Move to new logger and use new logger macros/Kconfig variables.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 18:32:13 -04:00
Sebastian Bøe 8eb734cd82 DT: Rename from dts.fixup to dts_fixup.h
The Zephyr configuration system uses many different files in many
different formats. It makes it a lot easier for users to understand
what these files do if when we use the correct file extensions.

To this end we rename the dts.fixup files to the correct file
extension '.h'.

This is a breaking change for out-of-tree fixup files. Such files will
be detected and given an appropriate error message.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-08 11:38:56 -04:00
Maureen Helm eeb4411de7 drivers: boards: Merge HAS_DTS_GPIO_DEVICE with HAS_DTS_GPIO
Every board that uses dts-enabled gpio drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_GPIO_DEVICE and
HAS_DTS_GPIO.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm 75bc6ba454 drivers: boards: Merge HAS_DTS_I2C_DEVICE with HAS_DTS_I2C
Every board that uses dts-enabled i2c drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_I2C_DEVICE and
HAS_DTS_I2C.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm 9dea0315f7 samples: arduino_101: Add dts overlay and fixup to env sensing sample
Adds a board-specific dts overlay and fixup file to the arduino_101
environmental sensing sample, in preparation for making the sensor
drivers require dts.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Sebastian Bøe c0287695fb kconfig: Remove remnants of unimplemented BUILD_TIMESTAMP feature
The Kconfig option CONFIG_BUILD_TIMESTAMP became unused when
BUILD_VERSION was introduced, but it's option and parts of it's
implementation was not completely cleaned from the repository.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-26 22:18:29 +05:30
Daniel Leung 79e8f79498 boards/x86: up_squared: add sample app for GPIO
This adds a sample app to utilize GPIOs on the UP Squared
board.

Origin: Original

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-19 21:36:16 -04:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Vikrant More ccade20ccf samples: mesh: nrf52: corrected Range status response
As per PTS, IUT is expected to return success for the
Range Get messages (Light Lightness Range Get for
MMDL/SR/LLNS/BI-01-C, Light CTL Temperature Range Get
for MMDL/SR/LCTLS/BI-01-C). This commit take care of
this issue.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More 09e2cf3db0 samples: mesh: nrf52: corrected state Binding for Delta Level
Now if transition (instantaneous or non-instantaneous) is due
to delta level, then state binding would be as per it.

This is as per 3.3.2.2.3 of Bluetooth Mesh Model
Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More be27afb705 samples: mesh: nrf52: corrected spelling
Corrected spelling mistakes for content of enum defined in
transition.h & renamed some functions. Corrected comments
in main.c

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More 864ebaaba6 samples: mesh: nrf52: revised status resp. behaviour & TT calculation
With this it is possible to get proper target value & remaining
time in status response from Servers when transition in progress.
If transition is not in progress then those things would not
get integrate into status response. This is as per Bluetooth
Mesh Model specification.

It is inspired concept from Bluetooth Mesh Developer study
Guide.

Also updated Transition Time (TT) related parameter calculation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More 6858cb417d samples: mesh: nrf52: corrected conditional compilation
Corrected conditional compilation directives defined in
publisher.c

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More c805beeaaa samples: mesh: nrf52: initialized dev_uuid to some arbitrary value
Initialized dev_uuid defined in ble_mesh.c to some arbitrary value.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More 89f00e6426 samples: mesh: nrf52: upgrade README.rst
Added Generic Default Transition Time Server & Client
Models names in list of Models supported by this App.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Emanuele Di Santo ea4f8b7d6c samples: nrf52: power_mgr: use dts-generated defines
This commit updates the power_mgr sample to use the dts-generated
defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Emanuele Di Santo 0a15793830 samples: nrf52: onoff-app: use dts-generated defines
This commit updates the onoff-app sample to use the dts-generated
defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Emanuele Di Santo 7fb051bc72 samples: nrf52: onoff_level_lightning_vnd_app: use dts-generated defines
This commit updates the onoff_level_lightning_vnd_app sample
to use the dts-generated defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Mieszko Mierunski 15813d343c boards: nrf: Changed GPIO default driver to NRFX shim
I removed GPIO configuration from board files and enabled them
as default in driver Kconfig file. All boards had GPIO ports
enabled that is why I decided to enable it by default.

Power management example was changed to use new driver.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-08-17 07:29:14 -07:00
Johan Hedberg f5026a11c9 samples/mesh: Fix dev_uuid initialization from identity address
With the recent changes to identity address handling the local
identity address is only guaranteed to be available once
settings_load() has been called. Move the initialization of dev_uuid
to the appropriate place.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-16 22:39:36 +03:00
Vikrant More 0aafcd6453 samples: mesh: nrf52 : to solve remaining PTS issues
Fixed coding style issues. Corrected conditional compilation
using pre-processor directives at proper location.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-08-15 21:28:49 +03: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
Vikrant More 993c349a8a samples: mesh: nrf52: Transition Time support, Coding Style
Added transition time support. Now if NODE received optional
parameters then they would get entertained by it.

Added two new models that is Generic Default Transition Time
Server & Client resp. to complete overall architecture to
support newly introduced architecture.

With this it was possible to implement
gen_move_set/gen_move_set_unack message handlers.

Removed redundancy from App & revised overall implementation.
Fixed Bugs. Upgraded coding style. Added & replaced comments to
improve code readability. Improved printk messages.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-08-15 09:09:29 +03:00
Vikrant More 6efb173edb samples: mesh: nrf52: Time filtering, Coding style & others
Added time stamp based message filtering as per Bluetooth Mesh
Developer study guide for each Server. Now even if message
source address & TID is same even after 6 seconds then
that will get proceed otherwise will get ignored.

Coding style improvements.

If particular Server model receive Prohibited values as per
Mesh Model Specification then that message will not get entertained.

Now proper status code will get send if user upgrade
light_lightness_range_state & light_ctl_temperature_range_state.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-08-15 09:09:29 +03:00
Vikrant More 26322d651b samples: mesh: nrf52: upgrade state binding
Upgraded state binding algorithm & created separated
file for it. Moved light_default_status_init() from
device_composition.c to main.c. Shorten variables names
defined in struct light_lightness_state.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-08-15 09:09:29 +03:00
Subramanian Meenakshi Sundaram df20ebd64a samples: boards: Fix incorrect min max range validation
Fixing the min max range validation where condtions on
upper and lower bound are logically 'ANDed'. Fixing it
by logical ORing the result.

CID: 18325, 18326
Fixes Issue #9289
Fixes Issue #9290

Signed-off-by: Subramanian Meenakshi Sundaram <subbu147@gmail.com>
2018-08-13 19:35:13 -07:00
Johan Hedberg 5708f1e8b1 Bluetooth: Add infrastructure to handle multiple identities
Make it possible to have multiple identity addresses as an LE
peripheral. For central role only the default identity is supported
for now. This also extends the flash storage in a backward compatible
way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-13 19:53:22 +03:00
Sebastian Bøe b9e8cd1133 cmake: Refactor usage of target_link_libraries on Zephyr libraries
CMake has several prototypes/signatures for the function
'target_link_libraries'. This commit migrates the usage of
'target_link_libraries' on Zephyr CMake libraries from the old 'plain'
signature to the new '<PRIVATE|PUBLIC|INTERFACE>' signature.

For technical reasons the two signatures can not be mixed. Each
library must exclusively use either the old or new signature.

The 'old' plain signature is equivalent to using the PUBLIC
signature. Migrating to use 'PUBLIC' is therefore expected to be a
safe change.

After the migration it will be possible to use the PRIVATE and
INTERFACE signatures on Zephyr CMake libraries. This is useful for
instance to fix issue 8438.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-09 14:03:10 +02:00
Armando Visconti aa609faab3 samples: board: 96b_argonkey: remove led blinking
The LED part is taking too much time. Let's skip the
led blinking part.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-07-30 09:20:00 -05:00
Johan Hedberg 8c1c1641fe Bluetooth: Mesh: Improve outgoing segment count configuration
The Mesh specification doesn't support more than 32 transport layer
segments, the way the number was so far derived from the advertising
buffer count could result in a highre numbe than 32, thereby wasting
memory. Make the number of supported segments build-time configurable
through a new BT_MESH_TX_SEG_MAX configuration option.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-25 18:16:45 +03:00
Ramakrishna Pallala 9a68fea98c samples: boards: quark_se_c1000: Do not enter LPS states on test exit
Do not enter Low Power states once the test execution is done. This
is needed to avoid the flashing issues which were seen when system
is in deep sleep states.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-07-25 07:21:17 -04:00
Luiz Augusto von Dentz 2e2f122d51 Bluetooth: samples: Make use of BT_LE_ADV_OPT_USE_NAME
Use BT_LE_ADV_OPT_USE_NAME whenver possible since it does properly
track updates.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-23 14:45:58 +03:00
Anas Nashif 4208642a53 samples: fix u32_t type usage
We have been mixing u32_t and uint32_t. Using u32_t when the API expects
something else.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-18 12:32:23 -04:00
Ramakrishna Pallala afad09dba6 samples: boards: nrf52: Refactor power_mgr app code
Removed redundant and unused config options from conf files.

Added separate files for handing power management and device
handling functions.

Added the PM policy based on the next timeout event instead of
simply advancing to the next power state.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-07-15 22:48:34 -04:00
Vikrant More b8b94280b9 samples: mesh: boards: nrf52: avoid responding to wrong messages
If temperature value are out of range which is from 0x0320
to 0x4E20 then no relevant get message handler will execute.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More 460c585406 samples: mesh: boards: nrf52: edit struct for gen. level
Edit data types defined in struct for gen. level.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More 00cd491ffe samples: mesh: boards: nrf52: modifications as per 3.3.2.2.3
Added extra case under state binding's switch statement for
Lightness i.e DELTA_LEVEL. Also upgrade binding between

1. root element's LEVEL state & Light Lightness Actual state.
2. Light Lightness Linear state & Light Lightness Actual state.
3. Light CTL lightness state & Light Lightness Actual state

This is as per Bluetooth Mesh Model Specification 3.3.2.2.3.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More 2708ce561d samples: mesh: boards: nrf52: randomize publishers TID on boot
Now on reboot, NODE as client do not start message publishing
with TID = 1. Instead of that it would start with any random value
from 0 to 255.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More 06f69b5c64 samples: mesh: improved code readability & remove redudancy
Improved code readability by declaring some pre-processor
definitions in device_composition.c

Remove model_instance variable from some structures define in
device_composition.h & its relevant code.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More c58f102c90 samples: mesh: boards: nrf52: improved vendor model
Update Vendor model message handlers & make it to work as per
TID like other Models defined by SIG. Removed union based data
extraction mechanism.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More 170ca38b75 samples: mesh: boards: nrf52: upgrade to pass PTS test
Updated state Binding as per PTS test requirements. Now if
gen_onoff_server & gen_onpowerup_server received Prohibited values
then they will not react on it further. Plus make necessary changes
wherever required for message handlers as per Mesh Model
Specification which is mostly regarding to default & range values.
Now right Status code would get publish in response to set lightness
& temperature range. Also upgrade Message handler
gen_delta_set_unack() algorithm as per PTS requirements.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More c789662f77 samples: mesh/onoff_level_lighting_vnd_app: improved state binding
Removed redundancy from state binding & make it simplified.
Avoid partial state binding in case of state_binding() function
get called with invalid or IGNORE arguments.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-04 17:57:19 +03:00
Vikrant More 31cf5672dc samples: mesh/onoff_level_lighting_vnd_app: corrected printk message
Corrected printk messgae for GET handler for Generic Power OnOff
server.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-04 17:57:19 +03:00
Vikrant More 182be3b49a samples: mesh/onoff_level_lighting_vnd_app: fix buffers length
Changes buffer length for all GET handlers as per patter of
 < 2 + parameters length (in bytes) + 4 >

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-04 17:57:19 +03:00
Vikrant More 0febf03dc8 samples: mesh/onoff_level_lighting_vnd_app: Vendor Model upgrade
This patched improved architecture of already implemented Vendor
Model. Now there are 4 separate opcodes for Vendor viz;
get, set, set_unack & status. This helps to setup
<command + response> mechanism.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-04 17:57:19 +03:00
Armando Visconti 2ad2d07ce8 samples: board: 96b_argonkey: Add testing of 12 on-board leds
Enable the TI LP3943 led controller and test the 12 on-board leds.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-07-03 12:20:51 -05:00
Vikrant More e8ddd6def8 samples: mesh/onoff_level_lighting_vnd_app: edited message handlers
Removed TID implementations wherever it is not required as per
Bluetooth SIG Mesh Model Specification. Removed unnecessary
comments. Add status code value to get publish along with
Light Lightness range status message.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More 34d475ff4e samples: mesh/onoff_level_lighting_vnd_app: fix bug in state binding
Fixed bug in binding of Light Lightness Actual state & Generic Level
state of Root Element.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More 54df5b519a samples: mesh/onoff_level_lighting_vnd_app: update handlers mapping
Update message handlers & correct nubmber of bytes that every
handlers should fetch for their further processing as per
Bluetooth SIG Mesh Model Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More b3e7a8f67b samples: mesh/onoff_level_lighting_vnd_app: update publication context
Update models publication parameter lengths as per Mesh Model
Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More 11cb462df5 samples: mesh/onoff_level_lighting_vnd_app: States binding corrections
Make corrections in state binding of Servers as per Mesh Model
Specifications. Previously, when OnPowerUp state equal to 0x02,
then Light Lightness actual state was not assign to last power
down value. Plus when Generic OnOff state changes by client,
then Light Lightness Actual state value get assigned as Light
Lightness Last value instead of default one.
All these issues has fixed here.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-06-25 22:52:16 +03:00
Vikrant More 938f12e99d Bluetooth: Mesh: Gen. OnOff, Gen. Level, Lighting & Vendor Models
This is a application demonstrating a Bluetooth mesh node in
which Root element has following models

- Generic OnOff Server
- Generic OnOff Client
- Generic Level Server
- Generic Level Client
- Generic Power OnOff Server
- Generic Power OnOff Setup Server
- Generic Power OnOff Client
- Light Lightness Server
- Light Lightness Setup Server
- Light Lightness Client
- Light CTL Server
- Light CTL Setup Server
- Light CTL Client
- Vendor Model

And Secondary element has following models

- Generic OnOff Server
- Generic OnOff Client
- Generic Level Server
- Generic Level Client
- Light CTL Temperature Server

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-06-23 22:42:45 +02:00
Vikrant More 1bbfdf1d1a samples: mesh/onoff-app: Enable persistent storage support
Enable persistent storage support in
samples/boards/nrf52/mesh/onoff-app.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-06-15 15:47:27 +02:00
Luiz Augusto von Dentz 68de9d5d66 Bluetooth: Use Characteristic attribute whenever possible
With updates to bt_gatt_notify and bt_gatt_indicate it is now possible
to pass the Characteristic attribute instead of its value which makes
the code able to verify if attribute properties are set correctly.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-06-11 14:41:19 -04:00
Kumar Gala 27f05e3929 samples: board: 96b_argonkey: Remove dead code
CONFIG_ILS29035 isn't defined anywhere, so remove code associated with
it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-23 17:57:06 -04:00
Armando Visconti 02bb83bec2 samples/boards: Add ArgonKey test
Test ArgonKey board. It provides an example of how to test
all the sensors on-board. It currently enables by default
following sensors:

   LPS22HB pressure/temp
   HTS221 humidity
   LSM6DSL accel/gyro plus LIS2MDL magn connected to it.
   VL53L0x proximity

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-05-18 13:10:33 -05:00
Jan Van Winkel ca16779d9e driver: ILI9340 LCD display driver
Minimal driver for ILI9340 LCD display driver including support
for adafruit 2.2" LCD display (1480)

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-05-18 20:21:45 +03:00
Marti Bolivar 7588680afb samples: olimex_stm32_e407: ccm: trivial README.rst fix
Use zephyr-app-commands for portability instead of assuming Make and
Unix, and add a missing "run" goal.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-17 07:41:56 +03:00
Ramakrishna Pallala 769c3a8bf2 samples: boards: Remove deprcated k_call_stacks_analyze API
Replace deprecated k_call_stacks_analyze() API with
k_thread_foreach() API.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-05-15 13:43:00 +03:00
Luiz Augusto von Dentz 1b038f2941 Bluetooth: GATT: Make BT_GATT_CHARACTERISTIC declare its value
This ensures the every characteristic has a value attribute declared
with the same UUID since the old macro did not declare the value the
application would normally have to declare one itself using a different
UUID which is not allowed.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-05-14 18:51:22 +03:00
Johan Hedberg 8703ffad23 Bluetooth: Mesh: Redesign element and storage info for models
Keeping the model struct same sized, change the element pointer to two
indexes, and add a flags member that will be used to track pending
storage actions.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-11 16:44:43 +03:00
Anas Nashif b3275d651c tests/samples: add hw dependencies
Add hardware dependencies and filters to make sure we do not explode if
for example we try to build a sample/test using rtc when the platform
does not support that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 19:10:27 -04:00
Anas Nashif 65600d4723 samples: power_mgr: add harnesss configuration
This test prints out to the console, when testing on real hardware,
parse output and compare to what we are expecting to avoid timeouts.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Anas Nashif 156091fba6 samples: sample.yaml cleanup
Cleanup test names and filtering and add console harness support where
needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Armando Visconti 87d6c50e47 sensors: Add separation between ambient and die temperature
Some device include a temperature sensor, usually used as a
companion for helping in drift compensation, that measure the
die temperature. This temperature IS NOT related to the the
ambient temperature, hence a clean separation between the two
is required.

This commit introduces a clean separation between the two
types of temperature leaving the old deprecated definition
still there.

The list of current drivers that read the die (and not the ambient)
temperature is the following:

 - adxl362
 - bma280
 - bmg160
 - bmi160
 - fxos8700
 - lis3mdl
 - lsm6ds0
 - lsm6dsl
 - lsm9ds0
 - mpu6050

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-04-03 22:29:11 -04:00
Johan Hedberg b9588d8eb6 Bluetooth: Mesh: Switch to using Linux Foundation Company ID
The Linux Foundation now has an assigned Company Identifier, so switch
to using that.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-03-05 19:54:21 -05:00
Erwin Rol 6c0e69e7fd samples: olimex_stm32_e407: CCM usage example
Add an example program showing the use of the STM32 CCM.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2018-02-13 12:36:22 -06:00
Johan Hedberg ac1360f0a7 Bluetooth: Mesh: Convert to new net_buf_simple APIs
Convert the mesh code to use the new net_buf_siple APIs. This has the
benefit of saving 4 bytes off the stack due to the not needed pointer.
Also update the publication context helpers to map to the new
net_buf_simple API in an intuitive way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-13 14:00:08 +02:00
Luiz Augusto von Dentz 800bfaf9a7 Bluetooth: UUID: Remove macros defining 16 bit values
Application should normally declare a bt_uuid with proper type and then
use bt_uuid_cmp.

Fixes #5162

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-02-13 13:33:48 +02:00
David B. Kinder 8cdd9bed6c doc: fix duplicate sample doc titles
Two docs listed in the Samples an Demos TOC had the same title displayed
in the board-specific samples section, "Power Management Demo".  Give
both sample docs a more specific title.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-02-12 21:59:54 -05:00
Paul Sokolovsky b7623a85b0 sensors: Redefine SENSOR_CHAN_HUMIDITY in percents, not milli-percents.
Based on the discussion in #5693, the reason why humidity was defined
in milli-percent was likely following Linux which defines it as such
in its sensor subsystem:
http://elixir.free-electrons.com/linux/latest/source/Documentation/ABI/testing/sysfs-bus-iio#L263

However, Linux defines temperature in milli-degrees either, but
Zephyr uses degrees (similarly for most other quantities). Typical
sensor resolution/precision for humidity is also on the order of 1%.

One of the existing drivers, th02.c, already returned values in
percents, and few apps showed it without conversion and/or units,
leading to confusing output to user like "54500".

So, switching units to percents, and update all the drivers and
sample apps.

For few drivers, there was also optimized conversion arithmetics
to avoid u64_t operations. (There're probably more places to
optimize it, and temperature conversion could use such optimization
too, but that's left for another patch.)

Fixes: #5693

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-05 14:10:39 +01:00
Johan Hedberg 8fc4c99496 Bluetooth: Remove redundant AD parsing check
A few lines earlier the code bails out in case len is 0. Checking for
buf->len < 1 is the same as checking for buf->len == 0. Since len is
guaranteed to be > 0 here the check len > buf->len implicitly checks
for buf->len == 0, i.e. the second test can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 07:01:10 -08:00
Anas Nashif 33592e8aa8 cmake: remove IS_TEST handling
Depending on a path inside the Zephyr tree to determine if we are a test
does not scale. Also some samples were marked as TEST while they are
not, just to get some options defined for tests.

Idenitfying a test will be addressed in another patch introducing
CONFIG_TEST.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 10:03:57 -05:00
Anas Nashif c78296dab4 tests: remove obsolete CONFIG_MDEF
CONFIG_MDEF is no more..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 08:08:45 -05:00
Anas Nashif eba1bbd705 samples: remove more build_only tags
Remove build_only and add harness type needed for the sample/test to
allow running with sanitycheck and on devices once we have harness
support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Ramakrishna Pallala b82dfb479b samples: boards: add sample for Altera Nios-II PIO core
Add a sample application for Nios-II PIO core on Altera MAX10 board.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-12-21 12:02:24 -08:00
Sebastian Bøe cf6cb590df cmake: Don't link with subsys__bluetooth unnecessarily
It is only necessary to link with subsys__bluetooth if the path
"subsys/bluetooth" is needed as an include directory. None of the
samples have this need.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-19 12:46:03 -05:00
Kumar Gala dfce457ebe samples: mesh/onoff-app: fix whitelist typo
Board name is nrf52840_pca10056 (with an underscore) instead of
nrf52840-pca10056 (with a dash).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-12-14 14:02:09 -05:00
Anas Nashif 2c96dacf0a samples: mesh/onoff-app: fix sample.yaml syntax
Also, remove build_only, we can run on the whitelisted platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-14 13:04:51 -05:00
Steve Brown bce1b974f0 samples: onoff-app: Add OnOff Model for the Nordic nRF52840-PDK board
Signed-off-by: Steve Brown <sbrown@cortland.com>

---

The updates to BlueZ' meshctl have not been submitted.

I am submitting this PR only for review. It could be committed
after the patches for the meshctl commands are applied.
2017-12-14 08:27:05 +02: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
Youvedeep Singh 691d709943 samples: nrf52: power_mgr: Increase idleness for main thread
Increase sleep time for main thread (1 sec to 1 minute) to keep SOC
in Low Power State for longer time. Currently nrf SOC is entering into
low power state and exiting immedately after 1 sec.
With this change SOC will wake stay in Low Power State till GPIO is
pressed or sleep time expired (whichever is earlier).

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-18 11:21:13 -05:00
Sebastian Bøe 49e7ca957e cmake: set IS_TEST in the samples that were including Makefile.test
For an unknown reason, various samples in KBuild were including
Makefile.test, this had some desired benefits, one of which is that
the popular BOOT_BANNER appears. The CMake-equivalent of including
Makefile.test is setting the flag IS_TEST. This commit reverts the
behaviour of the samples back to how it was pre-cmake.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-16 08:26:25 -05:00
Carles Cufi bd9d38b5bd samples: boards: Convert doc to CMake
Convert doc of samples/boards 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
Youvedeep Singh 3a179e29b0 samples: boards: nrf52: test demo for nrf52 power management
This sample tesecase provides sample code :-
1. Triggers Low Power tasks into nrf52 SOC (CONST LAT and LOW PWR)
2. Triggers System Off state.
3. Wake up device through port Event by GPIO (Button 1).

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-06 09:29:10 -05:00
Harry Jiang 17404abed3 samples: environmental_sensing: fix the data type for read_u32()
Signed-off-by: Harry Jiang <explora26@gmail.com>
2017-10-17 09:10:26 +03: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
Johan Hedberg 8f168c85f7 samples: microbit/pong: Fix incorrect placement of parenthesis
The code was causing only one byte of data to be placed in timeout
instead of sizeof(timeout) as intended.

Coverity-CID: 170744

Fixes #4057

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-26 12:55:14 +03:00
Anas Nashif f7b2484219 samples: add missing sample.yaml and fix build
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 17:21:08 -07:00
Johan Hedberg 2975ca0754 Bluetooth: Kconfig: Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.

Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-09 11:14:19 +03:00
Andrew Boie 65a9d2a94a kernel: make K_.*_INITIALIZER private to kernel
Upcoming memory protection features will be placing some additional
constraints on kernel objects:

- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.

Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.

It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.

There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.

k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Anas Nashif c69de8b146 samples: remove reference to nimble
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Johan Hedberg 30beef9419 Bluetooth: GATT Introduce BT_GATT_CCC_MAX helper define
The worst-case maximum number of CCC entries we need is actually
MAX_CONN + MAX_PAIRED. Provide a helper define for it and use it
whenever appropriate.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-04 17:30:40 +03:00
Anas Nashif dc36e905b6 samples: environmental_sensing: update filtering
Build only for arduino 101 and update title and description.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-22 09:22:48 -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
David B. Kinder a741c00a08 doc: fix references to moved files
Some recent PRs moved sample files to a new location

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-20 18:26:53 -04:00
Anas Nashif 19e78bcfe1 samples: move quark se power samples to boards/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif f7c226400d samples: move environment sensing to boards
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Luiz Augusto von Dentz 79af35991b Bluetooth: GATT: Add bt_gatt_register_service
This adds bt_gatt_register_service using bt_gatt_service which contains
the attribute array that is then added to the database saving a pointer
in each and every attribute declared.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz d837a6ec4b Bluetooth: GATT: Add GAP service by default
GAP is mandatory service and now that the db can only be build
dynamically there is no reason to keep the applications registering it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz b3cfabab63 Bluetooth: Remove CONFIG_BLUETOOTH_GATT_DYNAMIC_DB
Removes CONFIG_BLUETOOTH_GATT_DYNAMIC_DB in preparation to the
introduction of bt_gatt_unregister.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Johan Hedberg d2ba7950c5 samples: boards/microbit: Use 250 ticks per second for smooth display
To avoid display flickering, use 250 ticks per second instead of the
default 100.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 12:29:11 +03:00
Johan Hedberg a90735d64c samples: microbit/pong: Disable advertising when connected
The state machine of the game assumes that the user needs to
explicitly re-select multiplayer game when disconnected. We need to
therefore make sure that advertising stays off as soon as the first
connection happens.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 10:11:09 +03:00
Johan Hedberg eb89db26b5 samples: microbit/pong: Fix disabling sound when ending game
Occasionally the sound might stay enabled for the restart timeout (2
seconds) if the ball would hit the wall right before missing the
paddle. Ensure that it's disabled whenever the game ends.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 10:11:09 +03:00
Johan Hedberg 1bb9a04912 samples: microbit/pong: Fix refreshing display upon disconnect
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg 190b0d1a10 samples: microbit/pong: Filter out spurious button presses
The buttons on the microbit cause quite easily "ghost" key presses.
Add a simple filter that ignores button presses from the same button
that happen less than 100ms from each other.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg 0b16e8ada5 samples: microbit/pong: Increase ISR stack size
The stuff that the GPIO button callback does (in particular the printk
calls) requires more stack space from the ISR stack. Increase it to 1k
from the default 640.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg 3357813373 samples: microbit/pong: Analyze kernel stacks periodically
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg 9e2fb2f3ad samples: microbit/pong: Add basic sound support
Add beeps whenever the ball hits the walls or the paddle. Requires a
piezo buzzer connected to pin 0.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07:00
Johan Hedberg 5e59f13ca3 samples: microbit/pong: Add BLE-based multiplayer support
Add support for connecting two micro:bit devices to play pong between
themselves.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07:00
Johan Hedberg 9a7cb7134a samples: microbit/pong: Add initial draft of a pong game
Add initial draft of a pong game using the display on the micro:bit
and its two buttons. This draft only supports a solo game where the
ball bounces from the "roof" and lets the player play against himself.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07: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
Johan Hedberg 191cb2d0fc samples/boards/microbit: Add sound sample
Add a sample demonstrating sound output using PWM to a piezo buzzer
connected to the external edge connector port P0.

Change-Id: I8c0902fd935f2eb3b9979476a7540e7a0216ca63
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-18 01:55:10 +00:00
Johan Hedberg d7a189d2ec drivers: display: mb_display: Unify image and string APIs
Both the string and image rendering may want to take advantage of
scrolling and sequential display capabilities. Consolidate the APIs so
that there's a single one for images (mb_display_image) and a single
one for strings (mb_display_print). Both take a duration parameter for
the per-frame duration as well as a mode parameter which specifies
sequential vs scrolling behavior as well as an optional looping flag.

Change-Id: Ia092d771e3f1b94afd494c7544dab988161c539e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-06 00:59:30 +00:00
David B. Kinder 0f77021ba7 doc: add labels to board-specific 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: Ib2d9b1cc4144bd84b1b89691a80dffd99212289d
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 20:47:53 +00:00
Johan Hedberg 7e5df0cc02 drivers: display: Enhance BBC micro:bit string output capabilities
Add a new mb_display_print() API which takes printf-style parameters
and outputs scrolling text instead of one character at a time. The
existing mb_display_str() API is renamed to mb_display_string() for
consistency, and now also takes printf-style parameters.

Change-Id: I59c42bcd74c62f05ecb6d097dc808b9e5c1984c5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-04 13:54:00 +03:00
Johan Hedberg 380d24de1d drivers: Add support for BBC micro:bit LED display
Adds a simple driver to access the 5x5 LED display found on BBC
micro:bit boards. The display is so limited that no effort is done to
try to integrate with the existing console (which would likely make
the display unusable). Instead, dedicated mb_display_* APIs are added
that are specific to this display.

References:

 https://www.microbit.co.uk/device/screen
 https://lancaster-university.github.io/microbit-docs/ubit/display/

Jira: ZEP-1990
Change-Id: I431b5b358b5f07592a60d3aed87eaab6ac20ce25
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-04 08:14:36 +03:00