mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-03 06:10:35 +08:00
mtd: use new MTDIOC_SETSPEED ioctl
set SPI speed to 10MHz
This commit is contained in:
committed by
Lorenz Meier
parent
352dea6754
commit
ff59aa9a0f
@@ -144,7 +144,7 @@ ramtron_attach(void)
|
||||
/* find the right spi */
|
||||
struct spi_dev_s *spi = up_spiinitialize(2);
|
||||
/* this resets the spi bus, set correct bus speed again */
|
||||
SPI_SETFREQUENCY(spi, 40 * 1000 * 1000);
|
||||
SPI_SETFREQUENCY(spi, 10 * 1000 * 1000);
|
||||
SPI_SETBITS(spi, 8);
|
||||
SPI_SETMODE(spi, SPIDEV_MODE3);
|
||||
SPI_SELECT(spi, SPIDEV_FLASH, false);
|
||||
@@ -170,6 +170,10 @@ ramtron_attach(void)
|
||||
if (mtd_dev == NULL)
|
||||
errx(1, "failed to initialize mtd driver");
|
||||
|
||||
int ret = mtd_dev->ioctl(mtd_dev, MTDIOC_SETSPEED, (unsigned long)10*1000*1000);
|
||||
if (ret != OK)
|
||||
warnx(1, "failed to set bus speed");
|
||||
|
||||
attached = true;
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user