Skip to content

Commit

Permalink
Merge pull request #8341 from Bob-the-Kuhn/u8g-try-4-Arduino-IDE-comp…
Browse files Browse the repository at this point in the history
…atibility

2.0.x - U8G HAL LCD support - Arduino IDE compatibility
  • Loading branch information
Bob-the-Kuhn authored Nov 9, 2017
2 parents 95ea43b + d47fbf7 commit 10896b9
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_hw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
// #include "src/core/macros.h"
// #include "Configuration.h"

#include <lib/u8g.h>
#include <U8glib.h>

#define SPI_FULL_SPEED 0
#define SPI_HALF_SPEED 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

#ifdef TARGET_LPC1768

#include <lib/u8g.h>
#include <U8glib.h>

#define I2C_SLA (0x3c*2)
//#define I2C_CMD_MODE 0x080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

#ifdef TARGET_LPC1768

#include <lib/u8g.h>
#include <U8glib.h>

void delayMicroseconds(uint32_t us);
//void pinMode(int16_t pin, uint8_t mode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
// #include "src/core/macros.h"
// #include "Configuration.h"

#include <lib/u8g.h>
#include <U8glib.h>

#define SPI_FULL_SPEED 0
#define SPI_HALF_SPEED 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#ifdef TARGET_LPC1768

#include <lib/u8g.h>
#include <U8glib.h>

#include <lpc17xx_pinsel.h>

Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_sw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
#if defined (TARGET_LPC1768)


#include <lib/u8g.h>
#include <U8glib.h>

#include <lpc17xx_pinsel.h>
Expand Down
14 changes: 2 additions & 12 deletions Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
* beginning.
*/

#include <lib/u8g.h>
#include <src/lcd/dogm/HAL_LCD_com_defines.h>
#include <U8glib.h>
#include "HAL_LCD_com_defines.h"

#define WIDTH 128
#define HEIGHT 64
Expand Down Expand Up @@ -150,11 +150,6 @@ uint8_t u8g_dev_sh1106_128x64_2x_2_wire_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t m
}


uint8_t u8g_dev_sh1106_128x64_2x_buf[WIDTH*2] U8G_NOCOMMON ;
u8g_pb_t u8g_dev_sh1106_128x64_2x_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_sh1106_128x64_2x_buf};
u8g_dev_t u8g_dev_sh1106_128x64_2x_i2c = { u8g_dev_sh1106_128x64_2x_2_wire_fn, &u8g_dev_sh1106_128x64_2x_pb, U8G_COM_SSD_I2C_HAL };


uint8_t u8g_dev_sh1106_128x64_2x_i2c_2_wire_buf[WIDTH*2] U8G_NOCOMMON ;
u8g_pb_t u8g_dev_sh1106_128x64_2x_i2c_2_wire_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_sh1106_128x64_2x_i2c_2_wire_buf};
u8g_dev_t u8g_dev_sh1106_128x64_2x_i2c_2_wire = { u8g_dev_sh1106_128x64_2x_2_wire_fn, &u8g_dev_sh1106_128x64_2x_i2c_2_wire_pb, U8G_COM_SSD_I2C_HAL };
Expand Down Expand Up @@ -229,11 +224,6 @@ uint8_t u8g_dev_ssd1306_128x64_2x_2_wire_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t
}


uint8_t u8g_dev_ssd1306_128x64_2x_buf[WIDTH*2] U8G_NOCOMMON ;
u8g_pb_t u8g_dev_ssd1306_128x64_2x_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_ssd1306_128x64_2x_buf};
u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c = { u8g_dev_ssd1306_128x64_2x_2_wire_fn, &u8g_dev_ssd1306_128x64_2x_pb, U8G_COM_SSD_I2C_HAL };


uint8_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire_buf[WIDTH*2] U8G_NOCOMMON ;
u8g_pb_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_ssd1306_128x64_2x_i2c_2_wire_buf};
u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire = { u8g_dev_ssd1306_128x64_2x_2_wire_fn, &u8g_dev_ssd1306_128x64_2x_i2c_2_wire_pb, U8G_COM_SSD_I2C_HAL };
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
*/

