Clean up after changes

This commit is contained in:
Scott Lahteine 2020-07-25 01:53:07 -05:00
parent d20d459132
commit bc688f27dc
17 changed files with 88 additions and 94 deletions

View File

@ -2142,6 +2142,7 @@
// //
// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
// Upscaled 128x64 Marlin UI
// //
//#define FSMC_GRAPHICAL_TFT //#define FSMC_GRAPHICAL_TFT
@ -2149,17 +2150,11 @@
// TFT LVGL UI // TFT LVGL UI
// //
// Using default MKS icons and fonts from: https://git.io/JJvzK // Using default MKS icons and fonts from: https://git.io/JJvzK
// Just copy the `assets` folder from the build directory to the // Just copy the 'assets' folder from the build directory to the
// root of your SD card, together with the compiled firmware. // root of your SD card, together with the compiled firmware.
// //
// Robin nano v1.2 uses FSMC //#define TFT_LVGL_UI_FSMC // Robin nano v1.2 uses FSMC
// //#define TFT_LVGL_UI_SPI // Robin nano v2.0 uses SPI
//#define TFT_LVGL_UI_FSMC
// Robin nano v2.0 uses SPI
//
//#define TFT_LVGL_UI_SPI
//============================================================================= //=============================================================================
//============================ Other Controllers ============================ //============================ Other Controllers ============================

View File

