• AVR Freaks

SYS_FS_MOUNT with AUTOMOUNT

Author
karan123
Super Member
  • Total Posts : 791
  • Reward points : 0
  • Joined: 2009/02/02 11:11:21
  • Location: 0
  • Status: offline
2019/05/13 00:16:02 (permalink)
0

SYS_FS_MOUNT with AUTOMOUNT

Hello,
 
I am trying to modify sdcard_msd_fat_multi_disk demo Microchip V2_06.
After opening MHC in this demo Both USB MSD and SDCard uses AutoMount Feature .
Below is APP_USB_MSDTasks  ( void )

 
void APP_USB_MSDTasks (void)
{
SYS_FS_RESULT result = SYS_FS_RES_FAILURE;
/* The application task state machine */
 
switch(appDataMsd.state)
{
case APP_STATE_BUS_ENABLE:
PrintString("APP_STATE_BUS_ENABLE\r\n") ;
/* Set the event handler and enable the bus */
SYS_FS_EventHandlerSet(APP_SYSFSEventHandler, (uintptr_t)NULL);
USB_HOST_EventHandlerSet(APP_USBHostEventHandler, 0);
USB_HOST_BusEnable(0);
appDataMsd.state = APP_STATE_WAIT_FOR_BUS_ENABLE_COMPLETE;
break;
 
.
 
.
 
.
 

Below is APP_SDCardTasks ( void )

 
void APP_SDCardTasks ( void )
{
SYS_FS_RESULT result = SYS_FS_RES_FAILURE;
/* The application task state machine */
switch(appDataSd.state)
{
case APP_OPEN_FIRST_FILE:
/* Wait until MSD is mounted and file search is sucessful */
if((appDataMsd.state == APP_STATE_IDLE) && appDataSd.deviceIsConnected)
{
SYS_FS_CurrentDriveSet("/mnt/msdDrive");
/* open the file found on MSD in Read mode */
appDataMsd.fileHandle = SYS_FS_FileOpen(appDataMsd.dirStatus.fname,
(SYS_FS_FILE_OPEN_READ));
BSP_LEDOff(BSP_LED_3);
if(appDataMsd.fileHandle != SYS_FS_HANDLE_INVALID)
{
/* Could not open the file. Error out*/
appDataSd.state = APP_OPEN_SECOND_FILE;
break;
}
/* Open a File on SD Card */
appDataSd.state = APP_ERROR;
}
break;
 

I have to create APP_SDCard_2Tasks ( New Task Only for SDCard) with above two tasks in which only SDCard is used without USB .
I have tried with as below but not working.

 
case APP_MOUNT_DISK:
if(SYS_FS_Mount("/dev/mmcblka1", "/mnt/sdDrive", FAT, 0, NULL) != 0)
{
/* The disk could not be mounted. Try
* mounting again untill success. */
 
appData.state = APP_MOUNT_DISK;
}
else
{
/* Mount was successful. Unmount the disk, for testing. */
 
appData.state = APP_UNMOUNT_DISK;
}
break;
.
.
.
 

void APP_Tasks( void )
{
APP_USB_MSDTasks();
APP_SDCardTasks();
APP_SDCard_2Tasks();                    //<< New Task..
}
 

How to use SYS_FS_MOUNT with AUTOMOUNT ?
 
--
Thanks Karan
post edited by karan123 - 2019/05/13 00:20:25
#1

0 Replies Related Threads

    Jump to:
    © 2019 APG vNext Commercial Version 4.5