Commit Graph

28107 Commits (d6a48b5124f4ba8983c6e7eaf505ee4f76f52ed2)

Author SHA1 Message Date
Kevin Bracey d6a48b5124 Turn NULLs into nullptr
Avoids overload problems with Callback(nullptr) versus Callback(fnptr).
2020-01-09 14:52:54 +02:00
Kevin Bracey 9577b0853b Add mstd_new for mstd::launder
Increasingly clever compilers can hit funny aliasing problems with
object stores like mbed::Callback. Add access to the C++17 launder
facility.
2020-01-09 14:52:50 +02:00
Kevin Bracey 33d9abe762 Merge callback tests 2020-01-09 14:52:50 +02:00
Martin Kojtal 8c4ed4a6cb
Merge pull request #11897 from kjbracey-arm/crc
MbedCRC: improve init value handling and tests
2020-01-09 13:31:30 +01:00
Martin Kojtal 759ce271c2
Merge pull request #12200 from MultiTechSystems/fix_PeripheralPins
Minor fixes for peripheral pins on Dragonfly Nano
2020-01-09 13:17:01 +01:00
Martin Kojtal d7b7223bcd
Merge pull request #12218 from mprse/ticker_interrupt_test_fix
tests-mbed_hal-common_tickers: adapt ticker_interrupt_test() test case for high frequency tickers - WIP
2020-01-09 13:16:16 +01:00
Martin Kojtal ec3fc672a1
Merge pull request #12215 from u-blox/ubx_get_ip_addr
Cellular: Implementation of virtual get_ip_address funtion in ublox-api
2020-01-09 12:43:12 +01:00
Martin Kojtal 1fb9dd7ddd
Merge pull request #12122 from AnttiKauppila/visibility_fixes
ATHandler refactoring
2020-01-09 12:05:08 +01:00
Martin Kojtal 974baaf199
Merge pull request #12143 from VeijoPesonen/blockdevices_testable
Blockdevice config changes to make it possible to run littlefs filesystem tests
2020-01-09 12:04:20 +01:00
Martin Kojtal 222d31c2b6
Merge pull request #12037 from kjbracey-arm/sharedptr_move
SharedPtr: add move operations
2020-01-09 12:03:45 +01:00
Martin Kojtal dbb0695311
Merge pull request #12202 from LMESTM/Increase_MSI_Freq_out_of_deep_sleep
Increase MSI clock frequency when exiting deep sleep
2020-01-09 10:49:20 +01:00
Przemyslaw Stekiel db8e77672f tests-mbed_hal-common_tickers: adapt ticker_interrupt_test() test case for high frequency tickers
On some targets with very fast counters used for us ticker (e.g. 26 MHz) tested interrupt delays provided in the ticker_timeout array may be too short (execution of the set_interrupt() function takes longer than the tested delay).
We will skip tested ticker delay if the delay is less than assumed max set_interrupt() function execution time (20 us).
Also, the test array will be extended.
2020-01-09 08:32:30 +01:00
mudassar-ublox 075a6fdd99 Override virtual get_ip_address funtion in ublox-api for targets UBLOX_C030_U201 and UBLOX_C027 2020-01-09 12:16:48 +05:00
Martin Kojtal 40b7901cfb
Merge pull request #12217 from OpenNuvoton/nuvoton_usbd
Nuvoton: Add DEVICE_USBDEVICE detection in usbd implementation
2020-01-08 17:00:23 +01:00
Martin Kojtal 8d94d4ce92
Merge pull request #12214 from kivaisan/move_string_to_pdp_type_to_cellularcontext
Cellular: Move string_to_pdp_type method to CellularContext
2020-01-08 16:59:58 +01:00
Martin Kojtal af03f839e2
Merge pull request #10959 from OpenNuvoton/nuvoton_m2351_psa
M2351: Support TFM level 1
2020-01-08 16:09:35 +01:00
Martin Kojtal c42125f890
Merge pull request #12151 from hugueskamba/hk-nrf-fix-baremetal-build
NRF5x: Fix baremetal linker error
2020-01-08 14:41:26 +01:00
Martin Kojtal 4b0c4a073c
Merge pull request #12216 from rvolosatovs/fix/unit-tests
Fix dl_channel tests
2020-01-08 14:04:25 +01:00
Martin Kojtal 1a6934adc4
Merge pull request #12081 from micgur01/master
Expose target_offset and header_offset parameters in targets.json
2020-01-08 14:01:57 +01:00
cyliangtw b924a922a8 Add DEVICE_USBDEVICE detection in usbd implementation to avoid compiler error on target without usb-device 2020-01-08 19:36:51 +08:00
Kevin Bracey ccd2a32ad1 MbedCRC: improve default constructors
Original default constructor implementation wasn't quite working
properly; it didn't cope with the new "mode_limit" parameter.

