Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop OLED flip for TS80P #27

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,26 @@
#define FLASH_BOOTLDR_SIZE_KB 19
#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 109

#elif MODEL_TS80 || MODEL_TS80P
#elif MODEL_TS80P
#define GPIO_DFU_BOOT_PORT GPIOB
#define GPIO_DFU_BOOT_PIN 1
#define OLED_RESET_Pin 15
#define OLED_RESET_GPIO_Port GPIOA
#define FLASH_SIZE_KB 128
#define FLASH_BOOTLDR_SIZE_KB 16
#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 112
#define OLED_FLIP

#define OLED_INVERT_SCAN
#define OLED_FLIP_BUFFER
#elif MODEL_TS80
#define GPIO_DFU_BOOT_PORT GPIOB
#define GPIO_DFU_BOOT_PIN 1
#define OLED_RESET_Pin 15
#define OLED_RESET_GPIO_Port GPIOA
#define FLASH_SIZE_KB 128
#define FLASH_BOOTLDR_SIZE_KB 16
#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 112
#define OLED_INVERT_SCAN
#define OLED_FLIP_BUFFER
#elif MODEL_MHP30
#define GPIO_DFU_BOOT_PORT GPIOA
#define GPIO_DFU_BOOT_PIN 10
Expand Down
4 changes: 2 additions & 2 deletions src/oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ uint8_t oled_init_array[] = {
0x80, 0x52, /*Divide ratios*/
0x80, 0xA8, /*Set Multiplex Ratio*/
0x80, OLED_HEIGHT - 1, /*Vertical size - 1*/
#ifdef OLED_FLIP
#ifdef OLED_INVERT_SCAN
0x80, 0xC8, /*Set COM Scan direction backwards*/
#else
0x80, 0xC0, /*Set COM Scan direction*/
Expand Down Expand Up @@ -53,7 +53,7 @@ const uint8_t REFRESH_COMMANDS[] = {
OLED_GRAM_START, // Start
0x80, // Data
OLED_GRAM_END, // End
#ifdef OLED_FLIP
#ifdef OLED_INVERT_SCAN
// Set COM output scan direction (reverse mode, COM[N-1] to COM0)
0x80, 0xC8,
#else
Expand Down
3 changes: 2 additions & 1 deletion src/oled.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef OLED_H_
#define OLED_H_
#include "config.h"
#include "i2c_bb.h"
#include <stdint.h>

Expand All @@ -22,7 +23,7 @@
#define OLED_HEIGHT 16
#define OLED_VCOM_LAYOUT 0x02

#ifdef OLED_FLIP
#ifdef OLED_FLIP_BUFFER
#define OLED_GRAM_START 0 // Aligned to top left of buffer
#define OLED_GRAM_END 95
#define OLED_SEGMENT_MAP 0xA1
Expand Down