Few adjustments, moved some details from main.c to portab.c.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11094 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
363809df20
commit
ccfdb3569b
|
@ -124,16 +124,51 @@
|
|||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="0.1570569554.95389811.2077839933">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1570569554.95389811.2077839933" moduleId="org.eclipse.cdt.core.settings" name="Build for STM32F107-Goldbull">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.1570569554.95389811.2077839933" name="Build for STM32F107-Goldbull" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
||||
<folderInfo id="0.1570569554.95389811.2077839933." name="/" resourcePath="">
|
||||
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.316395724" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.316395724.1527335111" name=""/>
|
||||
<builder arguments="-f Makefile-stm32f107_goldbull" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.2066535313" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1773244460" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.107545100" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1947257683" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.338221239" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths"/>
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.781854945" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
</tool>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.220699737" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.41193667" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.223988252" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths"/>
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1657567985" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
</tool>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.615783430" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1225298605" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.857716374" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths"/>
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.2079434059" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="RT-STM32-LWIP-FATFS-USB.null.100047313" name="RT-STM32-LWIP-FATFS-USB"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="0.1570569554">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Default">
|
||||
|
@ -145,6 +180,18 @@
|
|||
<configuration configurationName="Build for STM32F407-Olimex">
|
||||
<resource resourceType="PROJECT" workspacePath="/RT-STM32-LWIP-FATFS-USB"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Build for STM32F107-Goldbull">
|
||||
<resource resourceType="PROJECT" workspacePath="/RT-STM32-LWIP-FATFS-USB"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="0.1570569554.95389811.2077839933">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="0.1570569554">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
|
|
|
@ -391,7 +391,7 @@
|
|||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_STATISTICS TRUE
|
||||
#define CH_DBG_STATISTICS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, system state check.
|
||||
|
@ -400,7 +400,7 @@
|
|||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, parameters checks.
|
||||
|
@ -409,7 +409,7 @@
|
|||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_CHECKS TRUE
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, consistency checks.
|
||||
|
@ -419,7 +419,7 @@
|
|||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_ASSERTS TRUE
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, trace buffer.
|
||||
|
@ -427,7 +427,7 @@
|
|||
*
|
||||
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_ALL
|
||||
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
|
||||
|
||||
/**
|
||||
* @brief Trace buffer entries.
|
||||
|
@ -446,7 +446,7 @@
|
|||
* @note The default failure mode is to halt the system with the global
|
||||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_STACK_CHECK TRUE
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, stacks initialization.
|
||||
|
@ -456,7 +456,7 @@
|
|||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_FILL_THREADS TRUE
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, threads profiling.
|
||||
|
@ -478,6 +478,22 @@
|
|||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief System structure extension.
|
||||
* @details User fields added to the end of the @p ch_system_t structure.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
|
||||
/**
|
||||
* @brief System initialization hook.
|
||||
* @details User initialization code added to the @p chSysInit() function
|
||||
* just before interrupts are enabled globally.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
|
|
|
@ -29,10 +29,22 @@
|
|||
/* Module local definitions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/* Maximum speed SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).*/
|
||||
static const SPIConfig hs_spicfg = {NULL, IOPORT3, GPIOC_SPI3_SD_CS, 0, 0};
|
||||
|
||||
/* Low speed SPI configuration (281.250kHz, CPHA=0, CPOL=0, MSb first).*/
|
||||
static const SPIConfig ls_spicfg = {NULL, IOPORT3, GPIOC_SPI3_SD_CS,
|
||||
SPI_CR1_BR_2 | SPI_CR1_BR_1,
|
||||
0};
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported variables. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/* MMC/SD over SPI driver configuration.*/
|
||||
MMCConfig const portab_mmccfg = {&SPID3, &ls_spicfg, &hs_spicfg};
|
||||
MMCDriver MMCD1;
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module local types. */
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -55,6 +55,9 @@
|
|||
/* External declarations. */
|
||||
/*===========================================================================*/
|
||||
|
||||
extern const MMCConfig portab_mmccfg;
|
||||
extern MMCDriver MMCD1;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -113,21 +113,6 @@ static FATFS SDC_FS;
|
|||
/* FS mounted and ready.*/
|
||||
static bool fs_ready = FALSE;
|
||||
|
||||
#if !HAL_USE_SDC
|
||||
|
||||
/* Maximum speed SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).*/
|
||||
static SPIConfig hs_spicfg = {NULL, IOPORT3, GPIOC_SPI3_SD_CS, 0, 0};
|
||||
|
||||
/* Low speed SPI configuration (281.250kHz, CPHA=0, CPOL=0, MSb first).*/
|
||||
static SPIConfig ls_spicfg = {NULL, IOPORT3, GPIOC_SPI3_SD_CS,
|
||||
SPI_CR1_BR_2 | SPI_CR1_BR_1,
|
||||
0};
|
||||
|
||||
/* MMC/SD over SPI driver configuration.*/
|
||||
static MMCConfig mmccfg = {&SPID3, &ls_spicfg, &hs_spicfg};
|
||||
|
||||
#endif
|
||||
|
||||
/* Generic large buffer.*/
|
||||
static uint8_t fbuff[1024];
|
||||
|
||||
|
@ -209,10 +194,6 @@ static const ShellConfig shell_cfg1 = {
|
|||
|
||||
static thread_t *shelltp = NULL;
|
||||
|
||||
#if !HAL_USE_SDC
|
||||
MMCDriver MMCD1;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Card insertion event.
|
||||
*/
|
||||
|
@ -348,7 +329,7 @@ int main(void) {
|
|||
*/
|
||||
palSetPad(IOPORT3, GPIOC_SPI3_SD_CS);
|
||||
mmcObjectInit(&MMCD1);
|
||||
mmcStart(&MMCD1, &mmccfg);
|
||||
mmcStart(&MMCD1, &portab_mmccfg);
|
||||
|
||||
/*
|
||||
* Activates the card insertion monitor.
|
||||
|
|
Loading…
Reference in New Issue