Skip to content
Snippets Groups Projects
Commit 2f340ca5 authored by q3k's avatar q3k
Browse files

epicardiumy: fix epicardium_disp_framebuffer API

parent 663c22a6
No related branches found
No related tags found
No related merge requests found
......@@ -283,12 +283,13 @@ struct disp_framebuffer {
*
* .. code-block:: cpp
*
* struct disp_framebuffer *fb = epic_disp_framebuffer();
* struct disp_framebuffer **fb;
* epic_disp_framebuffer(fb);
* uint16_t red = 0b1111100000000000;
* for (int y = 0; y < DISP_HEIGHT; y++) {
* for (int x = 0; x < DISP_WIDTH; x++) {
* fb->fb[y][x][0] = red >> 8;
* fb->fb[y][x][1] = red & 0xFF;
* (*fb)->fb[y][x][0] = red >> 8;
* (*fb)->fb[y][x][1] = red & 0xFF;
* }
* }
* epic_disp_update();
......@@ -318,6 +319,10 @@ API(API_DISP_CLOSE, int epic_disp_close());
/**
* Causes the changes that have been written to the framebuffer
* to be shown on the display
* :return: ``0`` on success or a negative value in case of an error:
*
* - ``-EBUSY``: Display was already locked from another task.
* - ``-EAGAIN``: Display is currently being updated.
*/
API(API_DISP_UPDATE, int epic_disp_update());
/**
......@@ -445,9 +450,12 @@ API(API_DISP_CIRC,
* Returns the back framebuffer (the display buffer that's currently inactive
* that will be shown after the next call to ``epic_disp_update``.
*
* :returns: pointer to a framebuffer
* :param fb: output: current framebuffer
* :return: ``0`` on success or negative value in case of an error:
*
* - ``-EBUSY``: Display was already locked from another task.
*/
API(API_DISP_FRAMEBUFFER, struct disp_framebuffer *epic_disp_framebuffer());
API(API_DISP_FRAMEBUFFER, int epic_disp_framebuffer(struct disp_framebuffer **fb));
/**
......
......@@ -119,15 +119,23 @@ int epic_disp_update()
int cl = check_lock();
if (cl < 0) {
return cl;
} else {
LCD_Update();
return 0;
}
if (LCD_Update()) {
return -EAGAIN;
}
return 0;
}
struct disp_framebuffer *epic_disp_framebuffer()
int epic_disp_framebuffer(struct disp_framebuffer **fb)
{
return (struct disp_framebuffer *)LCD_Framebuffer();
int cl = check_lock();
if (cl < 0) {
return cl;
}
*fb = (struct disp_framebuffer *)LCD_Framebuffer();
return 0;
}
int epic_disp_open()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment