mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 03:13:33 +08:00
uorb: fix constness for _uorb_topics_list
_uorb_topics_list was marked as 'const char *' array, which means the data of the array was not actually const and thus landed in the data section (so in RAM instead of FLASH). The size of the array is 436 bytes.
This commit is contained in:
@@ -56,7 +56,7 @@ msgs_count_all = len(msg_names_all)
|
||||
@[end for]
|
||||
|
||||
const size_t _uorb_topics_count = @(msgs_count_all);
|
||||
const struct orb_metadata* _uorb_topics_list[_uorb_topics_count] = {
|
||||
const constexpr struct orb_metadata* const _uorb_topics_list[_uorb_topics_count] = {
|
||||
@[for idx, msg_name in enumerate(msg_names_all, 1)]@
|
||||
ORB_ID(@(msg_name))@[if idx != msgs_count_all],@[end if]
|
||||
@[end for]
|
||||
@@ -67,7 +67,7 @@ size_t orb_topics_count()
|
||||
return _uorb_topics_count;
|
||||
}
|
||||
|
||||
const struct orb_metadata **orb_get_topics()
|
||||
const struct orb_metadata *const*orb_get_topics()
|
||||
{
|
||||
return _uorb_topics_list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user