cfg: Load and save MCU config as binary file. (#7200)
This commit is contained in:
parent
5733c8681e
commit
33a1f27a99
1 changed files with 2 additions and 2 deletions
|
@ -577,7 +577,7 @@ ResultCode Module::LoadConfigNANDSaveFile() {
|
||||||
|
|
||||||
void Module::LoadMCUConfig() {
|
void Module::LoadMCUConfig() {
|
||||||
FileUtil::IOFile mcu_data_file(
|
FileUtil::IOFile mcu_data_file(
|
||||||
fmt::format("{}/mcu.dat", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)), "r");
|
fmt::format("{}/mcu.dat", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)), "rb");
|
||||||
|
|
||||||
if (mcu_data_file.IsOpen() && mcu_data_file.GetSize() >= sizeof(MCUData) &&
|
if (mcu_data_file.IsOpen() && mcu_data_file.GetSize() >= sizeof(MCUData) &&
|
||||||
mcu_data_file.ReadBytes(&mcu_data, sizeof(MCUData)) == sizeof(MCUData)) {
|
mcu_data_file.ReadBytes(&mcu_data, sizeof(MCUData)) == sizeof(MCUData)) {
|
||||||
|
@ -592,7 +592,7 @@ void Module::LoadMCUConfig() {
|
||||||
|
|
||||||
void Module::SaveMCUConfig() {
|
void Module::SaveMCUConfig() {
|
||||||
FileUtil::IOFile mcu_data_file(
|
FileUtil::IOFile mcu_data_file(
|
||||||
fmt::format("{}/mcu.dat", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)), "w");
|
fmt::format("{}/mcu.dat", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)), "wb");
|
||||||
|
|
||||||
if (mcu_data_file.IsOpen()) {
|
if (mcu_data_file.IsOpen()) {
|
||||||
mcu_data_file.WriteBytes(&mcu_data, sizeof(MCUData));
|
mcu_data_file.WriteBytes(&mcu_data, sizeof(MCUData));
|
||||||
|
|
Loading…
Reference in a new issue