mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-13 20:30:34 +08:00
UAVCAN: Configurable LED Light Control with Flexible Addressing (#26253)
* feat: implement UAVCAN LED control for individual light control and assignment * uavcan led: nit-picks from review * uavcan led: reduce maximum number of lights to avoid unused parameters * uavcan led: simplify anticolision on check * uavcan led: correctly map 8-bit RGB to rgb565 * Trim param name character arrays to 17 16 characters + \0 termination * uavcan led: final nit-picks --------- Co-authored-by: Matthias Grob <maetugr@gmail.com>
This commit is contained in:
@@ -107,7 +107,7 @@ uint8_t Modes::addExternalMode(const Modes::Mode &mode)
|
||||
int matching_idx = -1;
|
||||
|
||||
for (int i = 0; i < MAX_NUM; ++i) {
|
||||
char hash_param_name[20];
|
||||
char hash_param_name[17];
|
||||
snprintf(hash_param_name, sizeof(hash_param_name), "COM_MODE%d_HASH", i);
|
||||
const param_t handle = param_find(hash_param_name);
|
||||
int32_t current_hash{};
|
||||
@@ -164,7 +164,7 @@ uint8_t Modes::addExternalMode(const Modes::Mode &mode)
|
||||
|
||||
if (new_mode_idx != -1 && !_modes[new_mode_idx].valid) {
|
||||
if (need_to_update_param) {
|
||||
char hash_param_name[20];
|
||||
char hash_param_name[17];
|
||||
snprintf(hash_param_name, sizeof(hash_param_name), "COM_MODE%d_HASH", new_mode_idx);
|
||||
const param_t handle = param_find(hash_param_name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user