Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
q3k
firmware
Commits
2f340ca5
Commit
2f340ca5
authored
5 years ago
by
q3k
Browse files
Options
Downloads
Patches
Plain Diff
epicardiumy: fix epicardium_disp_framebuffer API
parent
663c22a6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/epicardium.h
+13
-5
13 additions, 5 deletions
epicardium/epicardium.h
epicardium/modules/display.c
+13
-5
13 additions, 5 deletions
epicardium/modules/display.c
with
26 additions
and
10 deletions
epicardium/epicardium.h
+
13
−
5
View file @
2f340ca5
...
...
@@ -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
));
/**
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/display.c
+
13
−
5
View file @
2f340ca5
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment