~aleteoryx/muditaos

0323d7cfadb2941e3689a780b9de12d33dd4d396 — Przemyslaw Brudny 4 years ago 579ca79 + d0d8471
Merge remote-tracking branch 'origin/stable'
M module-apps/apps-common/ApplicationCommon.cpp => module-apps/apps-common/ApplicationCommon.cpp +4 -8
@@ 219,14 219,7 @@ namespace app
        // send drawing commands only when if application is in active and visible.
        if (state == State::ACTIVE_FORGROUND) {
            auto window = getCurrentWindow();
            window->updateBatteryStatus();
            window->updateBluetooth(statusIndicators.bluetoothMode);
            window->updateAlarmClock(statusIndicators.alarmClockStatus);
            window->updateSim();
            window->updateSignalStrength();
            window->updateNetworkAccessTechnology();
            window->updateTime();
            window->updatePhoneMode(statusIndicators.phoneMode);
            updateStatuses(window);

            auto message = std::make_shared<service::gui::DrawMessage>(window->buildDrawList(), mode);



@@ 244,6 237,9 @@ namespace app
            suspendInProgress = false;
    }

    void ApplicationCommon::updateStatuses(gui::AppWindow *window) const
    {}

    void ApplicationCommon::updateCurrentWindow(std::unique_ptr<gui::SwitchData> data,
                                                gui::ShowMode command,
                                                gui::RefreshModes refreshMode)

M module-apps/apps-common/ApplicationCommon.hpp => module-apps/apps-common/ApplicationCommon.hpp +1 -0
@@ 179,6 179,7 @@ namespace app
        virtual sys::MessagePointer handleAppClose(sys::Message *msgl);
        virtual sys::MessagePointer handleSwitchWindow(sys::Message *msgl);
        virtual sys::MessagePointer handleAppFocusLost(sys::Message *msgl);
        virtual void updateStatuses(gui::AppWindow *window) const;

      private:
        std::string default_window;

M module-apps/apps-common/widgets/ProgressTimer.cpp => module-apps/apps-common/widgets/ProgressTimer.cpp +1 -1
@@ 55,6 55,7 @@ namespace app
    auto ProgressTimer::onTimerTimeout(sys::Timer &task) -> bool
    {
        ++elapsed;
        update();
        if (isStopped() || isFinished()) {
            task.stop();
            if (isFinished() && onFinishedCallback != nullptr) {


@@ 66,7 67,6 @@ namespace app
        if ((intervalReached() || isFinished()) && onIntervalCallback != nullptr) {
            onIntervalCallback();
        }
        update();
        return true;
    }


M module-bsp/board/rt1051/bellpx/hal/battery_charger/BatteryCharger.cpp => module-bsp/board/rt1051/bellpx/hal/battery_charger/BatteryCharger.cpp +22 -4
@@ 19,13 19,14 @@ namespace hal::battery
        bsp::fuel_gauge::init(queueBatteryHandle);
        bsp::battery_charger::init(queueBatteryHandle);

        Store::Battery::modify().level = static_cast<unsigned int>(bsp::fuel_gauge::getBatteryLevel());
        Store::Battery::modify().state = Store::Battery::State::Discharging;
        lastSOC                        = bsp::fuel_gauge::getBatteryLevel();
        Store::Battery::modify().level = static_cast<unsigned int>(lastSOC);
    }

    int BatteryCharger::getBatteryVoltage()
    {
        constexpr auto dummyBatteryLevel = 100;
        return dummyBatteryLevel;
        return bsp::fuel_gauge::getVoltageFilteredMeasurement();
    }

    void BatteryCharger::BatteryCharger::deinit()


@@ 37,7 38,7 @@ namespace hal::battery


        if (notification == bsp::fuel_gauge::FuelGaugeUpdate) {
            Store::Battery::modify().level = bsp::fuel_gauge::getBatteryLevel();
            Store::Battery::modify().level = filterSOC();
        }
        eventsHandler.onStatusChanged();
    }


@@ 45,6 46,23 @@ namespace hal::battery
    void BatteryCharger::setChargingCurrentLimit(std::uint8_t)
    {}

    bsp::fuel_gauge::StateOfCharge BatteryCharger::filterSOC()
    {
        const auto currentSOC = bsp::fuel_gauge::getBatteryLevel();

        /** Due to unknown reasons, fuel gauge sometimes reports SOC raising even if charger is unplugged.
            In order to not confuse the user, SOC reported by fuel gage is filtered based on the last valid SOC
            value. This is not the ideal solution to the problem, but rather a quick&dirty solution which absolutely
           does not fixes the root cause.
        **/
        if (Store::Battery::get().state == Store::Battery::State::Discharging && currentSOC > lastSOC) {
            return lastSOC;
        }
        else {
            return currentSOC;
        }
    }

    BaseType_t IRQHandler(AbstractBatteryCharger::IRQSource source)
    {
        if (source == AbstractBatteryCharger::IRQSource::Charger) {

M module-bsp/board/rt1051/bellpx/hal/battery_charger/BatteryCharger.hpp => module-bsp/board/rt1051/bellpx/hal/battery_charger/BatteryCharger.hpp +4 -0
@@ 4,6 4,7 @@
#pragma once

#include <hal/battery_charger/AbstractBatteryCharger.hpp>
#include <bsp/fuel_gauge/fuel_gauge.hpp>

namespace hal::battery
{


@@ 18,6 19,9 @@ namespace hal::battery
        int getBatteryVoltage() final;

      private:
        bsp::fuel_gauge::StateOfCharge filterSOC();

        AbstractBatteryCharger::BatteryChargerEvents &eventsHandler;
        bsp::fuel_gauge::StateOfCharge lastSOC;
    };
} // namespace hal::battery

M products/BellHybrid/BinaryAssetsVersions.cmake => products/BellHybrid/BinaryAssetsVersions.cmake +2 -2
@@ 1,9 1,9 @@
# This file sets versions of downloaded binaries for release packaging purposes

if( NOT DEFINED ECOBOOT_BIN_VERSION)
    set(ECOBOOT_BIN_VERSION 1.0.17 CACHE STRING "bootloader binary version to download from bootloader release page")
    set(ECOBOOT_BIN_VERSION 1.0.18 CACHE STRING "bootloader binary version to download from bootloader release page")
endif()

if (NOT DEFINED UPDATER_BIN_VERSION)
    set(UPDATER_BIN_VERSION 1.1.2 CACHE STRING "updater binary version to download from updater release page")
    set(UPDATER_BIN_VERSION 1.3.0 CACHE STRING "updater binary version to download from updater release page")
endif()

M products/BellHybrid/apps/Application.cpp => products/BellHybrid/apps/Application.cpp +3 -0
@@ 140,4 140,7 @@ namespace app
    {
        bus.sendUnicast(std::make_shared<StopIdleTimerMessage>(), service::name::appmgr);
    }

    void Application::updateStatuses(gui::AppWindow *window) const
    {}
} // namespace app

