mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Early debug of SAM3U MCI
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2587 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -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
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user