@@ -11013,6 +11013,10 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1101311013 // Author: @TroyHacks
1101411014 // @license GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
1101511015
11016+ static uint32_t akemi_t0 = 0, akemi_t_bus = 0, akemi_t_color = 0, akemi_t_fill = 0, akemi_t_loop = 0, akemi_t_clear = 0, akemi_t_srm = 0;
11017+ static uint32_t akemi_count = 0;
11018+ uint32_t t0 = esp_timer_get_time();
11019+
1101611020 if (!strip.isMatrix) return mode_static();
1101711021
1101811022 const uint16_t width = SEGMENT.virtualWidth();
@@ -11028,6 +11032,8 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1102811032
1102911033 if (!SEGENV.allocateData(4)) return mode_static();
1103011034
11035+ uint32_t t1 = esp_timer_get_time();
11036+
1103111037 if (SEGENV.call == 0) {
1103211038 SEGMENT.setUpLeds();
1103311039 if (akemiBuffer == nullptr) {
@@ -11048,6 +11054,8 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1104811054 } else {
1104911055 return mode_static();
1105011056 }
11057+ uint32_t t2 = esp_timer_get_time();
11058+ akemi_t_bus += (t2 - t1);
1105111059
1105211060 // --- Pre-calculate colors (same logic as original Akemi) ---
1105311061 uint16_t counter = (strip.now * ((SEGMENT.speed >> 2) + 2)) >> 8;
@@ -11095,6 +11103,8 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1109511103 {eyesMouthColor.r, eyesMouthColor.g, eyesMouthColor.b}, // 7: eyes/mouth
1109611104 {cheekColor.r, cheekColor.g, cheekColor.b} // 8: cheeks (audio reactive)
1109711105 };
11106+ uint32_t t3 = esp_timer_get_time();
11107+ akemi_t_color += (t3 - t2);
1109811108
1109911109 // --- Clear the 32x32 buffer using PPA fill ---
1110011110 ppa_fill_oper_config_t fill_config = {};
@@ -11114,6 +11124,8 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1111411124 fill_config.mode = PPA_TRANS_MODE_BLOCKING;
1111511125
1111611126 ESP_ERROR_CHECK_WITHOUT_ABORT(ppa_do_fill(ppa_fill_handle, &fill_config));
11127+ uint32_t t4 = esp_timer_get_time();
11128+ akemi_t_fill += (t4 - t3);
1111711129
1111811130 // --- Draw Akemi pixel by pixel into the 32x32 buffer ---
1111911131 // For a 32x32 source with mostly contiguous color regions,
@@ -11137,6 +11149,8 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1113711149 akemiBuffer[pos + 2] = colorLUT[ak].b;
1113811150 }
1113911151 }
11152+ uint32_t t5 = esp_timer_get_time();
11153+ akemi_t_loop += (t5 - t4);
1114011154
1114111155 // --- Scale from 32x32 to segment size using PPA SRM ---
1114211156 // Calculate scale factors (fixed point: 1.0 = 1.0, supports up to ~16x)
@@ -11160,6 +11174,8 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1116011174 clearConfig.fill_argb_color.a = 255;
1116111175 clearConfig.mode = PPA_TRANS_MODE_BLOCKING;
1116211176 ESP_ERROR_CHECK_WITHOUT_ABORT(ppa_do_fill(ppa_fill_handle, &clearConfig));
11177+ uint32_t t6 = esp_timer_get_time();
11178+ akemi_t_clear += (t6 - t5);
1116311179
1116411180 // SRM (Scale-Rotate-Mirror) operation
1116511181 ppa_srm_oper_config_t srm_config = {};
@@ -11191,6 +11207,8 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1119111207 srm_config.mode = PPA_TRANS_MODE_BLOCKING;
1119211208
1119311209 ESP_ERROR_CHECK_WITHOUT_ABORT(ppa_do_scale_rotate_mirror(ppa_srm_handle, &srm_config));
11210+ uint32_t t7 = esp_timer_get_time();
11211+ akemi_t_srm += (t7 - t6);
1119411212
1119511213 // --- Optional: GEQ overlay on hands (if check1 is enabled) ---
1119611214 // Render 16 bands into a tiny 16x17 buffer, then PPA scale to hand positions
@@ -11297,6 +11315,21 @@ uint16_t IRAM_ATTR mode_AkemiPPA() {
1129711315 }
1129811316
1129911317 #endif
11318+ uint32_t t8 = esp_timer_get_time();
11319+ akemi_t0 += (t8 - t0);
11320+ if (++akemi_count >= 120) {
11321+ printf("AkemiPPA[%dx%d]: total=%lumS bus=%lumS color=%lumS fill=%lumS loop=%lumS clear=%lumS srm=%lumS\n",
11322+ width, height,
11323+ akemi_t0 / akemi_count,
11324+ akemi_t_bus / akemi_count,
11325+ akemi_t_color / akemi_count,
11326+ akemi_t_fill / akemi_count,
11327+ akemi_t_loop / akemi_count,
11328+ akemi_t_clear / akemi_count,
11329+ akemi_t_srm / akemi_count);
11330+ akemi_t0 = akemi_t_bus = akemi_t_color = akemi_t_fill = akemi_t_loop = akemi_t_clear = akemi_t_srm = 0;
11331+ akemi_count = 0;
11332+ }
1130011333 return FRAMETIME;
1130111334} // mode_AkemiPPA
1130211335static const char _data_FX_MODE_AKEMIPPA[] PROGMEM = "Akemi PPA ☾🐺@Speed,Intensity,,,,GEQ Overlay;Face,Arms,Eyes;;2f;pal=11,c1=1";
0 commit comments