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.).
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.
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.
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.
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.
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).
Add a missing license header.
Remove semaphores and add +CRTDCP to support async operation.
Fix delete context and disconnect to execute just once.
Add support for NONIP PPD type.
Change CellularNetwork::clear() to virtual so it can be overridden.
Add missing license headers.
Remove semaphores to allow async operation.
Change hex format to allow binary payload.
Limit payload size to 100 bytes.
Fix missing plus char at +QCFGEXT.
Earlier CellularDevice has owned event queue used by cellular (state machine and ATHandler for example),
but the thread used to dispatch the queue has been owned by state machine.
This commit moves the event queue thread to CellularDevice so now the ownership of cellular event queue
is in one place.