Change mechanism so that this now works:

    MbedCRC<POLY32_BIT_ANSI_CRC, 32, CrcMode::TABLE> crc;
2020-01-08 13:36:17 +02:00
Kevin Bracey 83a9606140 CRC tests: increase parameter reflection coverage
CRC tests failed to exercise handling of the initial and final-xor
values with respect to reflection parameters. Add tests covering this.

Expected behaviour is that the initial value is always non-reflected and
the final-xor happens after the optional output reflection.
2020-01-08 13:36:17 +02:00
Kevin Bracey c46a2ad6ba MbedCRC HAL test: remove duplicates 2020-01-08 13:36:17 +02:00
Kevin Bracey 094f22901f MbedCRC: handle init values better
Init values often need reflection, and use of `__RBIT` prevents constant
init being done at compile time (unless `__RBIT` uses a compiler
intrinsic, which it doesn't for GCC).

Rather than try to handle constants 0U and -1U with a special case to
avoid the RBIT, which can in turn lead to runtime bloat for nonconstant
inits, use a C++20 style is_constant_evaluated() check to switch between
C and assembly forms.

This reduces code-size for non-constant init, by eliminating a runtime
condition, and allows the bit-reversal of any constant init to happen at
compile time.
2020-01-08 13:36:17 +02:00
Kevin Bracey 07d43b72d2 Add mstd::is_constant_evaluated
GCC 9 and sufficiently-new Clang (including ARM Compiler 6.13) give us
access to the C++20 (draft) `is_constant_evaluated` test. Allows us to
restrict code to compile-time only.

This is particularly useful when using assembler intrinsics, which the
compiler cannot optimise or compile-time evaluate. It allows us to write
something like

    constexpr uint32_t reverse_bits(uint32_t x)
    {
        if (is_constant_evaluated(x)) {
            // C code to do calculation here
            return x;
        } else {
            // an assembler intrinsic that cannot be optimised
            return __RBIT(x);
        }
    }

This can then be totally compile-time given a constant input.

(In this example, ultimately it would be a good idea to include this
functionality in CMSIS's GCC `__RBIT`, which needs it because GCC
requires use of assembler. Clang implements `__RBIT` as a built-in,
meaning it can already compute it at compile-time, so does not benefit.).
2020-01-08 13:36:17 +02:00
Kevin Bracey 04f929e85f MbedCRC.h: declare table specialisations
Clang emits warnings if it can see a declaration when it needs a
templated variable. Add declarations for the specialisations in
MbedCRC.cpp to MbedCRC.h keep it quiet.

Tighten up a little by making all `_crc_table` references conditional
on tables being configured on.
2020-01-08 13:36:17 +02:00
Martin Kojtal b77f6b457e
Merge pull request #12055 from 0xc0170/fix_12054
cmsis: remove arm math
2020-01-08 12:00:54 +01:00
Roman Volosatovs 21b0463653
Fix dl_channel tests 2020-01-08 11:54:05 +01:00
Kimmo Vaisanen 0d7cc428b1 Cellular: Move string_to_pdp_type method to CellularContext
string_to_pdp_type is only used in CellularContext classes and by having
the conversion method in CellularContext it can be used to check also
the non-standard Non-IP PDP type string.
2020-01-08 12:15:51 +02:00
Laurent Meunier 022c0eb7dc Increase MSI clock frequency when exiting deep sleep
This will optimize down the time it takes to restore the clock
settings when getting out of deep sleep.

If 48MHz is available let's use it, otherwise at least 4MHz should be
available for any MCU with MSI.
2020-01-07 17:59:33 +01:00
Martin Kojtal 6b89d16dd3
Merge pull request #12181 from michalpasztamobica/dtls_design_doc_connectivity
Add DTLS in Connectivity's design document
2020-01-07 16:41:36 +01:00
Martin Kojtal d4c2fd56a9
Merge pull request #12195 from mikaleppanen/ppp_trace_disable
Corrected PPP debug trace flagging
2020-01-07 16:41:15 +01:00
Martin Kojtal fab9e3b6c7
Merge pull request #12176 from OpenNuvoton/nuvoton_usbd
Nuvoton: Support usbd
2020-01-07 16:38:39 +01:00
Antti Kauppila 5553d0acd3 ATHandler class refactor
Refactored ATHandler class to have clear private and public elements
Also removed virtuality from ATHandler
Unittests updated to reflect changes
2020-01-07 17:15:27 +02:00
Antti Kauppila 36ca4d6516 ATHandler relocated
ATHandler is part of our API so header file was moved under API folder and .cpp file was moved under device/ folder
ATHandler is used in both AT and PPP mode so it has been in slightly wrong place at the beginning.
2020-01-07 17:15:27 +02:00
Martin Kojtal c8ac1ef2b8
Merge pull request #12196 from kjbracey-arm/lwipclose
LWIP: don't pbuf_free(NULL) on socket close
2020-01-07 15:56:13 +01:00
Martin Kojtal 3e790cc9ab
Merge pull request #12065 from AriParkkila/cell-fea-nidd
Non-IP socket implementation for NIDD over CP
2020-01-07 15:55:15 +01:00
Leon Lindenfelser 94ead7adb2 Minor fixes for peripheral pins on Dragonfly Nano
1. PG8 should be labeled I2C3 not I2C1.
2. PC0 is dedicated to measuring system voltage.
2020-01-07 08:52:34 -06:00
Martin Kojtal d07d7ca722
Merge pull request #12185 from paul-szczepanek-arm/db-delete
BLE: fix pointer not set to null on delete
2020-01-07 14:56:04 +01:00
Martin Kojtal 9d16a17e7e
Merge pull request #11653 from tymoteuszblochmobica/multiple
Add  Getaddrinfo interface for multiple DNS adresses
2020-01-07 14:53:36 +01:00
Martin Kojtal 2d3c4022ae
Merge pull request #12193 from kivaisan/move_event_thread_to_cellulardevice
Cellular: Move cellular event queue thread ownership to CellularDevice
2020-01-07 14:04:55 +01:00
Ari Parkkila 7899fead59 Cellular: Refactor CellularBase from AT_ControlPlane_netif 2020-01-07 04:03:33 -08:00
Martin Kojtal 39daa5fd77
Merge pull request #12109 from hugueskamba/hk-replace-rawserial-usage
Replace RawSerial as it has been deprecated
2020-01-07 12:59:57 +01:00
Kevin Bracey 988ef099c7 LWIP: don't pbuf_free(NULL) on socket close
`pbuf_free(NULL)` causes an `LWIP_ASSERT`. Make the call conditional.

Fixes #12184
2020-01-07 13:20:14 +02:00
Martin Kojtal 5d71e69f6a
Merge pull request #12186 from mprse/fix_for_issue_12172_stm_serial
STM serial init: Set pin function only if pin is defined (not NC)
2020-01-07 11:38:00 +01:00
Martin Kojtal 7d8eec4b4d
Merge pull request #12155 from hugueskamba/hk-baremetal-lpc11uxx-fix
LPC11U24: Fix baremetal build and runtime error
2020-01-07 11:28:10 +01:00
Martin Kojtal b943b5f4db
Merge pull request #12179 from jamesbeyond/update_ble
TESTS: Update testing of examples in mbed-os
2020-01-07 11:25:19 +01:00
Mika Leppänen 9e41f1fc7d Corrected PPP debug trace flagging
Some parts of PPP debug traces were enabled also on non-debug builds.
Now they are correctly disabled. Corrected also compiler warnings
that became visible when trace macros were flagged (if clauses without
brackets).
2020-01-07 12:07:50 +02:00
Martin Kojtal 0f5c3f0b37
Merge pull request #12189 from dustin-crossman/cy8cproto_062_4343w-baudrate-fix
Removed hardcoded CY8CPROTO_062_4343W bt baudrate limit.
2020-01-07 11:04:43 +01:00
Martin Kojtal e666848f07
Merge pull request #12194 from juhhei01/socket_api_fix
Nanostack Socket event handler fix
2020-01-07 11:00:28 +01:00