Add uint32 support to the MODE_ARRAY CLI parameter type (#8556)
Add uint32 support to the MODE_ARRAY CLI parameter type
This commit is contained in:
commit
7a84a5cf73
|
@ -485,6 +485,11 @@ static void printValuePointer(const clivalue_t *var, const void *valuePointer, b
|
|||
// int16_t array
|
||||
cliPrintf("%d", ((int16_t *)valuePointer)[i]);
|
||||
break;
|
||||
|
||||
case VAR_UINT32:
|
||||
// uin32_t array
|
||||
cliPrintf("%u", ((uint32_t *)valuePointer)[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < var->config.array.length - 1) {
|
||||
|
@ -4324,6 +4329,15 @@ STATIC_UNIT_TESTED void cliSet(char *cmdline)
|
|||
*data = (int16_t)atoi((const char*) valPtr);
|
||||
}
|
||||
|
||||
break;
|
||||
case VAR_UINT32:
|
||||
{
|
||||
// fetch data pointer
|
||||
uint32_t *data = (uint32_t *)cliGetValuePointer(val) + i;
|
||||
// store value
|
||||
*data = (uint32_t)strtoul((const char*) valPtr, NULL, 10);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue