|
@@ -108,6 +108,9 @@ bool oled_active = false;
|
|
|
bool oled_scrolling = false;
|
|
|
uint8_t oled_rotation = 0;
|
|
|
uint8_t oled_rotation_width = 0;
|
|
|
+uint8_t oled_scroll_speed = 0;
|
|
|
+uint8_t oled_scroll_start = 0;
|
|
|
+uint8_t oled_scroll_end = 7;
|
|
|
#if OLED_TIMEOUT > 0
|
|
|
uint32_t oled_timeout;
|
|
|
#endif
|
|
@@ -515,12 +518,37 @@ bool oled_off(void) {
|
|
|
return !oled_active;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+void oled_scroll_set_area(uint8_t start_line, uint8_t end_line) {
|
|
|
+ oled_scroll_start = start_line;
|
|
|
+ oled_scroll_end = end_line;
|
|
|
+}
|
|
|
+
|
|
|
+void oled_scroll_set_speed(uint8_t speed) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ static const uint8_t scroll_remap[8] = {7, 4, 5, 0, 6, 1, 2, 3};
|
|
|
+ oled_scroll_speed = scroll_remap[speed];
|
|
|
+}
|
|
|
+
|
|
|
bool oled_scroll_right(void) {
|
|
|
|
|
|
|
|
|
if (!oled_dirty && !oled_scrolling) {
|
|
|
- static const uint8_t PROGMEM display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL};
|
|
|
- if (I2C_TRANSMIT_P(display_scroll_right) != I2C_STATUS_SUCCESS) {
|
|
|
+ uint8_t display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL};
|
|
|
+ if (I2C_TRANSMIT(display_scroll_right) != I2C_STATUS_SUCCESS) {
|
|
|
print("oled_scroll_right cmd failed\n");
|
|
|
return oled_scrolling;
|
|
|
}
|
|
@@ -533,8 +561,8 @@ bool oled_scroll_left(void) {
|
|
|
|
|
|
|
|
|
if (!oled_dirty && !oled_scrolling) {
|
|
|
- static const uint8_t PROGMEM display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL};
|
|
|
- if (I2C_TRANSMIT_P(display_scroll_left) != I2C_STATUS_SUCCESS) {
|
|
|
+ uint8_t display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL};
|
|
|
+ if (I2C_TRANSMIT(display_scroll_left) != I2C_STATUS_SUCCESS) {
|
|
|
print("oled_scroll_left cmd failed\n");
|
|
|
return oled_scrolling;
|
|
|
}
|