@ -63,7 +63,7 @@ uint16_t HAL_adc_result;
void HAL_init() { void HAL_init() {
FastIO_init(); FastIO_init();
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT) && DISABLED(SDIO_SUPPORT)
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
#endif #endif

View File

@ -41,8 +41,7 @@
} }
bool SDIO_Init() { bool SDIO_Init() {
if (hsd.State == HAL_SD_STATE_READY) return 1; // return passing status return hsd.State == HAL_SD_STATE_READY; // return pass/fail status
return 0; // return failing status
} }
bool SDIO_ReadBlock(uint32_t block, uint8_t *src) { bool SDIO_ReadBlock(uint32_t block, uint8_t *src) {
@ -58,7 +57,6 @@
#else // !USBD_USE_CDC_COMPOSITE #else // !USBD_USE_CDC_COMPOSITE
// use local drivers // use local drivers
#if defined(STM32F103xE) || defined(STM32F103xG) #if defined(STM32F103xE) || defined(STM32F103xG)
#include <stm32f1xx_hal_rcc_ex.h> #include <stm32f1xx_hal_rcc_ex.h>
#include <stm32f1xx_hal_sd.h> #include <stm32f1xx_hal_sd.h>
@ -274,7 +272,6 @@
bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
hsd.Instance = SDIO; hsd.Instance = SDIO;
uint8_t retryCnt = SD_RETRY_COUNT; uint8_t retryCnt = SD_RETRY_COUNT;
bool status; bool status;
for (;;) { for (;;) {
status = (bool) HAL_SD_WriteBlocks(&hsd, (uint8_t*)src, block, 1, 500); // write one 512 byte block with 500mS timeout status = (bool) HAL_SD_WriteBlocks(&hsd, (uint8_t*)src, block, 1, 500); // write one 512 byte block with 500mS timeout

View File

@ -64,12 +64,14 @@ void FastIO_init(); // Must be called before using fast io macros
#define _GET_MODE(IO) #define _GET_MODE(IO)
#define _SET_MODE(IO,M) pinMode(IO, M) #define _SET_MODE(IO,M) pinMode(IO, M)
#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */ #define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */
#define _SET_OUTPUT_OD(IO) pinMode(IO, OUTPUT_OPEN_DRAIN)
#define WRITE(IO,V) _WRITE(IO,V) #define WRITE(IO,V) _WRITE(IO,V)
#define READ(IO) _READ(IO) #define READ(IO) _READ(IO)
#define TOGGLE(IO) _TOGGLE(IO) #define TOGGLE(IO) _TOGGLE(IO)
#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) #define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
#define OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0)
#define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */ #define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */
#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */ #define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */

View File

@ -27,3 +27,8 @@
#elif EITHER(I2C_EEPROM, SPI_EEPROM) #elif EITHER(I2C_EEPROM, SPI_EEPROM)
#define USE_SHARED_EEPROM 1 #define USE_SHARED_EEPROM 1
#endif #endif
// Allow SDSUPPORT to be disabled
#if DISABLED(SDSUPPORT)
#undef SDIO_SUPPORT
#endif

View File

@ -29,10 +29,6 @@
#error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue." #error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue."
#endif #endif
#if ENABLED(SDIO_SUPPORT) && DISABLED(SDSUPPORT)
#error "SDIO_SUPPORT requires SDSUPPORT. Enable SDSUPPORT to continue."
#endif
#if ENABLED(FAST_PWM_FAN) #if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform." #error "FAST_PWM_FAN is not yet implemented for this platform."
#endif #endif

View File

@ -72,12 +72,14 @@ uint8_t sel_id = 0;
const uint16_t nr = SD_ORDER(i, fileCnt); const uint16_t nr = SD_ORDER(i, fileCnt);
card.getfilename_sorted(nr); card.getfilename_sorted(nr);
if (card.flag.filenameIsDir) if (card.flag.filenameIsDir) {
//SERIAL_ECHOLN(card.longest_filename); //SERIAL_ECHOLN(card.longest_filename);
list_file.IsFolder[valid_name_cnt] = 1; list_file.IsFolder[valid_name_cnt] = 1;
else }
else {
//SERIAL_ECHOLN(card.longFilename); //SERIAL_ECHOLN(card.longFilename);
list_file.IsFolder[valid_name_cnt] = 0; list_file.IsFolder[valid_name_cnt] = 0;
}
#if 1 #if 1
// //
@ -523,7 +525,7 @@ void lv_gcode_file_read(uint8_t *data_buf) {
//Color = (*p_index >> 8); //Color = (*p_index >> 8);
//*p_index = Color | ((*p_index & 0xff) << 8); //*p_index = Color | ((*p_index & 0xff) << 8);
i += 2; i += 2;
if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // 0x18C3; // if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // 0x18C3;
} }
#endif // TFT_LVGL_UI_SPI #endif // TFT_LVGL_UI_SPI
memcpy(data_buf, public_buf, 200); memcpy(data_buf, public_buf, 200);

View File

@ -820,7 +820,7 @@ char *creat_title_text() {
} }
if (i >= 8000) break; if (i >= 8000) break;
} }
#endif // if ENABLED(TFT_LVGL_UI_SPI) #endif // TFT_LVGL_UI_SPI
y_off++; y_off++;
} }
W25QXX.init(SPI_QUARTER_SPEED); W25QXX.init(SPI_QUARTER_SPEED);
@ -841,7 +841,7 @@ char *creat_title_text() {
} }
#endif #endif
} }
#endif // if HAS_GCODE_PREVIEW #endif // HAS_GCODE_PREVIEW
void print_time_run() { void print_time_run() {
static uint8_t lastSec = 0; static uint8_t lastSec = 0;

View File

@ -253,9 +253,8 @@
#define BEEPER_PIN PC5 #define BEEPER_PIN PC5
#define BTN_ENC PE13 #define BTN_ENC PE13
#else #elif ENABLED(TFT_LITTLE_VGL_UI)
#if ENABLED(TFT_LITTLE_VGL_UI)
//FSMC LCD
#define FSMC_CS_PIN PD7 // NE4 #define FSMC_CS_PIN PD7 // NE4
#define FSMC_RS_PIN PD11 // A0 #define FSMC_RS_PIN PD11 // A0
@ -266,9 +265,7 @@
#define LCD_BACKLIGHT_PIN PD13 #define LCD_BACKLIGHT_PIN PD13
#endif // TFT_LITTLE_VGL_UI #endif
#endif // TFT_LVGL_UI_SPI
#if HAS_SPI_LCD #if HAS_SPI_LCD