Fix-up some SAMD20 SERCOM conditionals

This commit is contained in:
Gregory Nutt 2014-02-12 18:29:23 -06:00
parent 9b5d5aef78
commit a0cb3588a5
7 changed files with 22 additions and 18 deletions

View File

@ -46,7 +46,7 @@ ifeq ($(CONFIG_HAVE_CXX),y)
CSRCS += sam_cxxinitialize.c
endif
ifeq ($(CONFIG_SAMD_SPI0),y)
ifeq ($(CONFIG_SAMD_SERCOM0),y)
CSRCS += sam_spi.c
endif
@ -64,13 +64,13 @@ ifeq ($(CONFIG_NSH_ARCHINIT),y)
CSRCS += sam_nsh.c
endif
ifeq ($(CONFIG_SAMD_SPI0),y)
ifeq ($(CONFIG_SAMD_SERCOM0),y)
ifeq ($(CONFIG_SAM4L_XPLAINED_IOMODULE),y)
CSRCS += sam_mmcsd.c
endif
endif
ifeq ($(CONFIG_SAMD_SPI0),y)
ifeq ($(CONFIG_SAMD_SERCOM0),y)
ifeq ($(CONFIG_SAM4L_XPLAINED_OLED1MODULE),y)
ifeq ($(CONFIG_LCD_UG2832HSWEG04),y)
CSRCS += sam_ug2832hsweg04.c

View File

@ -41,6 +41,7 @@
#include <debug.h>
#include "sam_config.h"
#include "samd20-xplained.h"
/************************************************************************************
@ -71,7 +72,7 @@ void sam_boardinitialize(void)
* sam_spiinitialize() has been brought into the link.
*/
#ifdef CONFIG_SAMD_SPI0
#ifdef SAMD_HAVE_SPI0
if (sam_spiinitialize)
{
sam_spiinitialize();

View File

@ -46,6 +46,7 @@
#include <nuttx/spi/spi.h>
#include <nuttx/mmcsd.h>
#include "sam_config.h"
#include "samd20-xplained.h"
#ifdef CONFIG_SAM4L_XPLAINED_IOMODULE
@ -59,8 +60,8 @@
# error Mountpoints are disabled (CONFIG_DISABLE_MOUNTPOINT=y)
#endif
#ifndef CONFIG_SAMD_SPI0 /* REVISIT */
# error SPI support is required (CONFIG_SAMD_SPI0)
#ifndef SAMD_HAVE_SPI0
# error SERCOM0 SPI support is required
#endif
#ifndef CONFIG_MMCSD
@ -81,7 +82,7 @@
* - CONFIG_SAM4L_XPLAINED_IOMODULE=y,
* - CONFIG_DISABLE_MOUNTPOINT=n,
* - CONFIG_MMCSD=y, and
* - CONFIG_SAMD_SPI0=y
* - SAMD_HAVE_SPI0=y (CONFIG_SAMD_SERCOM0 && CONFIG_SAMD_SERCOM0_ISSPI)
*
*****************************************************************************/

View File

@ -99,7 +99,7 @@
int nsh_archinitialize(void)
{
#if defined(CONFIG_SAMD_SPI0) && defined(CONFIG_SAM4L_XPLAINED_IOMODULE)
#if defined(SAMD_HAVE_SPI0) && defined(CONFIG_SAM4L_XPLAINED_IOMODULE)
/* Initialize the SPI-based MMC/SD slot */
{

View File

@ -45,11 +45,12 @@
#include <nuttx/spi/spi.h>
#include "sam_config.h"
#include "sam_gpio.h"
#include "sam_spi.h"
#include "samd20-xplained.h"
#ifdef CONFIG_SAMD_SPI0 /* REVISIT */
#ifdef SAMD_HAVE_SPI0
/************************************************************************************
* Definitions
@ -236,7 +237,7 @@ uint8_t sam_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
return ret;
}
#endif /* CONFIG_SAMD_SPI0 */
#endif /* SAMD_HAVE_SPI0 */
/****************************************************************************
* Name: sam_spicmddata

View File

@ -133,8 +133,8 @@
# error "The OLED driver requires CONFIG_LCD_UG2832HSWEG04 in the configuration"
#endif
#ifndef CONFIG_SAMD_SPI0
# error "The OLED driver requires CONFIG_SAMD_SPI0 in the configuration"
#ifndef SAMD_HAVE_SPI0
# error "The OLED driver requires SAMD_HAVE_SPI0 in the configuration"
#endif
#ifndef CONFIG_SPI_CMDDATA

View File

@ -48,6 +48,7 @@
#include <arch/irq.h>
#include <nuttx/irq.h>
#include "sam_config.h"
#include "chip/sam_pinmap.h"
/************************************************************************************
@ -115,8 +116,8 @@
#ifdef CONFIG_SAMD20_XPLAINED_IOMODULE
# ifndef CONFIG_SAMD_SPI0
# error CONFIG_SAMD_SPI0 is required to use the I/O1 module
# ifndef SAMD_HAVE_SPI0
# error SAMD_HAVE_SPI0 is required to use the I/O1 module
# endif
# if defined(CONFIG_SAMD20_XPLAINED_IOMODULE_EXT1)
@ -171,8 +172,8 @@
#ifdef CONFIG_SAMD20_XPLAINED_OLED1MODULE
# ifndef CONFIG_SAMD_SPI0 /* REVISIT */
# error CONFIG_SAMD_SPI0 is required to use the OLED1 module
# ifndef SAMD_HAVE_SPI0
# error SAMD_HAVE_SPI0 is required to use the OLED1 module
# endif
# ifndef CONFIG_SPI_CMDDATA
@ -256,11 +257,11 @@ void weak_function sam_spiinitialize(void);
*
* Description:
* Initialize the SPI-based SD card. Requires CONFIG_SAMD20_XPLAINED_IOMODULE=y,
* CONFIG_DISABLE_MOUNTPOINT=n, CONFIG_MMCSD=y, and CONFIG_SAMD_SPI0=y
* CONFIG_DISABLE_MOUNTPOINT=n, CONFIG_MMCSD=y, and SAMD_HAVE_SPI0
*
************************************************************************************/
#if defined(CONFIG_SAMD_SPI0) && defined(CONFIG_SAMD20_XPLAINED_IOMODULE)
#if defined(SAMD_HAVE_SPI0) && defined(CONFIG_SAMD20_XPLAINED_IOMODULE)
int sam_sdinitialize(int minor);
#endif