summaryrefslogtreecommitdiff
path: root/nuttx/configs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-04-11 18:08:52 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-04-11 18:08:52 +0000
commit43f791fab83155249f86ed7432a60d420b8b9851 (patch)
tree40ef0f96cebc9308369d6d72d0d70ad75907b717 /nuttx/configs
parent43a9fea627eecbc4294079e80be611c2f4f7d7e3 (diff)
downloadpx4-nuttx-43f791fab83155249f86ed7432a60d420b8b9851.tar.gz
px4-nuttx-43f791fab83155249f86ed7432a60d420b8b9851.tar.bz2
px4-nuttx-43f791fab83155249f86ed7432a60d420b8b9851.zip
Early debug of SAM3U MCI
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2587 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rwxr-xr-xnuttx/configs/sam3u-ek/src/sam3uek_internal.h2
-rwxr-xr-xnuttx/configs/sam3u-ek/src/up_mmcsd.c27
-rwxr-xr-xnuttx/configs/sam3u-ek/src/up_nsh.c4
3 files changed, 19 insertions, 14 deletions
diff --git a/nuttx/configs/sam3u-ek/src/sam3uek_internal.h b/nuttx/configs/sam3u-ek/src/sam3uek_internal.h
index f092cbb02..52fd3dd55 100755
--- a/nuttx/configs/sam3u-ek/src/sam3uek_internal.h
+++ b/nuttx/configs/sam3u-ek/src/sam3uek_internal.h
@@ -119,7 +119,7 @@ extern void weak_function sam3u_usbinitialize(void);
#ifdef CONFIG_SAM3U_HSMCI
extern int weak_function sam3u_hsmciinit(void);
#else
-# define sam3u_boardmciinit()
+# define sam3u_hsmciinit()
#endif
/****************************************************************************
diff --git a/nuttx/configs/sam3u-ek/src/up_mmcsd.c b/nuttx/configs/sam3u-ek/src/up_mmcsd.c
index 45762ee28..2f19c9ced 100755
--- a/nuttx/configs/sam3u-ek/src/up_mmcsd.c
+++ b/nuttx/configs/sam3u-ek/src/up_mmcsd.c
@@ -70,39 +70,42 @@
* Public Functions
************************************************************************************/
-/****************************************************************************
+/************************************************************************************
* Name: sam3u_hsmciinit
*
* Description:
- * Initialize HSMCI support
+ * Initialize HSMCI support. This function is called very early in board
+ * initialization.
*
- ****************************************************************************/
+ ************************************************************************************/
int sam3u_hsmciinit(void)
{
-#if GPIO_MCI_CD
+#ifdef GPIO_MCI_CD
sam3u_configgpio(GPIO_MCI_CD);
#endif
-#if GPIO_MCI_WP
+#ifdef GPIO_MCI_WP
sam3u_configgpio(GPIO_MCI_WP);
#endif
return OK;
}
-/****************************************************************************
+/************************************************************************************
* Name: sam3u_cardinserted
*
* Description:
* Check if a card is inserted into the selected HSMCI slot
*
- ****************************************************************************/
+ ************************************************************************************/
bool sam3u_cardinserted(unsigned char slot)
{
if (slot == 0)
{
#ifdef GPIO_MCI_CD
- return !sam3u_gpioread(GPIO_MCI_CD);
+ bool inserted = sam3u_gpioread(GPIO_MCI_CD);
+ fvdbg("inserted: %s\n", inserted ? "NO" : "YES");
+ return !inserted;
#else
return true;
#endif
@@ -110,20 +113,22 @@ bool sam3u_cardinserted(unsigned char slot)
return false;
}
-/****************************************************************************
+/************************************************************************************
* Name: sam3u_writeprotected
*
* Description:
* Check if a card is inserted into the selected HSMCI slot
*
- ****************************************************************************/
+ ************************************************************************************/
bool sam3u_writeprotected(unsigned char slot)
{
if (slot == 0)
{
#ifdef GPIO_MCI_WP
- return sam3u_gpioread(GPIO_MCI_WP);
+ bool protected = sam3u_gpioread(GPIO_MCI_WP);
+ fvdbg("protected: %s\n", inserted ? "YES" : "NO");
+ return protected;
#else
return false;
#endif
diff --git a/nuttx/configs/sam3u-ek/src/up_nsh.c b/nuttx/configs/sam3u-ek/src/up_nsh.c
index ae1ecb673..cb3665f90 100755
--- a/nuttx/configs/sam3u-ek/src/up_nsh.c
+++ b/nuttx/configs/sam3u-ek/src/up_nsh.c
@@ -100,13 +100,13 @@
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
-# define message(...) lib_lowprintf(__VA_ARGS__)
+# define message(...) lib_rawprintf(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
-# define message lib_lowprintf
+# define message lib_rawprintf
# else
# define message printf
# endif