USB Slave examples
Posted: Sat May 13, 2017 8:21 pm
Hi. Keep in mind, I'm a complete newbie to all of this.. I'm trying to do my first code example with the IDE using the USB Slave Component. I've tried using both examples from this page:
https://www.matrixtsl.com/wikiv7/index. ... 425b14462f
Neither example on the page will compile without numerous errors. I haven't altered the examples other than changing the target chip. Am I doing something wrong?
Employing 18F2550 errata work-arounds:
* Corrupted fast interrupt shadow registers
USB_Slave.c:
368: DATA_PACKET INPacket;
^ (374) missing basic type; int assumed (warning)
^ (372) "," expected
369: DATA_PACKET OUTPacket;
^ (374) missing basic type; int assumed (warning)
^ (372) "," expected
USB_Slave.c: IsTxBusy()
440: return (bd1in.stat & (1 << UOWN));
^ (192) undefined identifier "bd1in"
^ (196) struct/union required
^ (192) undefined identifier "UOWN"
USB_Slave.c: FCD_07281_USB_Slave__SendString()
944: INPacket._byte[FCL_IDX] = FCL_DATA[FCL_IDX];
^ (196) struct/union required
(981) pointer required ^
(981) pointer required ^
962: USBGenericInHandle = USBTransferOnePacket(1,1,(BYTE*)&INPacket,FCL_LENGTH);
(192) undefined identifier "BYTE" ^
(195) expression syntax ^
(187) too few function arguments ^
(194) ")" expected ^
(195) expression syntax ^
USB_Slave.c: FCD_07281_USB_Slave__GetString()
993: FCR_RETVAL[FCL_IDX] = OUTPacket._byte[FCL_IDX];
(196) struct/union required ^
(981) pointer required ^
(981) pointer required ^
USB_Slave.c: FCD_07281_USB_Slave__RunSlaveService()
1040: FCM_slave_service(OUTPacket._byte[0]);
(196) struct/union required ^
(981) pointer required ^
(981) pointer required ^
1140: USBGenericInHandle = USBTransferOnePacket(1,1,(BYTE*)&OUTPacket,1);
(192) undefined identifier "BYTE" ^
USB_Slave.c: 1140: too many errors (21)
Thanks!
https://www.matrixtsl.com/wikiv7/index. ... 425b14462f
Neither example on the page will compile without numerous errors. I haven't altered the examples other than changing the target chip. Am I doing something wrong?
Employing 18F2550 errata work-arounds:
* Corrupted fast interrupt shadow registers
USB_Slave.c:
368: DATA_PACKET INPacket;
^ (374) missing basic type; int assumed (warning)
^ (372) "," expected
369: DATA_PACKET OUTPacket;
^ (374) missing basic type; int assumed (warning)
^ (372) "," expected
USB_Slave.c: IsTxBusy()
440: return (bd1in.stat & (1 << UOWN));
^ (192) undefined identifier "bd1in"
^ (196) struct/union required
^ (192) undefined identifier "UOWN"
USB_Slave.c: FCD_07281_USB_Slave__SendString()
944: INPacket._byte[FCL_IDX] = FCL_DATA[FCL_IDX];
^ (196) struct/union required
(981) pointer required ^
(981) pointer required ^
962: USBGenericInHandle = USBTransferOnePacket(1,1,(BYTE*)&INPacket,FCL_LENGTH);
(192) undefined identifier "BYTE" ^
(195) expression syntax ^
(187) too few function arguments ^
(194) ")" expected ^
(195) expression syntax ^
USB_Slave.c: FCD_07281_USB_Slave__GetString()
993: FCR_RETVAL[FCL_IDX] = OUTPacket._byte[FCL_IDX];
(196) struct/union required ^
(981) pointer required ^
(981) pointer required ^
USB_Slave.c: FCD_07281_USB_Slave__RunSlaveService()
1040: FCM_slave_service(OUTPacket._byte[0]);
(196) struct/union required ^
(981) pointer required ^
(981) pointer required ^
1140: USBGenericInHandle = USBTransferOnePacket(1,1,(BYTE*)&OUTPacket,1);
(192) undefined identifier "BYTE" ^
USB_Slave.c: 1140: too many errors (21)
Thanks!