diff --git a/components/ctx/ctx.h b/components/ctx/ctx.h index c50a6032cea1fcdb44f4dc3c9cbd8579a657cdea..4e5777d0ea9a6e9347376aec6c2ed1f90a81b503 100644 --- a/components/ctx/ctx.h +++ b/components/ctx/ctx.h @@ -1,4 +1,4 @@ -/* ctx git commit: 4349079e */ +/* ctx git commit: aeaa8b2b */ /* * ctx.h is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -2509,6 +2509,10 @@ void ctx_vt_write (Ctx *ctx, uint8_t byte); int ctx_vt_has_data (Ctx *ctx); int ctx_vt_read (Ctx *ctx); + +void ctx_set_textureclock (Ctx *ctx, int frame); +int ctx_textureclock (Ctx *ctx); + #ifdef __cplusplus } #endif @@ -6121,8 +6125,7 @@ void ctx_buffer_set_data (CtxBuffer *buffer, void (*freefunc) (void *pixels, void *user_data), void *user_data); -int _ctx_set_frame (Ctx *ctx, int frame); -int _ctx_frame (Ctx *ctx); +int ctx_textureclock (Ctx *ctx); void ctx_exit (Ctx *ctx); @@ -53372,14 +53375,15 @@ void ctx_texture (Ctx *ctx, const char *eid, float x, float y) //fclose (f); } int -_ctx_frame (Ctx *ctx) +ctx_textureclock (Ctx *ctx) { return ctx->frame; } -int -_ctx_set_frame (Ctx *ctx, int frame) + +void +ctx_set_textureclock (Ctx *ctx, int textureclock) { - return ctx->frame = frame; + ctx->frame = textureclock; } void ctx_define_texture (Ctx *ctx, @@ -60980,8 +60984,8 @@ static void vt_ctx_exit (void *data) vt->current_line->ctx = vt->current_line->ctx_copy; vt->current_line->ctx_copy = tmp; - _ctx_set_frame (vt->current_line->ctx, _ctx_frame (vt->current_line->ctx) + 1); - _ctx_set_frame (vt->current_line->ctx_copy, _ctx_frame (vt->current_line->ctx)); + ctx_set_textureclock (vt->current_line->ctx, ctx_textureclock (vt->current_line->ctx) + 1); + ctx_set_textureclock (vt->current_line->ctx_copy, ctx_textureclock (vt->current_line->ctx)); #if 1 if (vt->ctxp) // XXX: ugly hack to aid double buffering ((void**)vt->ctxp)[0]= vt->current_line->ctx; @@ -67126,7 +67130,7 @@ void vt_draw (VT *vt, Ctx *ctx, double x0, double y0) if (line->ctx_copy) { - //fprintf (stderr, " [%i]\n", _ctx_frame (ctx)); + //fprintf (stderr, " [%i]\n", ctx_textureclock (ctx)); //ctx_render_stream (line->ctx_copy, stderr, 1); ctx_begin_path (ctx); diff --git a/components/st3m/st3m_gfx.c b/components/st3m/st3m_gfx.c index 836664973ed5d4b9738373b1ad7a6ae26ead9d76..1baf2aa9168def72af69b2f37bb6728eea6b18df 100644 --- a/components/st3m/st3m_gfx.c +++ b/components/st3m/st3m_gfx.c @@ -110,6 +110,8 @@ static void st3m_gfx_crtc_task(void *_arg) { } } +void st3m_ctx_increment_frame(Ctx *ctx); + static void st3m_gfx_rast_task(void *_arg) { (void)_arg; @@ -129,6 +131,8 @@ static void st3m_gfx_rast_task(void *_arg) { end = esp_timer_get_time(); st3m_counter_timer_sample(&rast_read_dctx_time, end - start); + st3m_ctx_increment_frame(framebuffer_descs[0].ctx); + // Render drawctx into fbctx. start = esp_timer_get_time(); ctx_render_ctx(draw->ctx, fb->ctx); diff --git a/python_payload/apps/clouds/__init__.py b/python_payload/apps/clouds/__init__.py index 6135f312ec6d3960498a981625467a57230e4dde..4f9c7d33381e7e4cc5c5dd888d268fe3cf71a11c 100644 --- a/python_payload/apps/clouds/__init__.py +++ b/python_payload/apps/clouds/__init__.py @@ -59,6 +59,5 @@ class Clouds(Application): c.draw(ctx) -if __name__ == "__main__": - # Continue to make runnable via mpremote run. - st3m.run.run_view(Clouds(ApplicationContext())) +# uncomment to make runnable via mpremote +# st3m.run.run_view(Clouds(ApplicationContext()))