with the help of apnt195, i had modified the STM32 usb hid application program.
during compilation, it showing the following error
demo.c(33): error: #147: declaration is incompatible with "BYTE OutReport" (declared at line 20 of "demo.h") demo.c(56): warning: #167-D: argument of type "BYTE *" is incompatible with parameter of type "char *" demo.c(58): warning: #167-D: argument of type "BYTE *" is incompatible with parameter of type "char *"
Note that char may be signed or unsigned.
BYTE sounds very much like an unsigned data type.
Have you checked into making char unsigned?
By the way - why so very short subject for your thread? How much information is there in "error"? Why not "Error 147 while compiling USB sample code" or something similar?
Next thing - was this the application note? www.onarm.com/.../apnt195.asp
In that case - why not supply that information in the post?
hi,
thank u for reply.
i made the correction. it is compiling now. now i got one more problem.
in the vc++ client program, after making the changes, during compilation it is giving the following error. using projectconverter i had modified the client program to vc++ 6.0
:\Documents and Settings\Administrator\Desktop\HID_Client\HID.cpp(291) : error C2065: 'localTime' : undeclared identifier C:\Documents and Settings\Administrator\Desktop\HID_Client\HID.cpp(291) : error C2100: illegal indirection
even though i had added #include "time.h" in hid.cpp.
expecting your kind reply.
with regards
S.Venugopal
'localTime'?
Dear sir,
i want to send multiple byte(ex. 8/16/32 bytes) from STM32 development kit to PC application through USB.
for that i'm using USBHID on STM32 development side and HID_Client program on VC++ side.
pls suggest me what are the necessity chages i have to make on both host and client side. also i'm bit confused about USAGE_MIN and Usage_Max.
pls suggest me any sample examples.
i made the following changes, code compiled with error. in this device not detected. **************************************************** in Hiduser.c
BOOL HID_GetReport (void) {
/* ReportID = SetupPacket.wValue.WB.L; */ switch (SetupPacket.wValue.WB.H) { case HID_REPORT_INPUT: GetInReport(); EP0Buf[0] = InReport[0]; EP0Buf[1] = InReport[1]; break; case HID_REPORT_OUTPUT: return (FALSE); /* Not Supported */ case HID_REPORT_FEATURE: /* EP0Buf[] = ...; */ /* break; */ return (FALSE); /* Not Supported */ } return (TRUE); } **************************************************** #if USB_CONFIGURE_EVENT void USB_Configure_Event (void) {
if (USB_Configuration) { /* Check if USB is configured */ GetInReport(); USB_WriteEP(0x81, &InReport[0], sizeof(InReport)); } } **************************************************** in demo.c void GetInReport (void) { int x = 0, y= 0; x = ADC_ConvertedValue; InReport[1] = x & 0xff; InReport[0] = (ADC_ConvertedValue >> 0x08); **************************************************** In client side program
void CHIDClientDlg::OnInput() { // int n; int x,y; char buf[16];
x = InReport[0]; x = (x << 8); y = InReport[1]; x = x | y ;
// if (InValue == InReport[1]) return;
// if (z == x) return; // z = x; // InValue = InReport[1];
// for (n = 0; n < 8; n++) { // m_Input[n].SetCheck((InValue & (1 << n)) ? 1 : 0); // } // sprintf(buf, "%04d", InValue); sprintf(buf, "%05x",x);
m_In.SetWindowText(buf); }
in the previous post, i typed it has "with error".
sorry it is "without error"