forked from mirror/qmk_firmware
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@@ -146,7 +146,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// parts of the display unusable or don't get cleared correctly
|
||||
// and also allows for drawing & inverting
|
||||
uint8_t oled_buffer[OLED_MATRIX_SIZE];
|
||||
uint8_t * oled_cursor;
|
||||
uint8_t *oled_cursor;
|
||||
OLED_BLOCK_TYPE oled_dirty = 0;
|
||||
bool oled_initialized = false;
|
||||
bool oled_active = false;
|
||||
@@ -301,24 +301,18 @@ bool oled_init(oled_rotation_t rotation) {
|
||||
oled_driver_init();
|
||||
|
||||
static const uint8_t PROGMEM display_setup1[] = {
|
||||
I2C_CMD,
|
||||
DISPLAY_OFF,
|
||||
DISPLAY_CLOCK,
|
||||
OLED_DISPLAY_CLOCK,
|
||||
MULTIPLEX_RATIO,
|
||||
I2C_CMD, DISPLAY_OFF, DISPLAY_CLOCK, OLED_DISPLAY_CLOCK, MULTIPLEX_RATIO,
|
||||
#if OLED_IC_COM_PINS_ARE_COLUMNS
|
||||
OLED_DISPLAY_WIDTH - 1,
|
||||
#else
|
||||
OLED_DISPLAY_HEIGHT - 1,
|
||||
#endif
|
||||
#if OLED_IC == OLED_IC_SH1107
|
||||
SH1107_DISPLAY_START_LINE,
|
||||
0x00,
|
||||
SH1107_DISPLAY_START_LINE, 0x00,
|
||||
#else
|
||||
DISPLAY_START_LINE | 0x00,
|
||||
#endif
|
||||
CHARGE_PUMP,
|
||||
0x14,
|
||||
CHARGE_PUMP, 0x14,
|
||||
#if OLED_IC_HAS_HORIZONTAL_MODE
|
||||
// MEMORY_MODE is unsupported on SH1106 (Page Addressing only)
|
||||
MEMORY_MODE,
|
||||
|
||||
@@ -53,12 +53,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 56, 48, 40, 32, 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
|
||||
# endif
|
||||
// If OLED_BLOCK_TYPE is uint32_t, these tables would look like:
|
||||
// #define OLED_SOURCE_MAP { 32, 40, 48, 56 }
|
||||
@@ -97,12 +95,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# endif
|
||||
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {24, 16, 8, 0}
|
||||
# endif
|
||||
|
||||
#elif defined(OLED_DISPLAY_64X48)
|
||||
@@ -132,12 +128,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# endif
|
||||
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8 }
|
||||
# define OLED_SOURCE_MAP {0, 8}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 8, 0 }
|
||||
# define OLED_TARGET_MAP {8, 0}
|
||||
# endif
|
||||
|
||||
#elif defined(OLED_DISPLAY_64X128)
|
||||
@@ -170,12 +164,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# endif
|
||||
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 56, 48, 40, 32, 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
|
||||
# endif
|
||||
|
||||
#elif defined(OLED_DISPLAY_128X128)
|
||||
@@ -208,12 +200,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 56, 48, 40, 32, 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
|
||||
# endif
|
||||
#else // defined(OLED_DISPLAY_128X64)
|
||||
// Default 128x32
|
||||
@@ -242,12 +232,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {24, 16, 8, 0}
|
||||
# endif
|
||||
// If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
|
||||
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||
|
||||
Reference in New Issue
Block a user