Fix some W25 driver errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5212 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
e35b9c23ad
commit
9870a51ab3
@ -96,23 +96,23 @@ int stm32_w25initialize(int minor)
|
|||||||
#ifdef HAVE_W25
|
#ifdef HAVE_W25
|
||||||
FAR struct spi_dev_s *spi;
|
FAR struct spi_dev_s *spi;
|
||||||
FAR struct mtd_dev_s *mtd;
|
FAR struct mtd_dev_s *mtd;
|
||||||
#ifndef CONFIG_FS_NXFFS
|
#ifdef CONFIG_FS_NXFFS
|
||||||
uint8_t devname[12];
|
char devname[12];
|
||||||
#endif
|
#endif
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Get the SPI port */
|
/* Get the SPI port */
|
||||||
|
|
||||||
spi = up_spiinitialize(2);
|
spi = up_spiinitialize(1);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now bind the SPI interface to the SST 25 SPI FLASH driver */
|
/* Now bind the SPI interface to the W25 SPI FLASH driver */
|
||||||
|
|
||||||
mtd = sst25_initialize(spi);
|
mtd = w25_initialize(spi);
|
||||||
if (!mtd)
|
if (!mtd)
|
||||||
{
|
{
|
||||||
fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n");
|
fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n");
|
||||||
@ -140,7 +140,7 @@ int stm32_w25initialize(int minor)
|
|||||||
|
|
||||||
/* Mount the file system at /mnt/w25 */
|
/* Mount the file system at /mnt/w25 */
|
||||||
|
|
||||||
snprintf(devname, 12, "/mnt/w25%c", a + minor);
|
snprintf(devname, 12, "/mnt/w25%c", 'a' + minor);
|
||||||
ret = mount(NULL, devname, "nxffs", 0, NULL);
|
ret = mount(NULL, devname, "nxffs", 0, NULL);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
@ -805,7 +805,7 @@ static uint16_t stm32_readnoshift(FAR struct stm32_dev_s *priv, FAR uint16_t *ac
|
|||||||
|
|
||||||
static void stm32_setcursor(FAR struct stm32_dev_s *priv, uint16_t col, uint16_t row)
|
static void stm32_setcursor(FAR struct stm32_dev_s *priv, uint16_t col, uint16_t row)
|
||||||
{
|
{
|
||||||
if (priv->type = LCD_TYPE_ILI9919)
|
if (priv->type == LCD_TYPE_ILI9919)
|
||||||
{
|
{
|
||||||
stm32_writereg(priv, LCD_REG_78, col); /* GRAM horizontal address */
|
stm32_writereg(priv, LCD_REG_78, col); /* GRAM horizontal address */
|
||||||
stm32_writereg(priv, LCD_REG_79, row); /* GRAM vertical address */
|
stm32_writereg(priv, LCD_REG_79, row); /* GRAM vertical address */
|
||||||
|
@ -96,23 +96,23 @@ int stm32_w25initialize(int minor)
|
|||||||
#ifdef HAVE_W25
|
#ifdef HAVE_W25
|
||||||
FAR struct spi_dev_s *spi;
|
FAR struct spi_dev_s *spi;
|
||||||
FAR struct mtd_dev_s *mtd;
|
FAR struct mtd_dev_s *mtd;
|
||||||
#ifndef CONFIG_FS_NXFFS
|
#ifdef CONFIG_FS_NXFFS
|
||||||
uint8_t devname[12];
|
char devname[12];
|
||||||
#endif
|
#endif
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Get the SPI port */
|
/* Get the SPI port */
|
||||||
|
|
||||||
spi = up_spiinitialize(2);
|
spi = up_spiinitialize(1);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now bind the SPI interface to the SST 25 SPI FLASH driver */
|
/* Now bind the SPI interface to the W25 SPI FLASH driver */
|
||||||
|
|
||||||
mtd = sst25_initialize(spi);
|
mtd = w25_initialize(spi);
|
||||||
if (!mtd)
|
if (!mtd)
|
||||||
{
|
{
|
||||||
fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n");
|
fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n");
|
||||||
@ -140,7 +140,7 @@ int stm32_w25initialize(int minor)
|
|||||||
|
|
||||||
/* Mount the file system at /mnt/w25 */
|
/* Mount the file system at /mnt/w25 */
|
||||||
|
|
||||||
snprintf(devname, 12, "/mnt/w25%c", a + minor);
|
snprintf(devname, 12, "/mnt/w25%c", 'a' + minor);
|
||||||
ret = mount(NULL, devname, "nxffs", 0, NULL);
|
ret = mount(NULL, devname, "nxffs", 0, NULL);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user