Skip to content

Commit

Permalink
Update OLED fade define names
Browse files Browse the repository at this point in the history
  • Loading branch information
Barabas5532 committed Apr 30, 2021
1 parent ad46312 commit 18b29b2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
34 changes: 17 additions & 17 deletions docs/feature_oled_driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,23 +136,23 @@ void oled_task_user(void) {

## Basic Configuration

|Define |Default |Description |
|-----------------------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------|
|`OLED_DISPLAY_ADDRESS` |`0x3C` |The i2c address of the OLED Display |
|`OLED_FONT_H` |`"glcdfont.c"` |The font code file to use for custom fonts |
|`OLED_FONT_START` |`0` |The starting character index for custom fonts |
|`OLED_FONT_END` |`223` |The ending character index for custom fonts |
|`OLED_FONT_WIDTH` |`6` |The font width |
|`OLED_FONT_HEIGHT` |`8` |The font height (untested) |
|`OLED_TIMEOUT` |`60000` |Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
|`OLED_DRIVER_DISPLAY_FADE` |*Not defined* |Enables fade out animation. Use together with `OLED_TIMEOUT`. |
|`OLED_DRIVER_DISPLAY_FADE_INTERVAL`|`0` |The speed of fade out animation, from 0 to 15. Larger values are slower. |
|`OLED_SCROLL_TIMEOUT` |`0` |Scrolls the OLED screen after 0ms of OLED inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
|`OLED_SCROLL_TIMEOUT_RIGHT` |*Not defined* |Scroll timeout direction is right when defined, left when undefined. |
|`OLED_IC` |`OLED_IC_SSD1306`|Set to `OLED_IC_SH1106` if you're using the SH1106 OLED controller. |
|`OLED_COLUMN_OFFSET` |`0` |(SH1106 only.) Shift output to the right this many pixels.<br />Useful for 128x64 displays centered on a 132x64 SH1106 IC.|
|`OLED_BRIGHTNESS` |`255` |The default brightness level of the OLED, from 0 to 255. |
|`OLED_UPDATE_INTERVAL` |`0` |Set the time interval for updating the OLED display in ms. This will improve the matrix scan rate. |
|Define |Default |Description |
|---------------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------|
|`OLED_DISPLAY_ADDRESS` |`0x3C` |The i2c address of the OLED Display |
|`OLED_FONT_H` |`"glcdfont.c"` |The font code file to use for custom fonts |
|`OLED_FONT_START` |`0` |The starting character index for custom fonts |
|`OLED_FONT_END` |`223` |The ending character index for custom fonts |
|`OLED_FONT_WIDTH` |`6` |The font width |
|`OLED_FONT_HEIGHT` |`8` |The font height (untested) |
|`OLED_TIMEOUT` |`60000` |Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
|`OLED_FADE_OUT` |*Not defined* |Enables fade out animation. Use together with `OLED_TIMEOUT`. |
|`OLED_FADE_OUT_INTERVAL` |`0` |The speed of fade out animation, from 0 to 15. Larger values are slower. |
|`OLED_SCROLL_TIMEOUT` |`0` |Scrolls the OLED screen after 0ms of OLED inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
|`OLED_SCROLL_TIMEOUT_RIGHT`|*Not defined* |Scroll timeout direction is right when defined, left when undefined. |
|`OLED_IC` |`OLED_IC_SSD1306`|Set to `OLED_IC_SH1106` if you're using the SH1106 OLED controller. |
|`OLED_COLUMN_OFFSET` |`0` |(SH1106 only.) Shift output to the right this many pixels.<br />Useful for 128x64 displays centered on a 132x64 SH1106 IC.|
|`OLED_BRIGHTNESS` |`255` |The default brightness level of the OLED, from 0 to 255. |
|`OLED_UPDATE_INTERVAL` |`0` |Set the time interval for updating the OLED display in ms. This will improve the matrix scan rate. |

## 128x64 & Custom sized OLED Displays

Expand Down
6 changes: 3 additions & 3 deletions drivers/oled/oled_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ bool oled_on(void) {
#endif

static const uint8_t PROGMEM display_on[] =
#ifdef OLED_DRIVER_DISPLAY_FADE
#ifdef OLED_FADE_OUT
{I2C_CMD, FADE_BLINK, 0x00};
#else
{I2C_CMD, DISPLAY_ON};
Expand All @@ -575,8 +575,8 @@ bool oled_off(void) {
}

static const uint8_t PROGMEM display_off[] =
#ifdef OLED_DRIVER_DISPLAY_FADE
{I2C_CMD, FADE_BLINK, ENABLE_FADE | OLED_DRIVER_DISPLAY_FADE_INTERVAL};
#ifdef OLED_FADE_OUT
{I2C_CMD, FADE_BLINK, ENABLE_FADE | OLED_FADE_OUT_INTERVAL};
#else
{I2C_CMD, DISPLAY_OFF};
#endif
Expand Down
8 changes: 4 additions & 4 deletions drivers/oled/oled_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# endif
#endif

#if !defined(OLED_DRIVER_DISPLAY_FADE_INTERVAL)
# define OLED_DRIVER_DISPLAY_FADE_INTERVAL 0x00
#if !defined(OLED_FADE_OUT_INTERVAL)
# define OLED_FADE_OUT_INTERVAL 0x00
#endif

#if OLED_DRIVER_DISPLAY_FADE_INTERVAL > 0x0F || OLED_DRIVER_DISPLAY_FADE_INTERVAL < 0x00
# error OLED_DRIVER_DISPLAY_FADE_INTERVAL must be between 0x00 and 0x0F
#if OLED_FADE_OUT_INTERVAL > 0x0F || OLED_FADE_OUT_INTERVAL < 0x00
# error OLED_FADE_OUT_INTERVAL must be between 0x00 and 0x0F
#endif

#if !defined(OLED_I2C_TIMEOUT)
Expand Down

0 comments on commit 18b29b2

Please sign in to comment.