Merge branch 'master' into cdc_without_dtr
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
linker_memory_map_file="$(ProjectDir)/ATSAMD21G18A_MemoryMap.xml"
|
||||
linker_section_placement_file="flash_placement.xml"
|
||||
linker_section_placements_segments="FLASH RX 0x00000000 0x00080000;RAM RWX 0x20000000 0x00030000"
|
||||
macros="DeviceFamily=SAMD21;Target=ATSAMD21G18A;Placement=Flash;rootDir=../../../../..;asf4Dir=../../../../../hw/mcu/microchip/samd/asf4/samd21"
|
||||
macros="DeviceFamily=SAMD21;Target=ATSAMD21G18A;Placement=Flash;rootDir=../../../../..;asf4Dir=../../../../../hw/mcu/microchip/asf4/samd21"
|
||||
project_directory=""
|
||||
project_type="Executable"
|
||||
target_reset_script="Reset();"
|
||||
@@ -54,22 +54,22 @@
|
||||
<folder Name="asf4">
|
||||
<folder Name="samd21">
|
||||
<folder Name="gcc">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd21/gcc/system_samd21.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd21/gcc/system_samd21.c" />
|
||||
</folder>
|
||||
<folder Name="hpl">
|
||||
<folder Name="gclk">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd21/hpl/gclk/hpl_gclk.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd21/hpl/gclk/hpl_gclk.c" />
|
||||
</folder>
|
||||
<folder Name="pm">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd21/hpl/pm/hpl_pm.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd21/hpl/pm/hpl_pm.c" />
|
||||
</folder>
|
||||
<folder Name="sysctrl">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd21/hpl/sysctrl/hpl_sysctrl.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd21/hpl/sysctrl/hpl_sysctrl.c" />
|
||||
</folder>
|
||||
</folder>
|
||||
<folder Name="hal">
|
||||
<folder Name="src">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd21/hal/src/hal_atomic.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd21/hal/src/hal_atomic.c" />
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
|
@@ -29,7 +29,7 @@
|
||||
linker_memory_map_file="ATSAMD51J19A_MemoryMap.xml"
|
||||
linker_section_placement_file="flash_placement.xml"
|
||||
linker_section_placements_segments="FLASH RX 0x00000000 0x00080000;RAM RWX 0x20000000 0x00030000"
|
||||
macros="DeviceFamily=SAMD51;Target=ATSAMD51J19A;Placement=Flash;rootDir=../../../../..;asf4Dir=../../../../../hw/mcu/microchip/samd/asf4/samd51"
|
||||
macros="DeviceFamily=SAMD51;Target=ATSAMD51J19A;Placement=Flash;rootDir=../../../../..;asf4Dir=../../../../../hw/mcu/microchip/asf4/samd51"
|
||||
project_directory=""
|
||||
project_type="Executable"
|
||||
target_reset_script="Reset();"
|
||||
@@ -55,25 +55,25 @@
|
||||
<folder Name="asf4">
|
||||
<folder Name="samd51">
|
||||
<folder Name="gcc">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd51/gcc/system_samd51.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd51/gcc/system_samd51.c" />
|
||||
</folder>
|
||||
<folder Name="hpl">
|
||||
<folder Name="osc32kctrl">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd51/hpl/osc32kctrl/hpl_osc32kctrl.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd51/hpl/osc32kctrl/hpl_osc32kctrl.c" />
|
||||
</folder>
|
||||
<folder Name="oscctrl">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd51/hpl/oscctrl/hpl_oscctrl.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd51/hpl/oscctrl/hpl_oscctrl.c" />
|
||||
</folder>
|
||||
<folder Name="mclk">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd51/hpl/mclk/hpl_mclk.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd51/hpl/mclk/hpl_mclk.c" />
|
||||
</folder>
|
||||
<folder Name="gclk">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd51/hpl/gclk/hpl_gclk.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd51/hpl/gclk/hpl_gclk.c" />
|
||||
</folder>
|
||||
</folder>
|
||||
<folder Name="hal">
|
||||
<folder Name="src">
|
||||
<file file_name="../../../../../hw/mcu/microchip/samd/asf4/samd51/hal/src/hal_atomic.c" />
|
||||
<file file_name="../../../../../hw/mcu/microchip/asf4/samd51/hal/src/hal_atomic.c" />
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
|
@@ -28,6 +28,9 @@
|
||||
|
||||
#if CFG_TUD_MSC
|
||||
|
||||
// whether host does safe-eject
|
||||
static bool ejected = false;
|
||||
|
||||
// Some MCU doesn't have enough 8KB SRAM to store the whole disk
|
||||
// We will use Flash as read-only disk with board that has
|
||||
// CFG_EXAMPLE_MSC_READONLY defined
|
||||
@@ -137,7 +140,13 @@ bool tud_msc_test_unit_ready_cb(uint8_t lun)
|
||||
{
|
||||
(void) lun;
|
||||
|
||||
return true; // RAM disk is always ready
|
||||
// RAM disk is ready until ejected
|
||||
if (ejected) {
|
||||
tud_msc_set_sense(lun, SCSI_SENSE_NOT_READY, 0x3a, 0x00);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size
|
||||
@@ -166,6 +175,7 @@ bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, boo
|
||||
}else
|
||||
{
|
||||
// unload disk storage
|
||||
ejected = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user