USBHost_MSCApplication Purpose ARM MikroC

General discussion on Libstock website & codes posted on this website.
Post Reply
Author
Message
sturoy71
Posts: 7
Joined: 05 Mar 2014 12:08

USBHost_MSCApplication Purpose ARM MikroC

#1 Post by sturoy71 » 10 Sep 2014 09:02

I am trying to find documentation on the following function you are meant to implement when using the USB_Host_MSC library:

extern uint8_t USBHost_MSCApplication();


Now my guess is that you totally pass control of your application virtually entirely to the USBHost_Main() function by calling it repeatedly in the main control loop. And whatever you would have had in your main control loop you must now put in this function.

Am I right by this assumption. Or is it that only USB related functions need to be called from this function?

Is it called all the time or just when you have a valid device in the drive?

Or can I call the Read Write Functions from outside this function?

What is its exact purpose?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: USBHost_MSCApplication Purpose ARM MikroC

#2 Post by filip » 07 Oct 2014 09:24

Hi,

In this function you should put routines which will handle the operation with the MSC device, i.e. what the user wants to do with the MSC device. the default example lists the folder on the USB stick.


Regards,
Filip.

sturoy71
Posts: 7
Joined: 05 Mar 2014 12:08

Re: USBHost_MSCApplication Purpose ARM MikroC

#3 Post by sturoy71 » 04 Feb 2015 13:07

So is it true that I cant read/write sectors outside this function?

My code calls USB_Main repeatedly and sets up the interrupt as in the example. Other than that I would like to write an API that accesses the disk on sector by sector basis.

Are you saying I need to write some code to request a sector read or write only and have a USBHost_MSCApplication do the required work?

When is USBHost_MSCApplication called? Is it called repeatedly? Is it only called when a MSC device is present and when its ready to accept commands?

hooper
Posts: 143
Joined: 23 Oct 2009 08:51

Re: USBHost_MSCApplication Purpose ARM MikroC

#4 Post by hooper » 27 Feb 2015 14:22

Any response from ME to sturoy71 last question?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: USBHost_MSCApplication Purpose ARM MikroC

#5 Post by filip » 02 Mar 2015 16:46

Hi,

I believe I have answered you here :
http://www.mikroe.com/forum/viewtopic.p ... 29#p253329

Regards,
Filip.

Post Reply

Return to “Libstock Discussion”