Skip to content

Commit

Permalink
@reaper7 fixes (see #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobozo committed Mar 20, 2018
1 parent afc4994 commit 7c3cd8b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/M5Stack-SD-Menu/M5Stack-SD-Menu.ino
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
* but provided as an example for custom controls.
*
*/
#define USE_PSP_JOY true
// #define USE_PSP_JOY true
#ifdef USE_PSP_JOY
#include "joyPSP.h"
#endif
Expand Down Expand Up @@ -126,15 +126,15 @@ void getMeta(String metaFileName, JSONMeta &jsonMeta) {

void renderScroll(String &scrollText, uint8_t x, uint8_t y, uint16_t width) {
if(scrollText=="") return;
unsigned long now = millis();
//unsigned long now = millis();
if(lastScrollRender+60>millis()) return;
M5.Lcd.setTextSize(2);
//lastScrollRender = now;
int16_t textWidth = M5.Lcd.textWidth(scrollText);
int16_t vsize = 0;
String scrollMe = "";
int16_t vpos;
uint8_t csize, lastcsize;
uint8_t csize = 0, lastcsize = 0;

scrollPointer-=1;
if(scrollPointer<-textWidth) {
Expand Down Expand Up @@ -186,11 +186,6 @@ void renderScroll(String &scrollText, uint8_t x, uint8_t y, uint16_t width) {
}


/* by menu ID */
void renderIcon(uint16_t MenuID) {
renderIcon(fileInfo[MenuID]);
}

/* by file info */
void renderIcon(FileInfo &fileInfo) {
if(!fileInfo.hasMeta || !fileInfo.hasIcon) {
Expand All @@ -200,6 +195,11 @@ void renderIcon(FileInfo &fileInfo) {
M5.Lcd.drawJpgFile(SD, fileInfo.iconName.c_str(), M5.Lcd.width()-jsonMeta.width-10, (M5.Lcd.height()/2)-(jsonMeta.height/2)+10, jsonMeta.width, jsonMeta.height, 0, 0, JPEG_DIV_NONE);
}

/* by menu ID */
void renderIcon(uint16_t MenuID) {
renderIcon(fileInfo[MenuID]);
}


void renderMeta(JSONMeta &jsonMeta) {
M5.Lcd.setTextSize(1);
Expand Down

0 comments on commit 7c3cd8b

Please sign in to comment.