mirror of https://github.com/openXC7/prjxray.git
lib: xc7series: Fix frame address YAML decoding
Need to manually translate row_half from human-readable form in YAML (top/bottom) to true/false. Requesting a Node as a uint8_t returns the first char in the YAML field rather than parsing the field as an integer. Just used unsigned ints and let the constructor force them to smaller types. Signed-off-by: Rick Altherr <kc8apf@kc8apf.net> Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
This commit is contained in:
parent
6a2fb25013
commit
92509c5043
|
|
@ -66,12 +66,21 @@ bool convert<xc7series::ConfigurationFrameAddress>::decode(
|
|||
!node["column"] ||
|
||||
!node["minor"]) return false;
|
||||
|
||||
bool row_half;
|
||||
if (node["row_half"].as<std::string>() == "top") {
|
||||
row_half = false;
|
||||
} else if (node["row_half"].as<std::string>() == "bottom") {
|
||||
row_half = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
lhs = prjxray::xilinx::xc7series::ConfigurationFrameAddress(
|
||||
node["block_type"].as<xc7series::BlockType>(),
|
||||
node["row_half"].as<bool>(),
|
||||
node["row"].as<uint8_t>(),
|
||||
node["column"].as<uint32_t>(),
|
||||
node["minor"].as<uint32_t>());
|
||||
row_half,
|
||||
node["row"].as<unsigned int>(),
|
||||
node["column"].as<unsigned int>(),
|
||||
node["minor"].as<unsigned int>());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue