~aleteoryx/muditaos

0aa094875de1e4b3ee9fff441a1a783ebc8de961 — Dawid Wojtas 1 year, 11 months ago 752147e
[BH-1885] Increase stack size for battery charger task

The battery charger worker had only ~10% free
stack size so it was a possibility to stack overflow.
After increasing the stack by 512 bytes the worker
has ~40% free stack space.
M harmony_changelog.md => harmony_changelog.md +1 -0
@@ 13,6 13,7 @@

### Changed / Improved
* Updated FSL drivers from NXP
* Increased battery charger stack size

## [2.5.0 2024-02-09]


M module-bsp/board/rt1051/bellpx/hal/battery_charger/BatteryCharger.cpp => module-bsp/board/rt1051/bellpx/hal/battery_charger/BatteryCharger.cpp +3 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "BatteryChargerIRQ.hpp"


@@ 97,6 97,7 @@ namespace hal::battery
        xTimerHandle reinit_timer;
        xQueueHandle notification_channel;
        inline static std::unique_ptr<BatteryWorkerQueue> worker_queue;
        static constexpr auto workerStackSize = 1024 + 512;

        std::shared_ptr<drivers::DriverI2C> i2c;
        std::shared_ptr<drivers::DriverGPIO> charger_gpio_chgok;


@@ 132,7 133,7 @@ namespace hal::battery
        });

        worker_queue = std::make_unique<BatteryWorkerQueue>(
            "battery_charger", [this](const auto &msg) { handleIrqEvents(msg); }, 1024);
            "battery_charger", [this](const auto &msg) { handleIrqEvents(msg); }, workerStackSize);

        pollFuelGauge();


M module-bsp/bsp/battery_charger/battery_charger.hpp => module-bsp/bsp/battery_charger/battery_charger.hpp +7 -2
@@ 1,6 1,11 @@
// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

namespace bsp::battery_charger {
namespace bsp::battery_charger
{
    int getAvgCurrent();
    int getCurrentMeasurement();
}
} // namespace bsp::battery_charger