M products/BellHybrid/apps/application-bell-main/include/application-bell-main/ApplicationBellMain.hpp => products/BellHybrid/apps/application-bell-main/include/application-bell-main/ApplicationBellMain.hpp +1 -1
@@ 24,7 24,7 @@ namespace app
                                     std::string parent                  = "",
                                     StatusIndicators statusIndicators   = StatusIndicators{},
                                     StartInBackground startInBackground = {false},
                                     std::uint32_t stackDepth            = 8192);
                                     std::uint32_t stackDepth            = 10240);

        sys::ReturnCodes InitHandler() override;


M products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.cpp => products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.cpp +1 -0
@@ 112,6 112,7 @@ namespace gui
                return true;
            }
            else if (not presenter->isNapFinished() && key == KeyMap::Back) {
                presenter->endNap();
                application->returnToPreviousWindow();
                return true;
            }

M products/BellHybrid/apps/include/Application.hpp => products/BellHybrid/apps/include/Application.hpp +1 -0
@@ 25,6 25,7 @@ namespace app
        sys::MessagePointer handleApplicationSwitch(sys::Message *msgl) override;
        sys::MessagePointer handleAppClose(sys::Message *msgl) override;
        sys::MessagePointer handleAppFocusLost(sys::Message *msgl) override;
        void updateStatuses(gui::AppWindow *window) const override;

        virtual void onKeyPressed();
        virtual void onStart();

M products/BellHybrid/services/audio/ServiceAudio.cpp => products/BellHybrid/services/audio/ServiceAudio.cpp +4 -0
@@ 144,6 144,7 @@ namespace service
        };
        auto input = audioMux.GetPlaybackInput(playbackType);
        AudioStart(input);
        manageCpuSentinel();

        return std::make_unique<AudioStartPlaybackResponse>(retCode, retToken);
    }


@@ 182,6 183,7 @@ namespace service
        }
        bus.sendMulticast(std::move(msg), sys::BusChannel::ServiceAudioNotifications);
        audioMux.ResetInput(input);
        manageCpuSentinel();
        return retCode;
    }
    constexpr auto Audio::shouldLoop(const std::optional<audio::PlaybackType> &type) const -> bool


@@ 275,6 277,7 @@ namespace service
                retCode = audio::RetCode::UnsupportedEvent;
            }
        }
        manageCpuSentinel();
        return std::make_unique<AudioResponseMessage>(retCode);
    }
    auto Audio::handleResume() -> std::unique_ptr<AudioResponseMessage>


@@ 284,6 287,7 @@ namespace service
            activeInput && activeInput.value()->audio->GetCurrentOperationState() == audio::Operation::State::Paused) {
            retCode = activeInput.value()->audio->Resume();
        }
        manageCpuSentinel();
        return std::make_unique<AudioResponseMessage>(retCode);
    }
    constexpr auto Audio::isResumable(audio::PlaybackType type) const -> bool

M products/PurePhone/apps/Application.cpp => products/PurePhone/apps/Application.cpp +15 -0
@@ 2,3 2,18 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <Application.hpp>

namespace app
{
    void Application::updateStatuses(gui::AppWindow *window) const
    {
        window->updateBatteryStatus();
        window->updateBluetooth(statusIndicators.bluetoothMode);
        window->updateAlarmClock(statusIndicators.alarmClockStatus);
        window->updateSim();
        window->updateSignalStrength();
        window->updateNetworkAccessTechnology();
        window->updateTime();
        window->updatePhoneMode(statusIndicators.phoneMode);
    }
} // namespace app
\ No newline at end of file

M products/PurePhone/apps/include/Application.hpp => products/PurePhone/apps/include/Application.hpp +3 -0
@@ 9,6 9,9 @@ namespace app
{
    class Application : public ApplicationCommon
    {
      protected:
        void updateStatuses(gui::AppWindow *window) const override;

      public:
        using ApplicationCommon::ApplicationCommon;
    };

M tools/misc => tools/misc +1 -1
@@ 1,1 1,1 @@
Subproject commit 1afa33e5161d507c6ec1a6c94d3dbab54e0de020
Subproject commit 92952d4d0deea267a5f61763d299637b88c8746c