All USB MSC-related files under nuttx/configs changed to use the corrected syslog interfaces
This commit is contained in:
parent
f40857c04f
commit
8c1e954b84
@ -43,7 +43,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "stm32.h"
|
||||
@ -57,26 +57,6 @@
|
||||
# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "stm32.h"
|
||||
@ -56,26 +56,6 @@
|
||||
# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/sdio.h>
|
||||
@ -74,27 +74,6 @@
|
||||
# error "Unrecognized STM32 board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -120,34 +99,31 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
||||
message("usbmsc_archinitialize: "
|
||||
"Initializing SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Initializing SDIO slot %d\n", STM32_MMCSDSLOTNO);
|
||||
|
||||
sdio = sdio_initialize(STM32_MMCSDSLOTNO);
|
||||
if (!sdio)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||
|
||||
message("usbmsc_archinitialize: "
|
||||
"Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
|
||||
syslog(LOG_INFO,"Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
|
||||
|
||||
ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio);
|
||||
if (ret != OK)
|
||||
{
|
||||
message("usbmsc_archinitialize: "
|
||||
"Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
syslog(LOG_ERR, ""
|
||||
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
message("usbmsc_archinitialize: "
|
||||
"Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. I need to check to
|
||||
* see if the Hy-Mini STM32v board supports a GPIO to detect if there is a card in
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/sdio.h>
|
||||
@ -70,27 +70,6 @@
|
||||
# error "Unrecognized Kinetis board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
@ -70,27 +70,6 @@
|
||||
# error "Unrecognized LPC17xx board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -110,34 +89,34 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
message("usbmsc_archinitialize: Initializing SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n", LPC17XX_MMCSDSPIPORTNO);
|
||||
|
||||
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
|
||||
if (!spi)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
|
||||
/* Bind the SPI port to the slot */
|
||||
|
||||
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
return OK;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
@ -70,27 +70,6 @@
|
||||
# error "Unrecognized LPC214x board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -110,34 +89,36 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
message("usbmsc_archinitialize: Initializing SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
|
||||
spi = up_spiinitialize(LPC214X_MMCSDSPIPORTNO);
|
||||
if (!spi)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
|
||||
/* Bind the SPI port to the slot */
|
||||
|
||||
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
|
||||
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC214X_MMCSDSLOTNO, spi);
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
|
||||
LPC214X_MMCSDSLOTNO, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
|
||||
return OK;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
@ -70,27 +70,6 @@
|
||||
# error "Unrecognized LPC17xx board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -110,34 +89,36 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
message("usbmsc_archinitialize: Initializing SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
|
||||
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
|
||||
if (!spi)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
|
||||
/* Bind the SPI port to the slot */
|
||||
|
||||
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi);
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
|
||||
LPC17XX_MMCSDSLOTNO, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
return OK;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
@ -73,26 +73,6 @@
|
||||
# error "Unrecognized LPC17xx board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -116,36 +96,39 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
message("usbmsc_archinitialize: Initializing SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
|
||||
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
|
||||
if (!spi)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
ret = -ENODEV;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
|
||||
/* Bind the SPI port to the slot */
|
||||
|
||||
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi);
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
|
||||
LPC17XX_MMCSDSLOTNO, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
|
||||
goto errout;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO,
|
||||
"Successfully bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
return OK;
|
||||
|
||||
/* Disable power to the SD/MMC via a GPIO. HIGH disables SD/MMC. */
|
||||
|
@ -6,14 +6,14 @@ index 3cc6323..ad42790 100644
|
||||
* for all IO regions (Including the vector region).
|
||||
*/
|
||||
|
||||
+lowsyslog("Calling a1x_setupmappings\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Calling a1x_setupmappings\n"); // REMOVE ME
|
||||
a1x_setupmappings();
|
||||
|
||||
/* Provide a special mapping for the IRAM interrupt vector positioned in
|
||||
* high memory.
|
||||
*/
|
||||
|
||||
+lowsyslog("Calling a1x_vectormapping\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Calling a1x_vectormapping\n"); // REMOVE ME
|
||||
a1x_vectormapping();
|
||||
|
||||
#endif /* CONFIG_ARCH_ROMPGTABLE */
|
||||
@ -21,19 +21,19 @@ index 3cc6323..ad42790 100644
|
||||
* arm_vector.S
|
||||
*/
|
||||
|
||||
+lowsyslog("Calling a1x_copyvectorblock\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Calling a1x_copyvectorblock\n"); // REMOVE ME
|
||||
a1x_copyvectorblock();
|
||||
|
||||
/* Initialize the FPU */
|
||||
|
||||
#ifdef CONFIG_ARCH_FPU
|
||||
+lowsyslog("Calling arm_fpuconfig\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Calling arm_fpuconfig\n"); // REMOVE ME
|
||||
arm_fpuconfig();
|
||||
#endif
|
||||
|
||||
/* Perform common, low-level chip initialization (might do nothing) */
|
||||
|
||||
+lowsyslog("Calling a1x_lowsetup\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Calling a1x_lowsetup\n"); // REMOVE ME
|
||||
a1x_lowsetup();
|
||||
|
||||
/* Perform early serial initialization if we are going to use the serial
|
||||
@ -41,7 +41,7 @@ index 3cc6323..ad42790 100644
|
||||
*/
|
||||
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
+lowsyslog("Calling up_earlyserialinit\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Calling up_earlyserialinit\n"); // REMOVE ME
|
||||
up_earlyserialinit();
|
||||
#endif
|
||||
|
||||
@ -49,7 +49,7 @@ index 3cc6323..ad42790 100644
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_BUILD_PROTECTED
|
||||
+lowsyslog("Calling a1x_userspace\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Calling a1x_userspace\n"); // REMOVE ME
|
||||
a1x_userspace();
|
||||
#endif
|
||||
|
||||
@ -57,9 +57,9 @@ index 3cc6323..ad42790 100644
|
||||
* - Configuration of board specific resources (PIOs, LEDs, etc).
|
||||
*/
|
||||
|
||||
+lowsyslog("Calling a1x_boardinitialize\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Calling a1x_boardinitialize\n"); // REMOVE ME
|
||||
a1x_boardinitialize();
|
||||
+lowsyslog("Returning\n"); // REMOVE ME
|
||||
+lowsyslog(LOG_INFO, "Returning\n"); // REMOVE ME
|
||||
}
|
||||
diff --git a/nuttx/arch/arm/src/armv7-a/arm_head.S b/nuttx/arch/arm/src/armv7-a/arm_head.S
|
||||
index bce82d5..924bd24 100644
|
||||
|
@ -44,28 +44,6 @@
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -44,28 +44,6 @@
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/sdio.h>
|
||||
@ -67,26 +67,6 @@
|
||||
#undef SAM_MMCSDSLOTNO
|
||||
#define SAM_MMCSDSLOTNO 0
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -106,34 +86,33 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
||||
message("usbmsc_archinitialize: "
|
||||
"Initializing SDIO slot %d\n",
|
||||
syslg(LOG_INFO, "Initializing SDIO slot %d\n",
|
||||
SAM_MMCSDSLOTNO);
|
||||
|
||||
sdio = sdio_initialize(SAM_MMCSDSLOTNO);
|
||||
if (!sdio)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n",
|
||||
SAM_MMCSDSLOTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
|
||||
SAM_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SPI interface to the MMC/SD driver */
|
||||
|
||||
message("usbmsc_archinitialize: "
|
||||
"Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
|
||||
syslog(LOG_INFO, ""
|
||||
"Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
|
||||
|
||||
ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio);
|
||||
if (ret != OK)
|
||||
{
|
||||
message("usbmsc_archinitialize: "
|
||||
"Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
message("usbmsc_archinitialize: "
|
||||
"Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. I need to check to
|
||||
* see if the SAM3U10E-EVAL board supports a GPIO to detect if there is a card in
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "sam4e-ek.h"
|
||||
@ -74,26 +74,6 @@
|
||||
# undef CONFIG_SAM4EEK_HSMCI_BLOCKDEVICE
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -114,7 +94,7 @@ int usbmsc_archinitialize(void)
|
||||
int ret = sam_at25_automount(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("ERROR: sam_at25_automount failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -122,10 +102,10 @@ int usbmsc_archinitialize(void)
|
||||
#elif defined(CONFIG_SAM4EEK_HSMCI_BLOCKDEVICE)
|
||||
/* Initialize the HSMCI driver */
|
||||
|
||||
ret = sam_hsmci_initialize(0);
|
||||
int ret = sam_hsmci_initialize(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("ERROR: sam_hsmci_initialize(0) failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(0) failed: %d\n", ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "sama5d3-xplained.h"
|
||||
@ -73,26 +73,6 @@
|
||||
# undef HAVE_AT25
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -113,7 +93,7 @@ int usbmsc_archinitialize(void)
|
||||
int ret = sam_at25_automount(AT25_MINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("ERROR: sam_at25_automount failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "sama5d3x-ek.h"
|
||||
@ -73,26 +73,6 @@
|
||||
# undef HAVE_AT25
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -113,7 +93,7 @@ int usbmsc_archinitialize(void)
|
||||
int ret = sam_at25_automount(AT25_MINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("ERROR: sam_at25_automount failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "sama5d4-ek.h"
|
||||
@ -73,26 +73,6 @@
|
||||
# undef HAVE_AT25
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -113,7 +93,7 @@ int usbmsc_archinitialize(void)
|
||||
int ret = sam_at25_automount(AT25_MINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("ERROR: sam_at25_automount failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "stm32.h"
|
||||
@ -56,26 +56,6 @@
|
||||
# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/sdio.h>
|
||||
@ -74,27 +74,6 @@
|
||||
# error "Unrecognized STM32 board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -110,7 +89,7 @@
|
||||
int usbmsc_archinitialize(void)
|
||||
{
|
||||
/* If system/usbmsc is built as an NSH command, then SD slot should
|
||||
* already have been initized in nsh_archinitialize() (see up_nsh.c). In
|
||||
* already have been initialized in nsh_archinitialize() (see up_nsh.c). In
|
||||
* this case, there is nothing further to be done here.
|
||||
*/
|
||||
|
||||
@ -120,34 +99,31 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
||||
message("usbmsc_archinitialize: "
|
||||
"Initializing SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Initializing SDIO slot %d\n", STM32_MMCSDSLOTNO);
|
||||
|
||||
sdio = sdio_initialize(STM32_MMCSDSLOTNO);
|
||||
if (!sdio)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||
|
||||
message("usbmsc_archinitialize: "
|
||||
"Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
|
||||
syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
|
||||
|
||||
ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio);
|
||||
if (ret != OK)
|
||||
{
|
||||
message("usbmsc_archinitialize: "
|
||||
"Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
message("usbmsc_archinitialize: "
|
||||
"Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. I need to check to
|
||||
* see if the STM3210E-EVAL board supports a GPIO to detect if there is a card in
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
@ -74,26 +74,6 @@
|
||||
# error "Unrecognized AVR board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -113,23 +93,23 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
message("Initializing SPI port\n");
|
||||
syslog(LOG_INFO, "Initializing SPI port\n");
|
||||
|
||||
spi = up_spiinitialize(AVR_MMCSDSPIPORTNO);
|
||||
if (!spi)
|
||||
{
|
||||
message("up_spiinitialize failed\n");
|
||||
syslog(LOG_ERR, "ERROR: up_spiinitialize failed\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Bind the SPI port to the slot */
|
||||
|
||||
message("Binding SPI port to MMC/SD slot\n");
|
||||
syslog(LOG_INFO, "Binding SPI port to MMC/SD slot\n");
|
||||
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, AVR_MMCSDSLOTNO, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("mmcsd_spislotinitialize failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: mmcsd_spislotinitialize failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/sdio.h>
|
||||
@ -70,27 +70,6 @@
|
||||
# error "Unrecognized Kinetis board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "stm32.h"
|
||||
@ -57,26 +57,6 @@
|
||||
# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 VIEWTOOL_MMCSD_SLOTNO
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
@ -78,26 +78,6 @@
|
||||
# error "Unrecognized LPC17xx board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -117,34 +97,37 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
message("usbmsc_archinitialize: Initializing SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
|
||||
zkit_spiinitialize();
|
||||
spi = lpc17_spiinitialize(LPC17XX_MMCSDSPIPORTNO);
|
||||
if (!spi)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO);
|
||||
|
||||
/* Bind the SPI port to the slot */
|
||||
|
||||
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi);
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
|
||||
LPC17XX_MMCSDSLOTNO, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
|
||||
return OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user