Skip to content

Commit

Permalink
STM32F1xx support for TFTGLCD (MarlinFirmware#20515)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhiy-K authored and dpreed committed Feb 5, 2021
1 parent fd9b059 commit 4b67f30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,12 @@

MeshFlags done_flags{0};
const xy_int8_t &lpos = location.pos;

#if IS_TFTGLCD_PANEL
lcd_mesh_edit_setup(0); // Change current screen before calling ui.ubl_plot
safe_delay(50);
#endif

do {
location = find_closest_mesh_point_of_type(SET_IN_BITMAP, pos, false, &done_flags);

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* and supports color output.
*/

#if NONE(__AVR__, TARGET_LPC1768, __STM32F1__, STM32F4xx)
#if NONE(__AVR__, TARGET_LPC1768, STM32F1, STM32F4xx)
#warning "Selected platform not yet tested. Please contribute your good pin mappings."
#endif

Expand Down Expand Up @@ -129,7 +129,7 @@ static uint8_t PanelDetected = 0;
#if ANY(__AVR__, TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
#define SPI_SEND_ONE(V) SPI.transfer(V);
#define SPI_SEND_TWO(V) SPI.transfer16(V);
#elif defined(STM32F4xx)
#elif EITHER(STM32F4xx, STM32F1xx)
#define SPI_SEND_ONE(V) SPI.transfer(V, SPI_CONTINUE);
#define SPI_SEND_TWO(V) SPI.transfer16(V, SPI_CONTINUE);
#elif defined(ARDUINO_ARCH_ESP32)
Expand All @@ -139,7 +139,7 @@ static uint8_t PanelDetected = 0;

#if ANY(__AVR__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
#define SPI_SEND_SOME(V,L,Z) SPI.transfer(&V[Z], L);
#elif defined(STM32F4xx)
#elif EITHER(STM32F4xx, STM32F1xx)
#define SPI_SEND_SOME(V,L,Z) SPI.transfer(&V[Z], L, SPI_CONTINUE);
#elif ANY(TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_ESP32)
#define SPI_SEND_SOME(V,L,Z) do{ for (uint16_t i = 0; i < L; i++) SPI_SEND_ONE(V[(Z)+i]); }while(0)
Expand Down Expand Up @@ -276,7 +276,7 @@ uint8_t MarlinUI::read_slow_buttons(void) {
Wire.endTransmission();
#ifdef __AVR__
Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 2, 0, 0, 1);
#elif defined(__STM32F1__)
#elif defined(STM32F1)
Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, (uint8_t)2);
#elif EITHER(STM32F4xx, TARGET_LPC1768)
Wire.requestFrom(LCD_I2C_ADDRESS, 2);
Expand Down Expand Up @@ -330,7 +330,7 @@ void MarlinUI::init_lcd() {
Wire.endTransmission(); // send buffer
#ifdef __AVR__
Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 1, 0, 0, 1);
#elif ANY(__STM32F1__, STM32F4xx, TARGET_LPC1768)
#elif ANY(STM32F1, STM32F4xx, TARGET_LPC1768)
Wire.requestFrom(LCD_I2C_ADDRESS, 1);
#endif
t = (uint8_t)Wire.read();
Expand Down Expand Up @@ -626,7 +626,7 @@ Equal to 20x10 text LCD
| ttc ttc % | ttc - current temperature
| tts tts %%% | tts - setted temperature, %%% - percent for FAN
| ICO ICO ICO ICO | ICO - icon 48x48, placed in 2 text lines
| ICO ICO ICO ICO | ICO /
| ICO ICO ICO ICO | ICO
or
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/pins/stm32f1/pins_MORPHEUS.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* MORPHEUS Board pin assignments
*/

#if NOT_TARGET(__STM32F1__)
#if NOT_TARGET(__STM32F1__, STM32F1xx)
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
#endif

Expand Down Expand Up @@ -90,3 +90,4 @@
#define LED_PIN PC13
#define SDSS PA3
#define TFTGLCD_CS PA4
#define SD_DETECT_PIN PC14

0 comments on commit 4b67f30

Please sign in to comment.