kopia lustrzana https://github.com/OpenRTX/OpenRTX
Dropped display_renderingInProgress() function from display API
Removed display_renderingInProgress() function from display interface as it has never been used so far.pull/238/head
rodzic
c533c47103
commit
731054a131
|
@ -134,14 +134,6 @@ void gfx_renderRows(uint8_t startRow, uint8_t endRow);
|
||||||
*/
|
*/
|
||||||
void gfx_render();
|
void gfx_render();
|
||||||
|
|
||||||
/**
|
|
||||||
* This function calls the correspondent method of the low level interface display.h
|
|
||||||
* Check if framebuffer is being copied to the screen or not, in which case it
|
|
||||||
* can be modified without problems.
|
|
||||||
* @return false if rendering is not in progress.
|
|
||||||
*/
|
|
||||||
bool gfx_renderingInProgress();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears a portion of the screen content
|
* Clears a portion of the screen content
|
||||||
* This results in a black screen on color displays
|
* This results in a black screen on color displays
|
||||||
|
|
|
@ -94,13 +94,6 @@ void display_renderRows(uint8_t startRow, uint8_t endRow);
|
||||||
*/
|
*/
|
||||||
void display_render();
|
void display_render();
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if framebuffer is being copied to the screen or not, in which case it
|
|
||||||
* can be modified without problems.
|
|
||||||
* @return false if rendering is not in progress.
|
|
||||||
*/
|
|
||||||
bool display_renderingInProgress();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set display contrast.
|
* Set display contrast.
|
||||||
* NOTE: not all the display controllers support contrast control, thus on some
|
* NOTE: not all the display controllers support contrast control, thus on some
|
||||||
|
|
|
@ -147,7 +147,7 @@ static bw_t _color2bw(color_t true_color)
|
||||||
#error Please define a pixel format type into hwconfig.h or meson.build
|
#error Please define a pixel format type into hwconfig.h or meson.build
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool initialized = 0;
|
|
||||||
static PIXEL_T *buf;
|
static PIXEL_T *buf;
|
||||||
static uint16_t fbSize;
|
static uint16_t fbSize;
|
||||||
static char text[32];
|
static char text[32];
|
||||||
|
@ -156,7 +156,6 @@ void gfx_init()
|
||||||
{
|
{
|
||||||
display_init();
|
display_init();
|
||||||
buf = (PIXEL_T *)(display_getFrameBuffer());
|
buf = (PIXEL_T *)(display_getFrameBuffer());
|
||||||
initialized = 1;
|
|
||||||
|
|
||||||
// Calculate framebuffer size
|
// Calculate framebuffer size
|
||||||
#ifdef CONFIG_PIX_FMT_RGB565
|
#ifdef CONFIG_PIX_FMT_RGB565
|
||||||
|
@ -174,7 +173,6 @@ void gfx_init()
|
||||||
void gfx_terminate()
|
void gfx_terminate()
|
||||||
{
|
{
|
||||||
display_terminate();
|
display_terminate();
|
||||||
initialized = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_renderRows(uint8_t startRow, uint8_t endRow)
|
void gfx_renderRows(uint8_t startRow, uint8_t endRow)
|
||||||
|
@ -187,15 +185,11 @@ void gfx_render()
|
||||||
display_render();
|
display_render();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gfx_renderingInProgress()
|
|
||||||
{
|
|
||||||
return display_renderingInProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
void gfx_clearRows(uint8_t startRow, uint8_t endRow)
|
void gfx_clearRows(uint8_t startRow, uint8_t endRow)
|
||||||
{
|
{
|
||||||
if(!initialized) return;
|
if(endRow < startRow)
|
||||||
if(endRow < startRow) return;
|
return;
|
||||||
|
|
||||||
uint16_t start = startRow * CONFIG_SCREEN_WIDTH * sizeof(PIXEL_T);
|
uint16_t start = startRow * CONFIG_SCREEN_WIDTH * sizeof(PIXEL_T);
|
||||||
uint16_t height = endRow - startRow * CONFIG_SCREEN_WIDTH * sizeof(PIXEL_T);
|
uint16_t height = endRow - startRow * CONFIG_SCREEN_WIDTH * sizeof(PIXEL_T);
|
||||||
// Set the specified rows to 0x00 = make the screen black
|
// Set the specified rows to 0x00 = make the screen black
|
||||||
|
@ -204,14 +198,12 @@ void gfx_clearRows(uint8_t startRow, uint8_t endRow)
|
||||||
|
|
||||||
void gfx_clearScreen()
|
void gfx_clearScreen()
|
||||||
{
|
{
|
||||||
if(!initialized) return;
|
|
||||||
// Set the whole framebuffer to 0x00 = make the screen black
|
// Set the whole framebuffer to 0x00 = make the screen black
|
||||||
memset(buf, 0x00, fbSize);
|
memset(buf, 0x00, fbSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_fillScreen(color_t color)
|
void gfx_fillScreen(color_t color)
|
||||||
{
|
{
|
||||||
if(!initialized) return;
|
|
||||||
for(int16_t y = 0; y < CONFIG_SCREEN_HEIGHT; y++)
|
for(int16_t y = 0; y < CONFIG_SCREEN_HEIGHT; y++)
|
||||||
{
|
{
|
||||||
for(int16_t x = 0; x < CONFIG_SCREEN_WIDTH; x++)
|
for(int16_t x = 0; x < CONFIG_SCREEN_WIDTH; x++)
|
||||||
|
@ -259,7 +251,6 @@ inline void gfx_setPixel(point_t pos, color_t color)
|
||||||
|
|
||||||
void gfx_drawLine(point_t start, point_t end, color_t color)
|
void gfx_drawLine(point_t start, point_t end, color_t color)
|
||||||
{
|
{
|
||||||
if(!initialized) return;
|
|
||||||
int16_t steep = abs(end.y - start.y) > abs(end.x - start.x);
|
int16_t steep = abs(end.y - start.y) > abs(end.x - start.x);
|
||||||
|
|
||||||
if (steep)
|
if (steep)
|
||||||
|
@ -319,7 +310,6 @@ void gfx_drawLine(point_t start, point_t end, color_t color)
|
||||||
|
|
||||||
void gfx_drawRect(point_t start, uint16_t width, uint16_t height, color_t color, bool fill)
|
void gfx_drawRect(point_t start, uint16_t width, uint16_t height, color_t color, bool fill)
|
||||||
{
|
{
|
||||||
if(!initialized) return;
|
|
||||||
if(width == 0) return;
|
if(width == 0) return;
|
||||||
if(height == 0) return;
|
if(height == 0) return;
|
||||||
uint16_t x_max = start.x + width - 1;
|
uint16_t x_max = start.x + width - 1;
|
||||||
|
|
|
@ -524,16 +524,6 @@ void display_render()
|
||||||
display_renderRows(0, CONFIG_SCREEN_HEIGHT);
|
display_renderRows(0, CONFIG_SCREEN_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool display_renderingInProgress()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Rendering is in progress if display's chip select is low or a DMA
|
|
||||||
* transfer is in progress.
|
|
||||||
*/
|
|
||||||
bool dmaBusy = (DMA2_Stream7->CR & DMA_SxCR_EN) ? true : false;
|
|
||||||
return (gpio_readPin(LCD_CS) == 0) || dmaBusy;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
void *display_getFrameBuffer()
|
||||||
{
|
{
|
||||||
return (void *)(frameBuffer);
|
return (void *)(frameBuffer);
|
||||||
|
|
|
@ -36,7 +36,6 @@ static const struct display_buffer_descriptor displayBufDesc =
|
||||||
};
|
};
|
||||||
|
|
||||||
static uint8_t frameBuffer[FB_SIZE];
|
static uint8_t frameBuffer[FB_SIZE];
|
||||||
static bool rendering = false;
|
|
||||||
|
|
||||||
void display_init()
|
void display_init()
|
||||||
{
|
{
|
||||||
|
@ -63,7 +62,6 @@ void display_render()
|
||||||
static uint8_t shadowBuffer[FB_SIZE] = { 0 };
|
static uint8_t shadowBuffer[FB_SIZE] = { 0 };
|
||||||
memset(shadowBuffer, 0x00, FB_SIZE);
|
memset(shadowBuffer, 0x00, FB_SIZE);
|
||||||
|
|
||||||
rendering = true;
|
|
||||||
for(uint8_t y = 0; y < CONFIG_SCREEN_HEIGHT; y++)
|
for(uint8_t y = 0; y < CONFIG_SCREEN_HEIGHT; y++)
|
||||||
{
|
{
|
||||||
for(uint8_t x = 0; x < CONFIG_SCREEN_WIDTH; x++)
|
for(uint8_t x = 0; x < CONFIG_SCREEN_WIDTH; x++)
|
||||||
|
@ -76,12 +74,6 @@ void display_render()
|
||||||
}
|
}
|
||||||
|
|
||||||
display_write(displayDev, 0, 0, &displayBufDesc, shadowBuffer);
|
display_write(displayDev, 0, 0, &displayBufDesc, shadowBuffer);
|
||||||
rendering = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool display_renderingInProgress()
|
|
||||||
{
|
|
||||||
return rendering;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
void *display_getFrameBuffer()
|
||||||
|
|
|
@ -130,11 +130,6 @@ void display_render()
|
||||||
display_renderRows(0, CONFIG_SCREEN_HEIGHT);
|
display_renderRows(0, CONFIG_SCREEN_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool display_renderingInProgress()
|
|
||||||
{
|
|
||||||
return (gpio_readPin(LCD_CS) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
void *display_getFrameBuffer()
|
||||||
{
|
{
|
||||||
return (void *)(frameBuffer);
|
return (void *)(frameBuffer);
|
||||||
|
|
|
@ -150,11 +150,6 @@ void display_render()
|
||||||
display_renderRows(0, (CONFIG_SCREEN_WIDTH / 8) - 1);
|
display_renderRows(0, (CONFIG_SCREEN_WIDTH / 8) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool display_renderingInProgress()
|
|
||||||
{
|
|
||||||
return (gpio_readPin(LCD_CS) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
void *display_getFrameBuffer()
|
||||||
{
|
{
|
||||||
return (void *)(frameBuffer);
|
return (void *)(frameBuffer);
|
||||||
|
|
|
@ -135,11 +135,6 @@ void display_render()
|
||||||
display_renderRows(0, CONFIG_SCREEN_HEIGHT / 8);
|
display_renderRows(0, CONFIG_SCREEN_HEIGHT / 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool display_renderingInProgress()
|
|
||||||
{
|
|
||||||
return (gpio_readPin(LCD_CS) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
void *display_getFrameBuffer()
|
||||||
{
|
{
|
||||||
return (void *)(frameBuffer);
|
return (void *)(frameBuffer);
|
||||||
|
|
|
@ -160,11 +160,6 @@ void display_render()
|
||||||
display_renderRows(0, CONFIG_SCREEN_HEIGHT / 8);
|
display_renderRows(0, CONFIG_SCREEN_HEIGHT / 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool display_renderingInProgress()
|
|
||||||
{
|
|
||||||
return (gpio_readPin(LCD_CS) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
void *display_getFrameBuffer()
|
||||||
{
|
{
|
||||||
return (void *)(frameBuffer);
|
return (void *)(frameBuffer);
|
||||||
|
|
|
@ -165,11 +165,6 @@ void display_render()
|
||||||
display_renderRows(0, CONFIG_SCREEN_HEIGHT);
|
display_renderRows(0, CONFIG_SCREEN_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool display_renderingInProgress()
|
|
||||||
{
|
|
||||||
return inProgress;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
void *display_getFrameBuffer()
|
||||||
{
|
{
|
||||||
return (void *) (frameBuffer);
|
return (void *) (frameBuffer);
|
||||||
|
|
|
@ -49,11 +49,6 @@ void display_render()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool display_renderingInProgress()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
void *display_getFrameBuffer()
|
||||||
{
|
{
|
||||||
return (void *) (frameBuffer);
|
return (void *) (frameBuffer);
|
||||||
|
|
Ładowanie…
Reference in New Issue