Skip to content

Commit

Permalink
Fixes for TFTGLCD Panel, FastIO (#19614)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhiy-K authored and thinkyhead committed Oct 16, 2020
1 parent 958f05e commit 887e263
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 157 deletions.
8 changes: 4 additions & 4 deletions Marlin/src/HAL/STM32/fastio.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void FastIO_init(); // Must be called before using fast io macros

#define _GET_MODE(IO)
#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)
Expand All @@ -73,9 +73,9 @@ void FastIO_init(); // Must be called before using fast io macros
#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_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */
#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */
#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_PULLDOWN(IO) _SET_MODE(IO, INPUT_PULLDOWN) //!< Input with Pull-down activation
#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW)
#define SET_PWM(IO) _SET_MODE(IO, PWM)

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
#define LCD_STR_C STR_C
#define LCD_STR_E STR_E

#if HAS_MARLINUI_HD44780
#if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)

// Custom characters defined in the first 8 characters of the LCD
#define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class restorer {
inline void restore() { ref_ = val_; }
};

#define REMEMBER(N,X,V...) restorer<typeof(X)> restorer_##N(X, ##V)
#define REMEMBER(N,X,V...) restorer<__typeof__(X)> restorer_##N(X, ##V)
#define RESTORE(N) restorer_##N.restore()

// Converts from an uint8_t in the range of 0-255 to an uint8_t
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@
#define LCD_PROGRESS_BAR
#endif
#if ENABLED(TFTGLCD_PANEL_I2C)
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD for I2C and SPI buses (LiquidTWI2 not required)
#define LCD_I2C_ADDRESS 0x27 // Must be equal to panel's I2C slave addres
#endif
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD, used for both I2C and SPI buses (LiquidTWI2 not required)
#define STD_ENCODER_PULSES_PER_STEP 2
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#define LCD_WIDTH 20 // 20 or 24 chars in line
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2457,7 +2457,7 @@
/**
* Buzzer/Speaker
*/
#if PIN_EXISTS(BEEPER) || ANY(LCD_USE_I2C_BUZZER, PCA9632_BUZZER, IS_TFTGLCD_PANEL)
#if PIN_EXISTS(BEEPER) || ANY(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)
#define HAS_BUZZER 1
#if PIN_EXISTS(BEEPER)
#define USE_BEEPER 1
Expand Down
Loading

0 comments on commit 887e263

Please sign in to comment.