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

This commit is contained in:
gdisirio 2011-06-06 17:17:43 +00:00
parent ed8a14e688
commit d553080cd9
2 changed files with 21 additions and 16 deletions

View File

@ -73,8 +73,10 @@ CSRC = $(PORTSRC) \
$(HALSRC) \ $(HALSRC) \
$(PLATFORMSRC) \ $(PLATFORMSRC) \
$(BOARDSRC) \ $(BOARDSRC) \
$(FATFSSRC) \
$(CHIBIOS)/os/various/evtimer.c \ $(CHIBIOS)/os/various/evtimer.c \
$(CHIBIOS)/os/various/syscalls.c \ $(CHIBIOS)/os/various/syscalls.c \
$(CHIBIOS)/os/various/shell.c \
main.c main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global # C++ sources that can be compiled in ARM or THUMB mode depending on the global
@ -106,6 +108,7 @@ ASMSRC = $(PORTASM)
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) \
$(FATFSINC) \
$(CHIBIOS)/os/various $(CHIBIOS)/os/various
# #
@ -154,7 +157,7 @@ CPPWARN = -Wall -Wextra
# #
# List all default C defines here, like -D_DEBUG=1 # List all default C defines here, like -D_DEBUG=1
DDEFS = DDEFS = -DSTDOUT_SD=SD1 -DSTDIN_SD=SD1
# List all default ASM defines here, like -D_DEBUG=1 # List all default ASM defines here, like -D_DEBUG=1
DADEFS = DADEFS =

View File

@ -60,6 +60,7 @@ static EventSource inserted_event, removed_event;
*/ */
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) { bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
return !palReadPad(GPIOF, GPIOF_SD_DETECT); return !palReadPad(GPIOF, GPIOF_SD_DETECT);
} }
@ -73,6 +74,7 @@ bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
*/ */
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) { bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
return FALSE; return FALSE;
} }
@ -155,14 +157,14 @@ static FRESULT scan_files(char *path)
continue; continue;
fn = fno.fname; fn = fno.fname;
if (fno.fattrib & AM_DIR) { if (fno.fattrib & AM_DIR) {
sprintf(&path[i], "/%s", fn); siprintf(&path[i], "/%s", fn);
res = scan_files(path); res = scan_files(path);
if (res != FR_OK) if (res != FR_OK)
break; break;
path[i] = 0; path[i] = 0;
} }
else { else {
// iprintf("%s/%s\r\n", path, fn); iprintf("%s/%s\r\n", path, fn);
} }
} }
} }
@ -187,11 +189,11 @@ static void cmd_mem(BaseChannel *chp, int argc, char *argv[]) {
return; return;
} }
n = chHeapStatus(NULL, &size); n = chHeapStatus(NULL, &size);
sprintf(buf, "core free memory : %u bytes", chCoreStatus()); siprintf(buf, "core free memory : %u bytes", chCoreStatus());
shellPrintLine(chp, buf); shellPrintLine(chp, buf);
sprintf(buf, "heap fragments : %u", n); siprintf(buf, "heap fragments : %u", n);
shellPrintLine(chp, buf); shellPrintLine(chp, buf);
sprintf(buf, "heap free total : %u bytes", size); siprintf(buf, "heap free total : %u bytes", size);
shellPrintLine(chp, buf); shellPrintLine(chp, buf);
} }
@ -223,7 +225,7 @@ static void cmd_threads(BaseChannel *chp, int argc, char *argv[]) {
shellPrintLine(chp, " addr stack prio refs state time"); shellPrintLine(chp, " addr stack prio refs state time");
tp = chRegFirstThread(); tp = chRegFirstThread();
do { do {
sprintf(buf, "%8lx %8lx %4u %4i %9s %u", siprintf(buf, "%8lx %8lx %4u %4i %9s %u",
(uint32_t)tp, (uint32_t)tp->p_ctx.r13, (uint32_t)tp, (uint32_t)tp->p_ctx.r13,
(unsigned int)tp->p_prio, tp->p_refs - 1, (unsigned int)tp->p_prio, tp->p_refs - 1,
states[tp->p_state], (unsigned int)tp->p_time); states[tp->p_state], (unsigned int)tp->p_time);
@ -268,7 +270,7 @@ static void cmd_tree(BaseChannel *chp, int argc, char *argv[]) {
shellPrintLine(chp, "FS: f_getfree() failed"); shellPrintLine(chp, "FS: f_getfree() failed");
return; return;
} }
sprintf((void *)fbuff, siprintf((void *)fbuff,
"FS: %lu free clusters, %lu sectors per cluster, %lu bytes free", "FS: %lu free clusters, %lu sectors per cluster, %lu bytes free",
clusters, (uint32_t)SDC_FS.csize, clusters, (uint32_t)SDC_FS.csize,
clusters * (uint32_t)SDC_FS.csize * (uint32_t)SDC_BLOCK_SIZE); clusters * (uint32_t)SDC_FS.csize * (uint32_t)SDC_BLOCK_SIZE);
@ -295,7 +297,7 @@ static const ShellConfig shell_cfg1 = {
/*===========================================================================*/ /*===========================================================================*/
/* /*
* MMC card insertion event. * SD card insertion event.
*/ */
static void InsertHandler(eventid_t id) { static void InsertHandler(eventid_t id) {
FRESULT err; FRESULT err;
@ -316,7 +318,7 @@ static void InsertHandler(eventid_t id) {
} }
/* /*
* MMC card removal event. * SD card removal event.
*/ */
static void RemoveHandler(eventid_t id) { static void RemoveHandler(eventid_t id) {