Page 1 of 1

Bug: Servo [Resolved]

Posted: Wed Dec 07, 2016 1:14 pm
by medelec35
If target device does not have port B then flowchart containing servo will fail to compile:

Code: Select all

Servo controller.c: myisr()
  1237:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x2; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x2) : (FCP_PORT_B = FCP_PORT_B & ~0x2);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1253:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x4; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x4) : (FCP_PORT_B = FCP_PORT_B & ~0x4);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1269:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x8; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x8) : (FCP_PORT_B = FCP_PORT_B & ~0x8);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1285:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x10; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x10) : (FCP_PORT_B = FCP_PORT_B & ~0x10);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	             (192) undefined identifier "FCP_PORT_B" ^
  1301:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x20; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x20) : (FCP_PORT_B = FCP_PORT_B & ~0x20);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	             (192) undefined identifier "FCP_PORT_B" ^
  1317:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x40; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x40) : (FCP_PORT_B = FCP_PORT_B & ~0x40);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	             (192) undefined identifier "FCP_PORT_B" ^
  1333:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x80; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x80) : (FCP_PORT_B = FCP_PORT_B & ~0x80);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	             (192) undefined identifier "FCP_PORT_B" ^
  1454:	{MX_UINT8 ptmp = (0); FCP_TRIS_B &= ~0x2; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x2) : (FCP_PORT_B = FCP_PORT_B & ~0x2);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1470:	{MX_UINT8 ptmp = (0); FCP_TRIS_B &= ~0x4; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x4) : (FCP_PORT_B = FCP_PORT_B & ~0x4);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1486:	{MX_UINT8 ptmp = (0); FCP_TRIS_B &= ~0x8; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x8) : (FCP_PORT_B = FCP_PORT_B & ~0x8);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
Servo controller.c: 1502: too many errors (21)
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1

Servo connected to port C2

Re: Bug: Servo

Posted: Wed Dec 07, 2016 3:21 pm
by Benj
Hi Martin,

Thanks for letting us know.

It seems the code is still correct in that the unused channels are being placed behind unreachable code. Ideally this would be optimised out but maybe it's not doing so? I need to investigate as this used to be ok, though maybe that was under BoostC?

Code: Select all

            if (1 > 1)
            {
                if (FCV_0dd21_Servo_Controller1__SERVO_IDX == 1)
                {
                    FCP_SET(B, B, 0x2, 0x1, 1);
                }
            } 
Current workaround is set the servo channels to 8 and assign all the pins to viable pins on your microcontroller. Then change the channel back to the actual number of channels you need.

Re: Bug: Servo

Posted: Wed Dec 07, 2016 3:41 pm
by medelec35
Thanks Ben.
UAURT component is the same.
Will not compile unless select Flow control to ON, change port from port B then select Flow Control OFF.

Martin

Re: Bug: Servo

Posted: Wed Dec 07, 2016 3:46 pm
by Benj
I need to investigate as this used to be ok, though maybe that was under BoostC?
Nope I'm wrong, v6 is doing the exact same thing. Hmm. I'll keep looking.

Re: Bug: Servo

Posted: Wed Dec 07, 2016 3:59 pm
by Benj
Right here is the fixed servo component for Flowcode 7.
Servo_Controller.fcpx
(19.02 KiB) Downloaded 191 times
Just looking into the UART problem now.

If you spot any others then please shout.


Edit. I can't seem to replicate the UART issue. Is it with the CAL UART or the UART (RS232) component?

Re: Bug: Servo [Resolved]

Posted: Wed Dec 07, 2016 7:16 pm
by medelec35
Hi Ben,
Fix works a treat....Thanks.
Benj wrote:Edit. I can't seem to replicate the UART issue. Is it with the CAL UART or the UART (RS232) component?
Sorry,
When the comping failed with both UART & Servo, I checked the hidden connections and both of them was showing port B
I just assumed that would cause a compile failure with both components,
So you are correct there is no issue with UART


Martin