Added 64-bit types to reg_write.

This commit is contained in:
Florian Pose 2009-04-09 14:56:23 +00:00
parent de1a332eee
commit ba958f3628
1 changed files with 8 additions and 0 deletions

View File

@ -146,6 +146,10 @@ void CommandRegWrite::execute(MasterDevice &m, const StringVector &args)
int32_t val;
strValue >> val;
*(int32_t *) data.data = cpu_to_le32(val);
} else if (dataType->name == "int64") {
int64_t val;
strValue >> val;
*(int64_t *) data.data = cpu_to_le64(val);
} else if (dataType->name == "uint8") {
uint16_t val; // uint8_t is interpreted as char
strValue >> val;
@ -160,6 +164,10 @@ void CommandRegWrite::execute(MasterDevice &m, const StringVector &args)
uint32_t val;
strValue >> val;
*(uint32_t *) data.data = cpu_to_le32(val);
} else if (dataType->name == "uint64") {
uint64_t val;
strValue >> val;
*(uint64_t *) data.data = cpu_to_le64(val);
} else if (dataType->name == "string" ||
dataType->name == "octet_string") {
data.length = strValue.str().size();