- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I use LoadInEP() to set the send data to the in-endpoint as shown below.
if(USBFS_GetEPState(IN_EP) == USBFS_IN_BUFFER_EMPTY)
{
USBFS_LoadInEP(IN_EP, tramsmit_data, 64);
}
I want to set another data, but I can't set it unless the host reads it.
If the host doesn't read for a period of time, I want to erase the previous data, what should I do ?
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Yes, you need to call the USBFS_ConfigReg() function before initializing the particular endpoint.
What I meant was you could implement you own function in which you could first call the USBFS_ConfigReg() function, followed by initializing the particular endpoint. This would prevent you from initializing other endpoints and clearing their data as well.
In your case there if there is no issue with changing the endpoint state of other endpoints you can go ahead and use the USBFS_RestoreConfig function directly.
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have confirmed that the previous data can be erased by restoring using the following function before starting the next data transmission.
USBFS_RestoreConfig();
Is there anything wrong with this usage ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Using the USBFS_RestoreConfig function will affect the state of all endpoints.
The USBFS_RestoreConfig function in turn calls the USBFS_EpStateInit(), which is implemented as:
for (i = USBFS_EP1; i < USBFS_MAX_EP; i++)
{
if (0u != (USBFS_EP.addr & USBFS_DIR_IN))
{
/* IN Endpoint */
USBFS_EP.apiEpState = USBFS_EVENT_PENDING;
}
else
{
/* OUT Endpoint */
USBFS_EP.apiEpState = USBFS_NO_EVENT_PENDING;
}
}
Instead of initializing all the endpoints to clear the data you can simply implement something like:
USBFS_EP
where x the EP number of the IN endpoint that you want to clear.
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Ekta,
Thank you for your answer.
It was not possible to erase the already set data with only the following functions.
USBFS_EP
I think the following functions that USBFS_RestoreConfig() function calls are important.
USBFS_ConfigReg();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Yes, you need to call the USBFS_ConfigReg() function before initializing the particular endpoint.
What I meant was you could implement you own function in which you could first call the USBFS_ConfigReg() function, followed by initializing the particular endpoint. This would prevent you from initializing other endpoints and clearing their data as well.
In your case there if there is no issue with changing the endpoint state of other endpoints you can go ahead and use the USBFS_RestoreConfig function directly.
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Ekta,
Thank you for your cooporation.
If it doesn't affect other endpoints, I understand that I can use the USBFS_RestoreConfig function.
I decided to use USBFS_RestoreConfig function.