Fix for issue #144 : Always turn power back on to RC servo port if S2 command is sent to RB1.

pull/146/head
EmbeddedMan 2020-11-10 21:09:15 -06:00
rodzic be5bfa71d5
commit 6936784223
2 zmienionych plików z 73 dodań i 62 usunięć

Wyświetl plik

@ -348,7 +348,7 @@ UINT8 RCServo2_Move(
// If we have a valid channel, and RPn, then make the move
if ((Channel - 1) < gRC2Slots && RPn <= 24)
{
// As a speical case, if the pin is the same as the pin
// As a special case, if the pin is the same as the pin
// used for the solenoid, then turn off the solenoid function
// so that we can output PWM on that pin
if (RPn == PEN_UP_DOWN_RPN)
@ -373,6 +373,15 @@ UINT8 RCServo2_Move(
while(!FIFOEmpty)
;
// If the pin we're controlling is B1 (the normal servo output) then
// always make sure to turn power on and start the countdown timer
// for that servo port. (issue #144)
if (RPn == 4)
{
RCServoPowerIO = RCSERVO_POWER_ON;
gRCServoPoweroffCounterMS = gRCServoPoweroffCounterReloadMS;
}
// Now copy the values over into the FIFO element
CommandFIFO[0].Command = COMMAND_SERVO_MOVE;
CommandFIFO[0].DelayCounter = HIGH_ISR_TICKS_PER_MS * (UINT32)Delay;

Wyświetl plik

@ -238,6 +238,8 @@
// input parameters)
// 2.6.5 11/29/19 - Changed SR command behavior so it only enables servo power
// after SP command, not also after stepper movement
// 2.6.6 11/10/20 - Fixed bug where S2 command wouldn't turn power on to RB1
// servo output if it had been turned off.
#include <p18cxxx.h>
#include <usart.h>