~aleteoryx/muditaos

eeafb5f1be091a34446b842dbde1b7d54cc029a7 — Lefucjusz 3 years ago e3912a6
[MOS-783] Moved battery config file to '/user/data'

Moved battery config file from root
directory of user partition to
'data' directory to comply with
new directory layout design.
M module-apps/application-onboarding/ApplicationOnBoarding.cpp => module-apps/application-onboarding/ApplicationOnBoarding.cpp +1 -1
@@ 143,7 143,7 @@ namespace app
                                  return std::make_unique<app::onBoarding::StartConfigurationWindow>(app);
                              });
        windowsFactory.attach(gui::window::name::onBoarding_eula, [&](ApplicationCommon *app, const std::string &name) {
            const auto eulaDirPath  = purefs::dir::getDataDirPath() / "licenses";
            const auto eulaDirPath  = purefs::dir::getSystemDataDirPath() / "licenses";
            const auto eulaFilename = "eula.txt";
            auto eulaRepository     = std::make_unique<app::onBoarding::EULARepository>(eulaDirPath, eulaFilename);
            auto presenter      = std::make_unique<app::onBoarding::EULALicenseWindowPresenter>([&]() { acceptEULA(); },

M module-audio/Audio/Profiles/ProfilePlaybackHeadphones.hpp => module-audio/Audio/Profiles/ProfilePlaybackHeadphones.hpp +1 -1
@@ 14,7 14,7 @@ namespace audio
            : Profile(
                  "Playback Headphones",
                  Type::PlaybackHeadphones,
                  purefs::dir::getDataDirPath() / "equalizer/headphones_playback.json",
                  purefs::dir::getSystemDataDirPath() / "equalizer/headphones_playback.json",
                  audio::codec::Configuration{
                      .sampleRate_Hz = 0,
                      .bitWidth      = 16,

M module-audio/Audio/Profiles/ProfilePlaybackLoudspeaker.hpp => module-audio/Audio/Profiles/ProfilePlaybackLoudspeaker.hpp +1 -1
@@ 15,7 15,7 @@ namespace audio
            : Profile(
                  "Playback Loudspeaker",
                  Type::PlaybackLoudspeaker,
                  purefs::dir::getDataDirPath() / "equalizer/loudspeaker_playback.json",
                  purefs::dir::getSystemDataDirPath() / "equalizer/loudspeaker_playback.json",
                  audio::codec::Configuration{
                      .sampleRate_Hz     = 0,
                      .bitWidth          = 16,

M module-audio/Audio/Profiles/ProfileRoutingEarspeaker.hpp => module-audio/Audio/Profiles/ProfileRoutingEarspeaker.hpp +1 -1
@@ 14,7 14,7 @@ namespace audio
            : Profile(
                  "Routing Earspeaker",
                  Type::RoutingEarspeaker,
                  purefs::dir::getDataDirPath() / "equalizer/earspeaker_routing.json",
                  purefs::dir::getSystemDataDirPath() / "equalizer/earspeaker_routing.json",
                  audio::codec::Configuration{
                      .sampleRate_Hz = 16000,
                      .bitWidth      = 16,

M module-audio/Audio/Profiles/ProfileRoutingHeadphones.hpp => module-audio/Audio/Profiles/ProfileRoutingHeadphones.hpp +1 -1
@@ 14,7 14,7 @@ namespace audio
            : Profile(
                  "Routing Headset",
                  Type::RoutingHeadphones,
                  purefs::dir::getDataDirPath() / "equalizer/headphones_routing.json",
                  purefs::dir::getSystemDataDirPath() / "equalizer/headphones_routing.json",
                  audio::codec::Configuration{
                      .sampleRate_Hz = 16000,
                      .bitWidth      = 16,

M module-audio/Audio/Profiles/ProfileRoutingLoudspeaker.hpp => module-audio/Audio/Profiles/ProfileRoutingLoudspeaker.hpp +1 -1
@@ 15,7 15,7 @@ namespace audio
        ProfileRoutingLoudspeaker(Volume volume, Gain gain)
            : Profile("Routing Speakerphone",
                      Type::RoutingLoudspeaker,
                      purefs::dir::getDataDirPath() / "equalizer/loudspeaker_routing.json",
                      purefs::dir::getSystemDataDirPath() / "equalizer/loudspeaker_routing.json",
                      audio::codec::Configuration{
                          .sampleRate_Hz = sampleRate,
                          .bitWidth      = 16,

M module-bsp/board/rt1051/puretx/bsp/battery_charger/battery_charger.cpp => module-bsp/board/rt1051/puretx/bsp/battery_charger/battery_charger.cpp +5 -5
@@ 28,7 28,7 @@ namespace bsp::battery_charger

        constexpr std::uint32_t i2cSubaddresSize = 1;

        const auto cfgFile = purefs::dir::getUserDiskPath() / "batteryFuelGaugeConfig.cfg";
        const auto cfgFile = purefs::dir::getUserDataDirPath() / "batteryFuelGaugeConfig.cfg";

        constexpr auto registersToStore              = 0xFF + 1;
        constexpr auto configFileSizeWithoutChecksum = registersToStore * sizeof(Register);


@@ 158,7 158,7 @@ namespace bsp::battery_charger
        drivers::I2CAddress batteryChargerAddress = {BATTERY_CHARGER_I2C_ADDR, 0, i2cSubaddresSize};
        drivers::I2CAddress topControllerAddress  = {TOP_CONTROLLER_I2C_ADDR, 0, i2cSubaddresSize};

        void addChecksumToConfigFile(std::filesystem::path cfgFile)
        void addChecksumToConfigFile()
        {
            std::fstream file(cfgFile.c_str(), std::ios::binary | std::ios::in | std::ios::out);
            if (!file.is_open()) {


@@ 176,7 176,7 @@ namespace bsp::battery_charger
            file.close();
        }

        bool isCorrectChecksumFromConfigFile(std::filesystem::path cfgFile)
        bool isCorrectChecksumFromConfigFile()
        {
            bool ret = false;
            std::ifstream file(cfgFile.c_str(), std::ios::binary | std::ios::in);


@@ 418,7 418,7 @@ namespace bsp::battery_charger
                savedData[i] = regVal.second;
            }
            file.close();
            addChecksumToConfigFile(cfgFile.c_str());
            addChecksumToConfigFile();
            return fileConfigRetval::OK;
        }



@@ 458,7 458,7 @@ namespace bsp::battery_charger
                readData[i] = regVal;
            }
            file.close();
            if (!isCorrectChecksumFromConfigFile(cfgFile.c_str())) {
            if (!isCorrectChecksumFromConfigFile()) {
                return fileConfigRetval::FileCrcError;
            }
            return fileConfigRetval::OK;

M module-utils/i18n/i18nImpl.hpp => module-utils/i18n/i18nImpl.hpp +2 -2
@@ 27,8 27,8 @@ namespace utils
        Language inputLanguage        = fallbackLanguageName;
        Language inputLanguageFilename;
        Language currentDisplayLanguage;
        std::filesystem::path InputLanguageDirPath   = purefs::dir::getDataDirPath() / "profiles";
        std::filesystem::path DisplayLanguageDirPath = purefs::dir::getDataDirPath() / "lang";
        std::filesystem::path InputLanguageDirPath   = purefs::dir::getSystemDataDirPath() / "profiles";
        std::filesystem::path DisplayLanguageDirPath = purefs::dir::getSystemDataDirPath() / "lang";
        cpp_freertos::MutexStandard mutex;
        std::vector<LanguageMetadata> metadata;


M module-vfs/paths/filesystem_paths.cpp => module-vfs/paths/filesystem_paths.cpp +6 -1
@@ 96,9 96,14 @@ namespace purefs
            return getSystemDiskPath() / PATH_ASSETS;
        }

        std::filesystem::path getDataDirPath() noexcept
        std::filesystem::path getSystemDataDirPath() noexcept
        {
            return getSystemDiskPath() / PATH_DATA;
        }

        std::filesystem::path getUserDataDirPath() noexcept
        {
            return getUserDiskPath() / PATH_DATA;
        }
    } // namespace dir
} // namespace purefs

M module-vfs/paths/include/purefs/filesystem_paths.hpp => module-vfs/paths/include/purefs/filesystem_paths.hpp +2 -1
@@ 24,7 24,8 @@ namespace purefs
        std::filesystem::path getBackupOSPath() noexcept;
        std::filesystem::path getBootJSONPath() noexcept;
        std::filesystem::path getAssetsDirPath() noexcept;
        std::filesystem::path getDataDirPath() noexcept;
        std::filesystem::path getSystemDataDirPath() noexcept;
        std::filesystem::path getUserDataDirPath() noexcept;
    } // namespace dir

    namespace file