mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 06:43:33 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user