Fixes to SDMMCv2 driver, write still not working.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13414 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
71348f96f8
commit
54f7db045f
|
@ -867,7 +867,9 @@ void sdc_lld_serve_interrupt(SDCDriver *sdcp) {
|
||||||
read/write functions needs to check them.*/
|
read/write functions needs to check them.*/
|
||||||
sdcp->sdmmc->MASK = 0;
|
sdcp->sdmmc->MASK = 0;
|
||||||
|
|
||||||
|
osalSysLockFromISR();
|
||||||
osalThreadResumeI(&sdcp->thread, MSG_OK);
|
osalThreadResumeI(&sdcp->thread, MSG_OK);
|
||||||
|
osalSysUnlockFromISR();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAL_USE_SDC */
|
#endif /* HAL_USE_SDC */
|
||||||
|
|
|
@ -160,10 +160,12 @@ static void cmd_tree(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
chprintf(chp, "Usage: tree\r\n");
|
chprintf(chp, "Usage: tree\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fs_ready) {
|
if (!fs_ready) {
|
||||||
chprintf(chp, "File System not mounted\r\n");
|
chprintf(chp, "File System not mounted\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = f_getfree("/", &fre_clust, &fsp);
|
err = f_getfree("/", &fre_clust, &fsp);
|
||||||
if (err != FR_OK) {
|
if (err != FR_OK) {
|
||||||
chprintf(chp, "FS: f_getfree() failed\r\n");
|
chprintf(chp, "FS: f_getfree() failed\r\n");
|
||||||
|
@ -176,8 +178,44 @@ static void cmd_tree(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
scan_files(chp, (char *)fbuff);
|
scan_files(chp, (char *)fbuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void cmd_create(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
|
FRESULT err;
|
||||||
|
FIL f;
|
||||||
|
static const char data[] = "the quick brown fox jumps over the lazy dog";
|
||||||
|
UINT btw = sizeof data - 1;
|
||||||
|
UINT bw;
|
||||||
|
|
||||||
|
if (argc != 1) {
|
||||||
|
chprintf(chp, "Usage: create <filename>\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs_ready) {
|
||||||
|
chprintf(chp, "File System not mounted\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = f_open(&f, (const TCHAR *)argv[0], FA_CREATE_ALWAYS | FA_WRITE);
|
||||||
|
if (err != FR_OK) {
|
||||||
|
chprintf(chp, "FS: f_open() failed\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = f_write(&f, (const void *)data, btw, &bw);
|
||||||
|
if (err != FR_OK) {
|
||||||
|
chprintf(chp, "FS: f_write() failed\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
err = f_close(&f);
|
||||||
|
if (err != FR_OK) {
|
||||||
|
chprintf(chp, "FS: f_close() failed\r\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const ShellCommand commands[] = {
|
static const ShellCommand commands[] = {
|
||||||
{"tree", cmd_tree},
|
{"tree", cmd_tree},
|
||||||
|
{"create", cmd_create},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="xPSR-(format)" val="4"/><content id="CR1-spi-null-spi_thread_1-(format)" val="4"/><content id="CR2-spi-null-spi_thread_1-(format)" val="4"/><content id="CFG1-spi-null-spi_thread_1-(format)" val="4"/><content id="CFG2-spi-null-spi_thread_1-(format)" val="4"/><content id="IER-spi-null-spi_thread_1-(format)" val="4"/><content id="SR-spi-null-spi_thread_1-(format)" val="4"/><content id="IFCR-spi-null-spi_thread_1-(format)" val="4"/><content id="RESERVED0-spi-null-spi_thread_1-(format)" val="4"/><content id="TXDR-spi-null-spi_thread_1-(format)" val="4"/><content id="RESERVED1-spi-null-spi_thread_1-(format)" val="4"/><content id="RXDR-spi-null-spi_thread_1-(format)" val="4"/><content id="RESERVED2-spi-null-spi_thread_1-(format)" val="4"/><content id="CRCPOLY-spi-null-spi_thread_1-(format)" val="4"/><content id="TXCRC-spi-null-spi_thread_1-(format)" val="4"/><content id="RXCRC-spi-null-spi_thread_1-(format)" val="4"/><content id="UDRDR-spi-null-spi_thread_1-(format)" val="4"/><content id="I2SCFGR-spi-null-spi_thread_1-(format)" val="4"/><content id="CR1-spi-null-_idle_thread-(format)" val="4"/><content id="CR2-spi-null-_idle_thread-(format)" val="4"/><content id="CFG1-spi-null-_idle_thread-(format)" val="4"/><content id="CFG2-spi-null-_idle_thread-(format)" val="4"/><content id="IER-spi-null-_idle_thread-(format)" val="4"/><content id="SR-spi-null-_idle_thread-(format)" val="4"/><content id="IFCR-spi-null-_idle_thread-(format)" val="4"/><content id="RESERVED0-spi-null-_idle_thread-(format)" val="4"/><content id="TXDR-spi-null-_idle_thread-(format)" val="4"/><content id="RESERVED1-spi-null-_idle_thread-(format)" val="4"/><content id="RXDR-spi-null-_idle_thread-(format)" val="4"/><content id="RESERVED2-spi-null-_idle_thread-(format)" val="4"/><content id="CRCPOLY-spi-null-_idle_thread-(format)" val="4"/><content id="TXCRC-spi-null-_idle_thread-(format)" val="4"/><content id="RXCRC-spi-null-_idle_thread-(format)" val="4"/><content id="UDRDR-spi-null-_idle_thread-(format)" val="4"/><content id="I2SCFGR-spi-null-_idle_thread-(format)" val="4"/></contentList>"/>
|
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="I2SCFGR-spi-null-_idle_thread-(format)" val="4"/><content id="UDRDR-spi-null-_idle_thread-(format)" val="4"/><content id="RXCRC-spi-null-_idle_thread-(format)" val="4"/><content id="TXCRC-spi-null-_idle_thread-(format)" val="4"/><content id="CRCPOLY-spi-null-_idle_thread-(format)" val="4"/><content id="RESERVED2-spi-null-_idle_thread-(format)" val="4"/><content id="RXDR-spi-null-_idle_thread-(format)" val="4"/><content id="RESERVED1-spi-null-_idle_thread-(format)" val="4"/><content id="TXDR-spi-null-_idle_thread-(format)" val="4"/><content id="RESERVED0-spi-null-_idle_thread-(format)" val="4"/><content id="IFCR-spi-null-_idle_thread-(format)" val="4"/><content id="SR-spi-null-_idle_thread-(format)" val="4"/><content id="IER-spi-null-_idle_thread-(format)" val="4"/><content id="CFG2-spi-null-_idle_thread-(format)" val="4"/><content id="CFG1-spi-null-_idle_thread-(format)" val="4"/><content id="CR2-spi-null-_idle_thread-(format)" val="4"/><content id="CR1-spi-null-_idle_thread-(format)" val="4"/><content id="I2SCFGR-spi-null-spi_thread_1-(format)" val="4"/><content id="UDRDR-spi-null-spi_thread_1-(format)" val="4"/><content id="RXCRC-spi-null-spi_thread_1-(format)" val="4"/><content id="TXCRC-spi-null-spi_thread_1-(format)" val="4"/><content id="CRCPOLY-spi-null-spi_thread_1-(format)" val="4"/><content id="RESERVED2-spi-null-spi_thread_1-(format)" val="4"/><content id="RXDR-spi-null-spi_thread_1-(format)" val="4"/><content id="RESERVED1-spi-null-spi_thread_1-(format)" val="4"/><content id="TXDR-spi-null-spi_thread_1-(format)" val="4"/><content id="RESERVED0-spi-null-spi_thread_1-(format)" val="4"/><content id="IFCR-spi-null-spi_thread_1-(format)" val="4"/><content id="SR-spi-null-spi_thread_1-(format)" val="4"/><content id="IER-spi-null-spi_thread_1-(format)" val="4"/><content id="CFG2-spi-null-spi_thread_1-(format)" val="4"/><content id="CFG1-spi-null-spi_thread_1-(format)" val="4"/><content id="CR2-spi-null-spi_thread_1-(format)" val="4"/><content id="CR1-spi-null-spi_thread_1-(format)" val="4"/><content id="xPSR-(format)" val="4"/></contentList>"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
|
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x40021004"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
|
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x40021004"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="${selected_resource_loc}"/>
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="${selected_resource_loc}"/>
|
||||||
|
|
Loading…
Reference in New Issue