Classic UI BIQU BX (#24387)

This commit is contained in:
Victor Oliveira 2022-06-23 06:18:36 -03:00 committed by Scott Lahteine
parent 010fbcccf7
commit dd68461bb1
5 changed files with 34 additions and 25 deletions

View file

@ -1389,7 +1389,8 @@
#elif ENABLED(TFT_RES_1024x600) #elif ENABLED(TFT_RES_1024x600)
#define TFT_WIDTH 1024 #define TFT_WIDTH 1024
#define TFT_HEIGHT 600 #define TFT_HEIGHT 600
#define GRAPHICAL_TFT_UPSCALE 4 #define GRAPHICAL_TFT_UPSCALE 6
#define TFT_PIXEL_OFFSET_X 120
#endif #endif
// FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi|ltdc).h // FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi|ltdc).h

View file

@ -2829,8 +2829,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif #endif
#endif #endif
#if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 4) #if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 6)
#error "GRAPHICAL_TFT_UPSCALE must be 2, 3, or 4." #error "GRAPHICAL_TFT_UPSCALE must be between 2 and 6."
#endif #endif
#if BOTH(CHIRON_TFT_STANDARD, CHIRON_TFT_NEW) #if BOTH(CHIRON_TFT_STANDARD, CHIRON_TFT_NEW)

View file

@ -124,7 +124,7 @@
#ifndef U8G_COM_SSD_I2C_HAL #ifndef U8G_COM_SSD_I2C_HAL
#define U8G_COM_SSD_I2C_HAL u8g_com_null_fn #define U8G_COM_SSD_I2C_HAL u8g_com_null_fn
#endif #endif
#if HAS_FSMC_GRAPHICAL_TFT || HAS_SPI_GRAPHICAL_TFT #if HAS_FSMC_GRAPHICAL_TFT || HAS_SPI_GRAPHICAL_TFT || HAS_LTDC_GRAPHICAL_TFT
uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
#define U8G_COM_HAL_TFT_FN u8g_com_hal_tft_fn #define U8G_COM_HAL_TFT_FN u8g_com_hal_tft_fn
#else #else

View file

@ -68,26 +68,31 @@ uint8_t TouchButtons::read_buttons() {
#ifdef HAS_WIRED_LCD #ifdef HAS_WIRED_LCD
int16_t x, y; int16_t x, y;
const bool is_touched = (TERN(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration.orientation, TOUCH_ORIENTATION) == TOUCH_PORTRAIT ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y)); #if ENABLED(TFT_TOUCH_DEVICE_XPT2046)
#if HAS_TOUCH_SLEEP const bool is_touched = (TERN(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration.orientation, TOUCH_ORIENTATION) == TOUCH_PORTRAIT ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y));
if (is_touched) #if HAS_TOUCH_SLEEP
wakeUp(); if (is_touched)
else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen()) wakeUp();
sleepTimeout(); else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen())
#endif sleepTimeout();
if (!is_touched) return 0; #endif
if (!is_touched) return 0;
#if ENABLED(TOUCH_SCREEN_CALIBRATION) #if ENABLED(TOUCH_SCREEN_CALIBRATION)
const calibrationState state = touch_calibration.get_calibration_state(); const calibrationState state = touch_calibration.get_calibration_state();
if (WITHIN(state, CALIBRATION_TOP_LEFT, CALIBRATION_BOTTOM_RIGHT)) { if (WITHIN(state, CALIBRATION_TOP_LEFT, CALIBRATION_BOTTOM_RIGHT)) {
if (touch_calibration.handleTouch(x, y)) ui.refresh(); if (touch_calibration.handleTouch(x, y)) ui.refresh();
return 0; return 0;
} }
x = int16_t((int32_t(x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x; x = int16_t((int32_t(x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x;
y = int16_t((int32_t(y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y; y = int16_t((int32_t(y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y;
#else #else
x = uint16_t((uint32_t(x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; x = uint16_t((uint32_t(x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X;
y = uint16_t((uint32_t(y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; y = uint16_t((uint32_t(y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y;
#endif
#elif ENABLED(TFT_TOUCH_DEVICE_GT911)
bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? touchIO.getPoint(&y, &x) : touchIO.getPoint(&x, &y));
if (!is_touched) return 0;
#endif #endif
// Touch within the button area simulates an encoder button // Touch within the button area simulates an encoder button

View file

@ -33,6 +33,7 @@
#define MARLIN_EEPROM_SIZE 0x1000 // 4K (24C32) #define MARLIN_EEPROM_SIZE 0x1000 // 4K (24C32)
#define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support
//#define SWD_DEBUG // Use pins PA13 and PA14 on STM32H7 for the SWD debugger
// //
// Limit Switches // Limit Switches
@ -47,8 +48,10 @@
#define FIL_RUNOUT_PIN PD13 #define FIL_RUNOUT_PIN PD13
#define FIL_RUNOUT2_PIN PB13 #define FIL_RUNOUT2_PIN PB13
#define LED_PIN PA13 #ifndef SWD_DEBUG
#define BEEPER_PIN PA14 #define LED_PIN PA13
#define BEEPER_PIN PA14
#endif
#define POWER_MONITOR_PIN PB0 #define POWER_MONITOR_PIN PB0
#define RPI_POWER_PIN PE5 #define RPI_POWER_PIN PE5