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

Animation non block #1347

Merged
merged 3 commits into from
Aug 12, 2022
Merged
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
12 changes: 10 additions & 2 deletions source/Core/Drivers/OLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Author: Ben V. Brown
*/

#include "Buttons.hpp"
#include "Translation.h"
#include "cmsis_os.h"
#include "configuration.h"
Expand Down Expand Up @@ -285,7 +286,10 @@ void OLED::transitionSecondaryFramebuffer(bool forwardNavigation) {
memmove(&secondStripPtr[newStart], &secondBackStripPtr[newEnd], progress);

refresh();
osDelay(TICKS_100MS / 5);
osDelay(TICKS_100MS / 7);
if (getButtonState() != BUTTON_NONE) {
return;
}
}
}

Expand Down Expand Up @@ -324,6 +328,10 @@ void OLED::transitionScrollDown() {

// Scroll the screen by changing display start line.
for (uint8_t current = startLine; current <= scrollTo; current++) {
if (getButtonState() != BUTTON_NONE) {
current = scrollTo;
}

// Set display start line (0x40~0x7F):
// X[5:0] - display start line value
uint8_t scrollCommandByte = 0b01000000 | (current & 0b00111111);
Expand All @@ -332,7 +340,7 @@ void OLED::transitionScrollDown() {
OLED_Setup_Array[8].val = scrollCommandByte;

I2C_CLASS::I2C_RegisterWrite(DEVICEADDR_OLED, 0x80, scrollCommandByte);
osDelay(TICKS_100MS / 5);
osDelay(TICKS_100MS / 7);
}
}

Expand Down