~aleteoryx/muditaos

266c2085296f7369f7a4c4571e544e31258b4c7b — Wojtek Rzepecki 4 years ago 34a0d61
[EGD-6790] Fix cellular sleep mode

Fix of cmux communication in order to
prevent polling thus provide sufficient
time of inactivity to get into sleep mode
M module-bsp/board/rt1051/bsp/cellular/rt1051_cellular.cpp => module-bsp/board/rt1051/bsp/cellular/rt1051_cellular.cpp +1 -1
@@ 318,7 318,7 @@ namespace bsp
        exitSleep();

        auto timeoutTicks = pdMS_TO_TICKS(timeoutMs.count());
        if (timeoutTicks > portMAX_DELAY) {
        if ((timeoutTicks > portMAX_DELAY) || (timeoutMs == std::chrono::milliseconds::max())) {
            timeoutTicks = portMAX_DELAY;
        }


M module-cellular/modem/mux/CellularMux.cpp => module-cellular/modem/mux/CellularMux.cpp +2 -2
@@ 549,7 549,7 @@ void CellularMux::processData(bsp::cellular::CellularDMAResultStruct &result)
{
    LOG_DEBUG("Worker start");

    constexpr auto readTimeout = std::chrono::seconds{1};
    constexpr auto waitForDataIndefinitely = std::chrono::milliseconds::max();
    CellularMux *inst          = static_cast<CellularMux *>(ptr);

    bsp::cellular::CellularDMAResultStruct result{};


@@ 557,7 557,7 @@ void CellularMux::processData(bsp::cellular::CellularDMAResultStruct &result)
    while (true) {
        result.resultCode = bsp::cellular::CellularResultCode::ReceivedNoData;

        inst->cellular->read(&result, bsp::cellular::CellularDMAResultStruct::getMaxSize(), readTimeout);
        inst->cellular->read(&result, bsp::cellular::CellularDMAResultStruct::getMaxSize(), waitForDataIndefinitely);

        switch (result.resultCode) {
        case bsp::cellular::CellularResultCode::ReceivedAndFull: