🎨 Misc. cleanup

This commit is contained in:
Scott Lahteine 2023-03-28 05:39:35 -05:00
parent 70063fb652
commit de0cd66070
20 changed files with 43 additions and 26 deletions

View file

@ -69,7 +69,7 @@ public:
static bool isBusy();
static void Abort();
static void DataTransferBegin(uint16_t DataWidth = DATASIZE_16BIT);
static void DataTransferBegin(uint16_t DataWidth=DATASIZE_16BIT);
static void DataTransferEnd() { WRITE(TFT_CS_PIN, HIGH); SSP_Cmd(LPC_SSPx, DISABLE); };
static void DataTransferAbort();

View file

@ -52,7 +52,7 @@ public:
static bool isBusy();
static void Abort();
static void DataTransferBegin(uint16_t DataWidth = DATASIZE_16BIT);
static void DataTransferBegin(uint16_t DataWidth=DATASIZE_16BIT);
static void DataTransferEnd();
static void DataTransferAbort();

View file

@ -71,7 +71,7 @@ void TFT_FSMC::Init() {
Timing.DataLatency = 17;
Timing.AccessMode = FSMC_ACCESS_MODE_A;
// Write Timing
// Can be decreases from 8-15-8 to 0-0-1 with risk of stability loss
// Can be decreased from 8-15-8 to 0-0-1 with risk of stability loss
ExtTiming.AddressSetupTime = 8;
ExtTiming.AddressHoldTime = 15;
ExtTiming.DataSetupTime = 8;

View file

@ -31,6 +31,10 @@
#error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware."
#endif
#ifndef HAL_SRAM_MODULE_ENABLED
#error "SRAM module disabled for the STM32 framework (HAL_SRAM_MODULE_ENABLED)! Please consult the development team."
#endif
#ifndef LCD_READ_ID
#define LCD_READ_ID 0x04 // Read display identification information (0xD3 on ILI9341)
#endif
@ -69,8 +73,8 @@ class TFT_FSMC {
static bool isBusy();
static void Abort();
static void DataTransferBegin(uint16_t DataWidth = TFT_DATASIZE) {}
static void DataTransferEnd() {};
static void DataTransferBegin(uint16_t DataWidth=TFT_DATASIZE) {}
static void DataTransferEnd() {}
static void WriteData(uint16_t Data) { Transmit(tft_data_t(Data)); }
static void WriteReg(uint16_t Reg) { LCD->REG = tft_data_t(Reg); __DSB(); }

View file

@ -58,7 +58,7 @@ class TFT_LTDC {
static bool isBusy();
static void Abort() { /*__HAL_DMA_DISABLE(&DMAtx);*/ }
static void DataTransferBegin(uint16_t DataWidth = TFT_DATASIZE) {}
static void DataTransferBegin(uint16_t DataWidth=TFT_DATASIZE) {}
static void DataTransferEnd() {};
static void WriteData(uint16_t Data);

View file

@ -60,7 +60,7 @@ public:
static bool isBusy();
static void Abort();
static void DataTransferBegin(uint16_t DataWidth = DATASIZE_16BIT);
static void DataTransferBegin(uint16_t DataWidth=DATASIZE_16BIT);
static void DataTransferEnd() { WRITE(TFT_CS_PIN, HIGH); __HAL_SPI_DISABLE(&SPIx); };
static void DataTransferAbort();

View file

@ -77,7 +77,7 @@ static inline __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb
// Not every MarlinSerial port should handle emergency parsing.
// It would not make sense to parse GCode from TMC responses, for example.
constexpr bool serial_handles_emergency(int port) {
return false
return (false
#ifdef SERIAL_PORT
|| (SERIAL_PORT) == port
#endif
@ -87,7 +87,7 @@ constexpr bool serial_handles_emergency(int port) {
#ifdef LCD_SERIAL_PORT
|| (LCD_SERIAL_PORT) == port
#endif
;
);
}
#define DEFINE_HWSERIAL_MARLIN(name, n) \

View file

@ -136,8 +136,13 @@ bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data) {
}
bool SDIO_ReadBlock(uint32_t blockAddress, uint8_t *data) {
uint32_t retries = SDIO_READ_RETRIES;
while (retries--) if (SDIO_ReadBlock_DMA(blockAddress, data)) return true;
uint8_t retries = SDIO_READ_RETRIES;
while (retries--) {
if (SDIO_ReadBlock_DMA(blockAddress, data)) return true;
#if SD_RETRY_DELAY_MS
delay(SD_RETRY_DELAY_MS);
#endif
}
return false;
}

View file

@ -20,6 +20,8 @@
*
*/
#ifdef __STM32F1__
#include "../../../inc/MarlinConfig.h"
#if HAS_FSMC_TFT
@ -262,3 +264,5 @@ void TFT_FSMC::Transmit(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count)
}
#endif // HAS_FSMC_TFT
#endif // __STM32F1__

View file

@ -65,7 +65,7 @@ class TFT_FSMC {
static bool isBusy();
static void Abort();
static void DataTransferBegin(uint16_t DataWidth = DATASIZE_16BIT) {};
static void DataTransferBegin(uint16_t DataWidth=DATASIZE_16BIT) {};
static void DataTransferEnd() {};
static void WriteData(uint16_t Data) { Transmit(Data); }

View file

@ -20,6 +20,8 @@
*
*/
#ifdef __STM32F1__
#include "../../../inc/MarlinConfig.h"
#if HAS_SPI_TFT
@ -165,3 +167,5 @@ void TFT_SPI::Transmit(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count)
}
#endif // HAS_SPI_TFT
#endif // __STM32F1__

View file

@ -76,7 +76,7 @@ public:
static bool isBusy();
static void Abort();
static void DataTransferBegin(uint16_t DataWidth = DATA_SIZE_16BIT);
static void DataTransferBegin(uint16_t DataWidth=DATA_SIZE_16BIT);
static void DataTransferEnd() { WRITE(TFT_CS_PIN, HIGH); SPIx.end(); };
static void DataTransferAbort();

View file

@ -20,6 +20,8 @@
*
*/
#ifdef __STM32F1__
#include "../../../inc/MarlinConfig.h"
#if HAS_TFT_XPT2046 || HAS_RES_TOUCH_BUTTONS
@ -141,4 +143,6 @@ uint16_t XPT2046::SoftwareIO(uint16_t data) {
return result;
}
#endif // HAS_TFT_XPT2046
#endif // HAS_TFT_XPT2046 || HAS_RES_TOUCH_BUTTONS
#endif // __STM32F1__

View file

@ -91,4 +91,3 @@ Eject filament
- MMU <= 'E*Filament index*\n'
- MMU => 'ok\n'

View file

@ -62,7 +62,7 @@ public:
inline static void Abort() { io.Abort(); }
inline static uint32_t GetID() { return io.GetID(); }
inline static void DataTransferBegin(uint16_t DataWidth = DATASIZE_16BIT) { io.DataTransferBegin(DataWidth); }
inline static void DataTransferBegin(uint16_t DataWidth=DATASIZE_16BIT) { io.DataTransferBegin(DataWidth); }
inline static void DataTransferEnd() { io.DataTransferEnd(); }
inline static void WriteData(uint16_t Data) { io.WriteData(Data); }

View file

@ -435,7 +435,6 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
}
}
#endif // TOOL_SENSOR
#if ENABLED(SWITCHING_TOOLHEAD)

View file

@ -29,14 +29,10 @@
#define BOARD_INFO_NAME "VORON Design v2"
#define MOSFET_C_PIN 11
#include "pins_RAMPS.h"
//
// Heaters / Fans
//
#undef FAN0_PIN
#define MOSFET_C_PIN 11
#define FAN0_PIN 5 // Using the pin for the controller fan since controller fan is always on.
#define CONTROLLER_FAN_PIN 8
@ -50,6 +46,8 @@
#define E1_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan (same pin for both extruders since it's the same fan)
#endif
#include "pins_RAMPS.h"
//
// LCDs and Controllers
//