params: make param_t uint16_t on NuttX

param_t is only used as an offset and we have <1000 params, so an uint16_t
is enough.
This saves roughly 1KB of RAM. We only do that on NuttX because normal
integers have better performance in general.
Previously on amd64, this was even 64bits because it was an uintptr_t.
This commit is contained in:
Beat Küng
2017-03-14 21:30:53 +01:00
committed by Lorenz Meier
parent 45af77a543
commit b4290b6b52
8 changed files with 39 additions and 12 deletions
+2 -2
View File
@@ -54,8 +54,8 @@ void _assert_parameter_int_value(param_t param, int32_t expected)
{
int32_t value;
int result = param_get(param, &value);
ASSERT_EQ(0, result) << printf("param_get (%lu) did not return parameter\n", param);
ASSERT_EQ(expected, value) << printf("value for param (%lu) doesn't match default value\n", param);
ASSERT_EQ(0, result) << printf("param_get (%i) did not return parameter\n", (int)param);
ASSERT_EQ(expected, value) << printf("value for param (%i) doesn't match default value\n", (int)param);
}
void _set_all_int_parameters_to(int32_t value)