git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1296 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2009-11-14 19:17:40 +00:00
parent 5e1dae48aa
commit 99b688bc5e
2 changed files with 18 additions and 3 deletions

View File

@ -25,6 +25,8 @@
#include <evtimer.h>
#include <test.h>
#include <ff.h>
#include "board.h"
/*
@ -67,6 +69,11 @@ static bool_t mmc_is_protected(void) {
return (bool_t)palReadPad(IOPORT3, GPIOC_MMCWP);
}
/**
* @brief FS object.
*/
FATFS MMC_FS;
/*
* Red LEDs blinker thread, times are in milliseconds.
*/
@ -97,9 +104,19 @@ static void TimerHandler(eventid_t id) {
* MMC card insertion event.
*/
static void InsertHandler(eventid_t id) {
FRESULT err;
(void)id;
mmcConnect(&MMCD1);
/*
* On insertion MMC initialization and FS mount.
*/
if (mmcConnect(&MMCD1))
return;
err = f_mount(0, &MMC_FS);
if (err != FR_OK) {
mmcDisconnect(&MMCD1);
return;
}
}
/*
@ -146,8 +163,6 @@ int main(int argc, char **argv) {
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
// spiStop(&SPID1);
/*
* Normal main() thread activity, in this demo it does nothing except
* sleeping in a loop and listed for events.

Binary file not shown.