diff --git a/src/drivers/linux_pwm_out/linux_pwm_out.cpp b/src/drivers/linux_pwm_out/linux_pwm_out.cpp index 245c5fc0f2..7e8eb424d9 100644 --- a/src/drivers/linux_pwm_out/linux_pwm_out.cpp +++ b/src/drivers/linux_pwm_out/linux_pwm_out.cpp @@ -285,7 +285,7 @@ void task_main(int argc, char *argv[]) _controls[0].control[2] = 0.f; int channel = rc_channels.function[rc_channels_s::RC_CHANNELS_FUNCTION_THROTTLE]; - if (ret == 0 && channel >= 0 && channel < sizeof(rc_channels.channels) / sizeof(rc_channels.channels[0])) { + if (ret == 0 && channel >= 0 && channel < (int)(sizeof(rc_channels.channels) / sizeof(rc_channels.channels[0]))) { _controls[0].control[3] = rc_channels.channels[channel]; } else { @@ -347,7 +347,7 @@ void task_main(int argc, char *argv[]) pwm_value = _pwm_min; } - for (int i = 0; i < _outputs.noutputs; ++i) { + for (uint32_t i = 0; i < _outputs.noutputs; ++i) { pwm[i] = pwm_value; } diff --git a/src/drivers/linux_pwm_out/navio_sysfs.cpp b/src/drivers/linux_pwm_out/navio_sysfs.cpp index 8ebcc9f111..4b5c992cc8 100644 --- a/src/drivers/linux_pwm_out/navio_sysfs.cpp +++ b/src/drivers/linux_pwm_out/navio_sysfs.cpp @@ -116,7 +116,7 @@ int NavioSysfsPWMOut::send_output_pwm(const uint16_t *pwm, int num_outputs) int ret = 0; //convert this to duty_cycle in ns - for (unsigned i = 0; i < num_outputs; ++i) { + for (int i = 0; i < num_outputs; ++i) { int n = ::snprintf(data, sizeof(data), "%u", pwm[i] * 1000); int write_ret = ::write(_pwm_fd[i], data, n);