Removed redundant coding which was related to old implementation.
Now Server will publish the new state information to the model’s Publish
Address only when there is mismatch between target & current values.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
The current code is assuming that the pointer to the thread structure is
32bit, casting it to u32_t before printing its address. This is wrong on
64bit architectures (CONFIG_64BIT) and the compiler complains.
Fix the problem by using '%p' to print the address.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Python 3.5 and earlier do not preserve dictionary insertion order when
iterating over dictionaries, and do not give the same order between
runs. This broke the dtlib and edtlib test suites and made the output
jump around randomly between runs. It also made device INST_<n> numbers
non-deterministic, which broke some code on Python 3.5 (though
hardcoding device instance numbers in the code might be a bit shaky).
Fix it by using collections.OrderedDict instead of plain dict wherever
order matters. This makes the output identical on all supported Python
versions. It also allows testdtlib.py and testedtlib.py to run in CI,
which uses Python 3.5.
Fixes: #20571
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
edtlib is a library, and modifying yaml.(C)Loader directly interferes
with any binding loading in edtlib clients. To avoid that, add a custom
loader for bindings.
Internally, PyYAML does this, which is why defining a separate class
works:
@classmethod
def add_constructor(cls, tag, constructor):
if not 'yaml_constructors' in cls.__dict__:
cls.yaml_constructors = cls.yaml_constructors.copy()
cls.yaml_constructors[tag] = constructor
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
dyn_reg_info has MPU_DYNAMIC_REGION_AREAS_NUM elements, just changing
the if check to be greater equal to this number to avoid access
MPU_DYNAMIC_REGION_AREAS_NUM element causing an out-of-bounds write.
CID: 205648
Fixes#20487
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
In order to use clang it is necessary to set the variable
ZEPHYR_TOOLCHAIN_VARIANT to llvm instead of clang.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
commit 0df4a53107 changed the behavior of
how openocd commands are passed to openocd. We used to add -c to each
command, now the commands are being added without -c causing an error.
This adds "-c" to all commands instead of just passing a list.
Also fixes#20449.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit removes duplicate 'irq_offload_routine_t' typedef
declaration in sys/arch_interface.h.
This typedef is provided by irq_offload.h and, since this header file
is included at the top of sys/arch_interface.h, it is guaranteed to be
defined for arch_irq_offload definition.
While this does not cause a compilation error when compiling with GCC
4.6 and above, GCC 4.5 and below strictly enforce the C99 standard and
do not allow redeclaration of the same typedef in the same scope.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Cast to (void) the lsm6dso_mem_bank_set() calls as we
are not interested to the return value.
Coverity-CID: 205625
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Setting it to UINT32_MAX, as it is subsequently overwritten with
MIN(oldest, something_else).
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
The code was not properly taking into account CONFIG_BT_HCI_RESERVE,
which would cause buffer underruns for any HCI driver where this value
defaults to non-zero. Also, all the allocation functions use the same
pool, so we can map them simply to bt_buf_get_rx() instead of
repeating the same code.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Fix build reply function. The sample uses return value
from net_pkt_read() to determine data length,
but the return value is 0 on success.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
The mimxrt10{20,60,64}_evk board docs were renamed from <board>.rst to
index.rst in commit 0e4ff809d7 but were
missing entries in the html redirect list. Add them.
An entry for mimxrt1015_evk is not added because this board always had
an index.rst board doc.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The translation to encoded multi-level interrupts failed to account
for the GPIO interrupt number being encoded in at bit position 8,
and being offset by 1 in the base encoding.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Fix coverity issue 20534: read the status of a volatile
variable in an ASSERT statement via a stack variable
declared and defined for this purpose.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Use semaphore to synchronize lll_reset completion with HCI thread for
returning (command complete) only when all is done.
Signed-off-by: Morten Priess <mtpr@oticon.com>
The I2C peripheral should be configured using the CPU clock frequency
and not the system clock frequency. This used to be fine because they
were the same before #19232, but now that the system clock is
RTC-based (which has a different frequency), we can no longer make
that assumption.
Fixes#20480
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Fix connection update procedure to be cacheable if any other
local or remote control procedure is in progress.
Relates to commit 9c14567ce2 ("Bluetooth: controller: Fix
conn update to be cacheable").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Non-direct ISRs are supposed to take a void pointer as an argument,
unliike direct ones, which take no arguments. Since the radio ISR is not
declared as direct, the void pointer argument was missing, likely due to
a copy-paste mistake from the nordic LLL, which indeed uses a direct ISR
for the radio ISR.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
bt_conn_create_pdu_timeout() may return NULL if no buffer
is available, l2cap_chan_create_seg() does not check the
subsequent return value.
Fix possible null pointer dereference in l2cap_chan_create_seg()
and l2cap_chan_le_send().
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
An issue with DT generation where instance defines are not determinstic
generating values that collide with existing IRQs.
Fixes#20558
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The smallest region that can be erashed is one sector, so setting
SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=2048 will fail at runtime when the
flash page API is used to erase a single (or misaligned) page. Add a
compile-time check that the requested layout page size is erasable.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Add internal API to enter and exit deep power-down mode. Add Kconfig
option to return to DPD whenever device is not active.
When device power management becomes more mature it should be possible
to implement it, which would allow use of DPD without having to enter
and exit DPD between consecutive transactions.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Convert the LOCK/UNLOCK macros to acquire/release functions in
preparation for extending those steps to include power management.
Also commit to always allocating a semophore, and use a more clean
way of conditionalizing the operations.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Provide information required to allow the driver to put the flash chip
into a deep power down mode. This can reduce standby current by as
much as 90%.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The SPI NOR driver requires that the size (in bits) be provided in the
devicetree node. Update the binding to make the property required,
and update all nodes based on the memory chip identified.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Add assert when negative (except K_FOREVER) is passed as timeout.
Add negative timeout correction to 0.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Timeout and use s32_t as an argument but only positive values are
accepted (or special value like K_FOREVER). It was not specified in
the description which may lead to misinterpretation.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The addition of API to correctly handle conversion between durations
in different clocks inadvertently changed the type of the value
produced by the API. Specific changes were:
s32_t z_ms_to_ticks(s32_t t) =>
u32_t k_ms_to_ticks_ceil32(u32_t t) : signedness change
s32_t __ticks_to_us(s32_t t) =>
u64_t k_ticks_to_us_floor64(u64_t t) : signedness and rank change
s32_t z_us_to_ticks(s32_t t) =>
u64_t k_us_to_ticks_ceil64(u64_t t) : signedness and rank change
int sys_clock_hw_cycles_per_tick() =>
u32_t k_ticks_to_cyc_floor32(1) : signedness change
The effect of this is to change the essential type of operands in
existing expressions, potentially resulting in behavior changes when
calculations were promoted to unsigned types, or code size by
requiring 64-bot arithmetic.
Add casts as necessary to preserve the original return type, and to
explicitly recognize impact of passing macro parameters into a context
where a specific type will be used.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Some use cases require using high-resolution tick or cycle clocks to
measure sub-millisecond durations. Generate the corresponding 32-bit
conversions to avoid the cost of 64-bit math in the common case where
the duration fits in 32 bits in both original and converted scale.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>