Skip to content
Snippets Groups Projects
Select Git revision
  • 71be1ddeb128e6068d2f1df605ec9c8c10f67091
  • master default protected
  • schneider/ir
  • rahix/user-space-ctx
  • schneider/iaq-python
  • schneider/ble-mini-demo
  • schneider/ble-ecg-stream-visu
  • schneider/mp-exception-print
  • schneider/sleep-display
  • schneider/deepsleep4
  • schneider/deepsleep2
  • schneider/deepsleep
  • schneider/ble-central
  • rahix/bluetooth-app-favorite
  • schneider/v1.17-changelog
  • schneider/ancs
  • schneider/png
  • schneider/freertos-list-debug
  • schneider/212-reset-hardware-when-entering-repl
  • schneider/bonding-fail-if-full
  • schneider/ble-fixes-2020-3
  • v1.18
  • v1.17
  • v1.16
  • v1.15
  • v1.14
  • v1.13
  • v1.12
  • v1.11
  • v1.10
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
41 results

group__SDHC__ADMA__ADDR__0.html

Blame
  • st3m_gfx.c 28.79 KiB
    #include "st3m_gfx.h"
    // Submit a filled ctx descriptor to the rasterization pipeline.
    
    #include <string.h>
    
    #include <pthread.h>
    #include "esp_log.h"
    #include "esp_system.h"
    #include "esp_task.h"
    #include "esp_timer.h"
    #include "freertos/FreeRTOS.h"
    #include "freertos/queue.h"
    
    // clang-format off
    #include "ctx_config.h"
    #include "ctx.h"
    // clang-format on
    
    #include "flow3r_bsp.h"
    #include "st3m_counter.h"
    #include "st3m_version.h"
    
    #define ST3M_GFX_DEFAULT_MODE st3m_gfx_16bpp_osd
    
    static EXT_RAM_BSS_ATTR uint16_t fb[240 * 240];
    
    // Get a free drawlist ctx to draw into.
    //
    // ticks_to_wait can be used to limit the time to wait for a free ctx
    // descriptor, or portDELAY_MAX can be specified to wait forever. If the timeout
    // expires, NULL will be returned.
    static Ctx *st3m_gfx_drawctx_free_get(TickType_t ticks_to_wait);
    
    // Submit a filled ctx descriptor to the rasterization pipeline.
    static void st3m_gfx_drawctx_pipe_put(void);
    
    static const char *TAG = "st3m-gfx";
    
    #define N_DRAWLISTS 3
    
    // we keep the OSD buffer the same size as the main framebuffer,
    // allowing us to do different combos of which buffer is osd and not
    #define ST3M_OSD_WIDTH 240
    #define ST3M_OSD_HEIGHT 240
    #define ST3M_OSD_X 0
    #define ST3M_OSD_Y 0
    
    static st3m_gfx_mode _st3m_gfx_mode = st3m_gfx_default + 1;
    
    EXT_RAM_BSS_ATTR static uint8_t
        st3m_osd_fb[ST3M_OSD_WIDTH * ST3M_OSD_HEIGHT * 4];
    EXT_RAM_BSS_ATTR uint16_t st3m_osd_backup[ST3M_OSD_WIDTH * ST3M_OSD_HEIGHT];
    
    // drawlist ctx
    static Ctx *user_ctx[N_DRAWLISTS];
    
    // each frame buffer has an associated rasterizer context
    static Ctx *fb_GRAY8_ctx = NULL;
    static Ctx *fb_GRAYA8_ctx = NULL;
    static Ctx *fb_RGB565_BS_ctx = NULL;
    static Ctx *fb_RGBA8_ctx = NULL;
    
    // corner pixel coordinates for osd clip
    
    static pthread_mutex_t osd_mutex = PTHREAD_MUTEX_INITIALIZER;
    
    static int _st3m_osd_y1[N_DRAWLISTS + 1];
    static int _st3m_osd_x1[N_DRAWLISTS + 1];
    static int _st3m_osd_y0[N_DRAWLISTS + 1];
    static int _st3m_osd_x0[N_DRAWLISTS + 1];