Use defines instead of hardcoded magic values for maximum number of output channels and rpm filter time constant

This commit is contained in:
Matthias Grob
2024-12-12 13:30:21 +01:00
parent 8ce6ad6662
commit b85ad98a98
5 changed files with 7 additions and 5 deletions
@@ -32,6 +32,7 @@
****************************************************************************/
#include "camera_interface.h"
#include <drivers/drv_pwm_output.h>
#include <px4_platform_common/log.h>
#include <board_config.h>
@@ -44,7 +45,7 @@ void CameraInterface::get_pins()
unsigned pin_index = 0;
for (unsigned i = 0; i < 16 && pin_index < arraySize(_pins); ++i) {
for (unsigned i = 0; i < PWM_OUTPUT_MAX_CHANNELS && pin_index < arraySize(_pins); ++i) {
char param_name[17];
snprintf(param_name, sizeof(param_name), "%s_%s%d", PARAM_PREFIX, "FUNC", i + 1);
param_t function_handle = param_find(param_name);