#include <lib/u8g.h>
#include <U8glib.h>

#include <src/lcd/dogm/HAL_LCD_com_defines.h>
#include "HAL_LCD_com_defines.h"

#define WIDTH 128
#define HEIGHT 64
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
*/

#include <lib/u8g.h>
#include <U8glib.h>

#include <src/lcd/dogm/HAL_LCD_com_defines.h>
#include "HAL_LCD_com_defines.h"

#define WIDTH 128
#define HEIGHT 64
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#ifndef U8G_HAL_LINKS

#include <src/Marlin.h>
#include "../../Marlin.h"

//#if ENABLED(U8GLIB_ST7920)
//#if ( ENABLED(SHARED_SPI) || !ENABLED(SHARED_SPI) && (defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0) && (defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0))
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/ultralcd_impl_DOGM.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#endif

#include <U8glib.h>
#include <src/lcd/dogm/HAL_LCD_class_defines.h>
#include "dogm/HAL_LCD_class_defines.h"

#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../feature/bedlevel/ubl/ubl.h"
Expand Down
11 changes: 1 addition & 10 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env_default = megaatmega2560

[common]
lib_deps =

U8glib-HAL
[email protected]
https://github.com/lincomatic/LiquidTWI2.git
https://github.com/teemuatlut/TMC2130Stepper.git
Expand Down Expand Up @@ -51,7 +51,6 @@ board = megaatmega2560
build_flags = -I $BUILDSRC_DIR
board_f_cpu = 16000000L
lib_deps = ${common.lib_deps}
U8glib-HAL
src_filter = ${common.default_src_filter}

#
Expand All @@ -64,7 +63,6 @@ board = megaatmega1280
build_flags = -I $BUILDSRC_DIR
board_f_cpu = 16000000L
lib_deps = ${common.lib_deps}
U8glib-HAL
src_filter = ${common.default_src_filter}

#
Expand All @@ -76,7 +74,6 @@ framework = arduino
board = sanguino_atmega1284p
upload_speed = 57600
lib_deps = ${common.lib_deps}
U8glib-HAL
src_filter = ${common.default_src_filter}

#
Expand All @@ -91,7 +88,6 @@ framework = arduino
board = due
build_flags = -I $BUILDSRC_DIR
lib_deps = ${common.lib_deps}
U8glib-HAL
src_filter = ${common.default_src_filter}

#
Expand Down Expand Up @@ -154,7 +150,6 @@ board = reprap_rambo
build_flags = -I $BUILDSRC_DIR
board_f_cpu = 16000000L
lib_deps = ${common.lib_deps}
U8glib-HAL
src_filter = ${common.default_src_filter}

#
Expand All @@ -165,7 +160,6 @@ platform = atmelavr
framework = arduino
board = sanguino_atmega644p
lib_deps = ${common.lib_deps}
U8glib-HAL
src_filter = ${common.default_src_filter}

[env:STM32F1]
Expand All @@ -174,7 +168,6 @@ framework = arduino
board = genericSTM32F103RE
build_flags = !python Marlin/src/HAL/HAL_STM32F1/stm32f1_flag_script.py
lib_deps = ${common.lib_deps}
U8glib-HAL
src_filter = ${common.default_src_filter}

#
Expand All @@ -191,7 +184,6 @@ board = teensy20pp
build_flags = -I $BUILDSRC_DIR
#board_f_cpu = 20000000L ; Bug in Arduino framework disallows boards running at 20Mhz
lib_deps = ${common.lib_deps}
U8glib-HAL
src_filter = ${common.default_src_filter}

#
Expand All @@ -203,6 +195,5 @@ framework = arduino
board = teensy35
build_flags = -I $BUILDSRC_DIR
lib_deps = ${common.lib_deps}
U8glib-HAL
lib_ignore = Adafruit NeoPixel
src_filter = ${common.default_src_filter}

0 comments on commit 10896b9

Please sign in to comment.