Skip to content

Commit

Permalink
Add: useLowClockDelay setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovyan03 committed Apr 7, 2019
1 parent bed6837 commit 7859236
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"name": "M5Stack"
},
"version": "0.2.8",
"version": "0.2.9",
"framework": "arduino",
"platforms": "espressif32",
"build": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=M5Stack_TreeView
version=0.2.8
version=0.2.9
author=lovyan03
maintainer=Lovyan <[email protected]>
sentence=TreeView Menu UI for M5Stack
Expand Down
6 changes: 3 additions & 3 deletions src/M5TreeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ M5TreeView::eCmd M5TreeView::checkInput() {
MenuItem* M5TreeView::update(bool redraw) {
if (millis() - _msec < 16) {
uint32_t freq = getCpuFrequencyMhz();
setCpuFrequencyMhz(getXtalFrequencyMhz() / 4);
if (useLowClockDelay) setCpuFrequencyMhz(getXtalFrequencyMhz() / 4);
delay(16 - (millis() - _msec));
setCpuFrequencyMhz(freq);
if (useLowClockDelay) setCpuFrequencyMhz(freq);
}

redraw |= _redraw;
Expand Down Expand Up @@ -170,7 +170,7 @@ MenuItem* M5TreeView::update(bool redraw) {
if (oldFocus != focusItem) {
scrollTarget(focusItem);
}
focusItem->onFocusLoop();
if (focusItem) focusItem->onFocusLoop();

return res;
}
Expand Down
1 change: 1 addition & 0 deletions src/MenuItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ bool MenuItem::useFACES = false;
bool MenuItem::useCardKB = false;
bool MenuItem::useJoyStick = false;
bool MenuItem::usePLUSEncoder = false;
bool MenuItem::useLowClockDelay = false;
bool MenuItem::swapBtnBC = false;

int16_t MenuItem::titleOffset = 14;
Expand Down
1 change: 1 addition & 0 deletions src/MenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class MenuItem {
static bool useCardKB;
static bool useJoyStick;
static bool usePLUSEncoder;
static bool useLowClockDelay;
static bool swapBtnBC;

static void setTextFont(int f) { gfxFont = NULL; font = f; }
Expand Down

0 comments on commit 7859236

Please sign in to comment.