usb and sdcard sharing improvements
* Add traceback after watchdog timeout Add the cpability to perform a traceback following a watchdog timeout. * Enhanced hardware SPI Allow use of either SSP0 or SSP1. Ensure that no data is left in I/O buffers after calls to enable sharing of SSP hardware. * Make flash emulation of eeprom the default Make use of flash for eeprom storage the default. This means that usage of eeprom will not cause USB drive mount/unmount operations. * Allow sharing of SD card SD card I/O operations from the USB stack take place in idle loop, rather than at interrupt time. Allowing sharing of the SPI bus. New configuration options to allow usage of the SD card to be specified. * Fix problem with hardware SPI pins
This commit is contained in:
committed by
Christopher Pepper
parent
5ddf52d58e
commit
870bfd08f5
@ -141,8 +141,6 @@
|
||||
// Misc. Functions
|
||||
//
|
||||
#define PS_ON_PIN P0_25 //TH3 Connector
|
||||
#define LPC_SOFTWARE_SPI // MKS_SBASE needs a software SPI because the
|
||||
// selected pins are not on a hardware SPI controller
|
||||
|
||||
/**
|
||||
* Smart LCD adapter
|
||||
@ -185,14 +183,77 @@
|
||||
#define ENET_TXD0 P1_00 // J12-11
|
||||
#define ENET_TXD1 P1_01 // J12-12
|
||||
|
||||
// A custom cable is needed. See the README file in the
|
||||
// Marlin\src\config\examples\Mks\Sbase directory
|
||||
|
||||
#define SCK_PIN P1_22 // J8-2 (moved from EXP2 P0.7)
|
||||
#define MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8)
|
||||
#define MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.5)
|
||||
#define SS_PIN P0_28
|
||||
#define SDSS P0_06
|
||||
/*
|
||||
* The SBase can share the on-board SD card with a PC via USB the following
|
||||
* definitions control this feature:
|
||||
*/
|
||||
//#define USB_SD_DISABLED
|
||||
#define USB_SD_ONBOARD
|
||||
|
||||
/*
|
||||
* There are a number of configurations available for the SBase SD card reader.
|
||||
* A custom cable can be used to allow access to the LCD based SD card.
|
||||
* A standard cable can be used for access to the LCD SD card (but no SD detect).
|
||||
* The onboard SD card can be used and optionally shared with a PC via USB.
|
||||
*/
|
||||
|
||||
//#define SBASE_SD_CUSTOM_CABLE // Use a custom cable to access the SD
|
||||
//#define SBASE_SD_LCD // Use the SD drive attached to the LCD
|
||||
#define SBASE_SD_ONBOARD // Use the SD drive on the control board
|
||||
|
||||
#ifdef SBASE_SD_CUSTOM_CABLE
|
||||
/**
|
||||
* A custom cable is needed. See the README file in the
|
||||
* Marlin\src\config\examples\Mks\Sbase directory
|
||||
* P0.27 is on EXP2 and the on-board SD card's socket. That means it can't be
|
||||
* used as the SD_DETECT for the LCD's SD card.
|
||||
*
|
||||
* The best solution is to use the custom cable to connect the LCD's SD_DETECT
|
||||
* to a pin NOT on EXP2.
|
||||
*
|
||||
* If you can't find a pin to use for the LCD's SD_DETECT then comment out
|
||||
* SD_DETECT_PIN entirely and remove that wire from the the custom cable.
|
||||
*/
|
||||
#define SD_DETECT_PIN P2_11 // J8-5 (moved from EXP2 P0.27)
|
||||
#define SCK_PIN P1_22 // J8-2 (moved from EXP2 P0.7)
|
||||
#define MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8)
|
||||
#define MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.9)
|
||||
#define SS_PIN P0_28 // Chip select for SD card used by Marlin
|
||||
#define ONBOARD_SD_CS P0_06 // Chip select for "System" SD card
|
||||
#define LPC_SOFTWARE_SPI // With a custom cable we need software SPI because the
|
||||
// selected pins are not on a hardware SPI controller
|
||||
#endif
|
||||
|
||||
#ifdef SBASE_SD_LCD
|
||||
// use standard cable and header, SPI and SD detect sre shared with on-board SD card
|
||||
// hardware SPI is used for both SD cards. The detect pin is shred between the
|
||||
// LCD and onboard SD readers so we disable it.
|
||||
#define SD_DETECT_PIN P0_27
|
||||
#undef SD_DETECT_PIN
|
||||
#define SCK_PIN P0_07
|
||||
#define MISO_PIN P0_08
|
||||
#define MOSI_PIN P0_09
|
||||
#define SS_PIN P0_28 // Chip select for SD card used by Marlin
|
||||
#define ONBOARD_SD_CS P0_06 // Chip select for "System" SD card
|
||||
#endif
|
||||
|
||||
#ifdef SBASE_SD_ONBOARD
|
||||
// The external SD card is not used. Hardware SPI is used to access the card.
|
||||
#ifdef USB_SD_ONBOARD
|
||||
// When sharing the SD card with a PC we want the menu options to
|
||||
// mount/unmount the card and refresh it. So we disable card detect.
|
||||
#define SHARED_SD_CARD
|
||||
#undef SD_DETECT_PIN
|
||||
#else
|
||||
#define SD_DETECT_PIN P0_27
|
||||
#endif
|
||||
#define SCK_PIN P0_07
|
||||
#define MISO_PIN P0_08
|
||||
#define MOSI_PIN P0_09
|
||||
#define SS_PIN P0_06 // Chip select for SD card used by Marlin
|
||||
#define ONBOARD_SD_CS P0_06 // Chip select for "System" SD card
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Example for trinamic drivers using the J8 connector on MKs Sbase.
|
||||
@ -237,18 +298,6 @@
|
||||
#define E0_SERIAL_RX_PIN P0_26 // TH4
|
||||
#endif
|
||||
|
||||
/**
|
||||
* P0.27 is on EXP2 and the on-board SD card's socket. That means it can't be
|
||||
* used as the SD_DETECT for the LCD's SD card.
|
||||
*
|
||||
* The best solution is to use the custom cable to connect the LCD's SD_DETECT
|
||||
* to a pin NOT on EXP2.
|
||||
*
|
||||
* If you can't find a pin to use for the LCD's SD_DETECT then comment out
|
||||
* SD_DETECT_PIN entirely and remove that wire from the the custom cable.
|
||||
*/
|
||||
#define SD_DETECT_PIN P2_11 // J8-5 (moved from EXP2 P0.27)
|
||||
|
||||
/**
|
||||
* PWMs
|
||||
*
|
||||
|
Reference in New Issue
Block a user