Prefix SD SPI pins (SCK, MISO, MOSI, SS) (#20606)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@ -37,7 +37,7 @@
|
||||
// RepRapWorld Graphical LCD
|
||||
|
||||
#define U8G_CLASS U8GLIB_ST7920_128X64_4X
|
||||
#if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN)
|
||||
#if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_ENABLE == SD_MOSI_PIN)
|
||||
#define U8G_PARAM LCD_PINS_RS
|
||||
#else
|
||||
#define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS
|
||||
@ -48,7 +48,7 @@
|
||||
// RepRap Discount Full Graphics Smart Controller
|
||||
// and other variant LCDs using ST7920
|
||||
|
||||
#if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN)
|
||||
#if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_ENABLE == SD_MOSI_PIN)
|
||||
#define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL // 2 stripes, HW SPI (Shared with SD card. Non-standard LCD adapter on AVR.)
|
||||
#define U8G_PARAM LCD_PINS_RS
|
||||
#else
|
||||
@ -88,7 +88,7 @@
|
||||
|
||||
#define SMART_RAMPS MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF)
|
||||
#define U8G_CLASS U8GLIB_64128N_2X_HAL // 4 stripes (HW-SPI)
|
||||
#if SMART_RAMPS || DOGLCD_SCK != SCK_PIN || DOGLCD_MOSI != MOSI_PIN
|
||||
#if SMART_RAMPS || DOGLCD_SCK != SD_SCK_PIN || DOGLCD_MOSI != SD_MOSI_PIN
|
||||
#define FORCE_SOFT_SPI // SW-SPI
|
||||
#endif
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
bool MediaFileReader::open(const char* filename) {
|
||||
card.init(SPI_SPEED, SDSS);
|
||||
card.init(SD_SPI_SPEED, SDSS);
|
||||
volume.init(&card);
|
||||
root.openRoot(&volume);
|
||||
return file.open(&root, filename, O_READ);
|
||||
|
@ -33,7 +33,7 @@ namespace FTDI {
|
||||
SPIClass EVE_SPI(CLCD_SPI_BUS);
|
||||
#endif
|
||||
#ifndef CLCD_HW_SPI_SPEED
|
||||
#define CLCD_HW_SPI_SPEED 8000000 >> SPI_SPEED
|
||||
#define CLCD_HW_SPI_SPEED 8000000 >> SD_SPI_SPEED
|
||||
#endif
|
||||
SPISettings SPI::spi_settings(CLCD_HW_SPI_SPEED, MSBFIRST, SPI_MODE0);
|
||||
#endif
|
||||
|
@ -151,7 +151,7 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream
|
||||
SERIAL_ECHO_MSG("Done playing video");
|
||||
|
||||
exit:
|
||||
spiInit(SPI_SPEED); // Restore default speed
|
||||
spiInit(SD_SPI_SPEED); // Restore default speed
|
||||
|
||||
// Since playing media overwrites RAMG, we need to reinitialize
|
||||
// everything that is stored in RAMG.
|
||||
|
Reference in New Issue
Block a user