feat/1030-more-unit-tests #29
@@ -1268,8 +1268,11 @@ static uint32_t relay_chn_tilt_count_update(relay_chn_t *relay_chn)
|
||||
return ++relay_chn->tilt_control.tilt_counter.tilt_forward_count;
|
||||
}
|
||||
else if (relay_chn->tilt_control.cmd == RELAY_CHN_TILT_CMD_REVERSE) {
|
||||
if (relay_chn->tilt_control.tilt_counter.tilt_forward_count > 0)
|
||||
return --relay_chn->tilt_control.tilt_counter.tilt_forward_count;
|
||||
if (relay_chn->tilt_control.tilt_counter.tilt_forward_count > 0) {
|
||||
--relay_chn->tilt_control.tilt_counter.tilt_forward_count;
|
||||
// Still should do one more move, return non-zero value
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
@@ -1283,8 +1286,11 @@ static uint32_t relay_chn_tilt_count_update(relay_chn_t *relay_chn)
|
||||
return ++relay_chn->tilt_control.tilt_counter.tilt_reverse_count;
|
||||
}
|
||||
else if (relay_chn->tilt_control.cmd == RELAY_CHN_TILT_CMD_FORWARD) {
|
||||
if (relay_chn->tilt_control.tilt_counter.tilt_reverse_count > 0)
|
||||
return --relay_chn->tilt_control.tilt_counter.tilt_reverse_count;
|
||||
if (relay_chn->tilt_control.tilt_counter.tilt_reverse_count > 0) {
|
||||
--relay_chn->tilt_control.tilt_counter.tilt_reverse_count;
|
||||
// Still should do one more move, return non-zero value
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user