Skip to content

Instantly share code, notes, and snippets.

@tanakamasayuki
Last active November 23, 2020 06:16
Show Gist options
  • Save tanakamasayuki/5ecf73b9851f8f2f84521cfe1ab076e4 to your computer and use it in GitHub Desktop.
Save tanakamasayuki/5ecf73b9851f8f2f84521cfe1ab076e4 to your computer and use it in GitHub Desktop.
#include "M5Lite.h"
static LGFX_Sprite sprite[2](&M5Lite.Lcd);
void setup() {
unsigned long startTime;
unsigned long endTime;
M5Lite.begin();
sprite[0].setPsram(false);
sprite[0].createSprite(320, 80);
sprite[1].setPsram(false);
sprite[1].createSprite(320, 80);
M5Lite.Lcd.clear();
Serial.print("pushSprite() + startWrite(): ");
startTime = micros();
M5Lite.Lcd.startWrite();
unsigned long time1 = micros();
sprite[0].fillScreen(TFT_RED);
unsigned long time2 = micros();
sprite[0].pushSprite(0, 0);
unsigned long time3 = micros();
M5Lite.Lcd.waitDMA();
unsigned long time4 = micros();
sprite[1].fillScreen(TFT_BLUE);
unsigned long time5 = micros();
sprite[1].pushSprite(0, 80);
unsigned long time6 = micros();
M5Lite.Lcd.waitDMA();
unsigned long time7 = micros();
sprite[0].fillScreen(TFT_RED);
unsigned long time8 = micros();
sprite[0].pushSprite(0, 160);
unsigned long time9 = micros();
M5Lite.Lcd.waitDMA();
unsigned long time10 = micros();
M5Lite.Lcd.endWrite();
unsigned long time11 = micros();
endTime = micros();
Serial.println(endTime - startTime);
Serial.println(startTime);
Serial.println(time1);
Serial.println(time2);
Serial.println(time3);
Serial.println(time4);
Serial.println(time5);
Serial.println(time6);
Serial.println(time7);
Serial.println(time8);
Serial.println(time9);
Serial.println(time10);
Serial.println(time11);
Serial.println(endTime);
}
void loop() {
M5Lite.Ex.delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment