mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 09:08:30 -04:00
HAL_AVR: fixed int types -> uint8_t
This commit is contained in:
parent
b1856bc17e
commit
d9f69923f2
@ -102,13 +102,13 @@ uint8_t APM1RCInput::read(uint16_t* periods, uint8_t len) {
|
|||||||
if (len > AVR_RC_INPUT_NUM_CHANNELS) { len = AVR_RC_INPUT_NUM_CHANNELS; }
|
if (len > AVR_RC_INPUT_NUM_CHANNELS) { len = AVR_RC_INPUT_NUM_CHANNELS; }
|
||||||
/* grab channels from isr's memory in critical section */
|
/* grab channels from isr's memory in critical section */
|
||||||
cli();
|
cli();
|
||||||
for (int i = 0; i < len; i++) {
|
for (uint8_t i = 0; i < len; i++) {
|
||||||
periods[i] = _pulse_capt[i];
|
periods[i] = _pulse_capt[i];
|
||||||
}
|
}
|
||||||
sei();
|
sei();
|
||||||
/* Outside of critical section, do the math (in place) to scale and
|
/* Outside of critical section, do the math (in place) to scale and
|
||||||
* constrain the pulse. */
|
* constrain the pulse. */
|
||||||
for (int i = 0; i < len; i++) {
|
for (uint8_t i = 0; i < len; i++) {
|
||||||
/* scale _pulse_capt from 0.5us units to 1us units. */
|
/* scale _pulse_capt from 0.5us units to 1us units. */
|
||||||
periods[i] = constrain_pulse(periods[i] >> 1);
|
periods[i] = constrain_pulse(periods[i] >> 1);
|
||||||
/* check for override */
|
/* check for override */
|
||||||
@ -123,7 +123,7 @@ uint8_t APM1RCInput::read(uint16_t* periods, uint8_t len) {
|
|||||||
|
|
||||||
bool APM1RCInput::set_overrides(int16_t *overrides, uint8_t len) {
|
bool APM1RCInput::set_overrides(int16_t *overrides, uint8_t len) {
|
||||||
bool res = false;
|
bool res = false;
|
||||||
for (int i = 0; i < len; i++) {
|
for (uint8_t i = 0; i < len; i++) {
|
||||||
res |= set_override(i, overrides[i]);
|
res |= set_override(i, overrides[i]);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
@ -142,7 +142,7 @@ bool APM1RCInput::set_override(uint8_t channel, int16_t override) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void APM1RCInput::clear_overrides() {
|
void APM1RCInput::clear_overrides() {
|
||||||
for (int i = 0; i < AVR_RC_INPUT_NUM_CHANNELS; i++) {
|
for (uint8_t i = 0; i < AVR_RC_INPUT_NUM_CHANNELS; i++) {
|
||||||
_override[i] = 0;
|
_override[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user