Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions platform_specific/ubuntu/YamlParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ int8_t YamlParameters::__read_page(std::ifstream& params_storage_file, uint16_t*
return LIBPARAMS_WRONG_ARGS;
}

memcpy((void*)(flash.memory_ptr + offset), str_value.c_str(),
strlen(str_value.c_str()));
memcpy((void*)(flash.memory_ptr + offset + strlen(str_value.c_str())), "\0", 1);
size_t len = str_value.size();
memcpy((void*)(flash.memory_ptr + offset), str_value.c_str(), len);
memcpy((void*)(flash.memory_ptr + offset + len), "\0", 1);
*str_param_idx = *str_param_idx + 1;
}
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
import sys
from dataclasses import dataclass
from color_logging import log_warn, log_err
from typing import Union

@dataclass
class BaseParam:
name: str = ""
default: int | str = 0
default: Union[int, str] = 0
note: str = ""
mutability: str = "MUTABLE"
enum_name: str = ""
Expand Down
Loading