Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Commit 69a2582

Browse files
authored
Merge pull request #22 from Pablo2048/master
Update LVGL to 6.0.1
2 parents 333f8eb + b9c291c commit 69a2582

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+9593
-8031
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "git",
1313
"url": "https://github.com/littlevgl/arduino"
1414
},
15-
"version": "2.0.2",
15+
"version": "2.0.3",
1616
"license": "MIT",
1717
"frameworks": "arduino",
1818
"build": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=lv_arduino
2-
version=2.0.2
2+
version=2.0.3
33
author=Gabor Kiss-Vamosi
44
maintainer=Pavel Brychta <[email protected]>
55
sentence=Full-featured Graphics Library for embedded systems

src/README.md

Lines changed: 239 additions & 60 deletions
Large diffs are not rendered by default.

src/docs/CODING_STYLE.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
## File format
3+
Use [lv_misc/lv_templ.c](https://github.com/littlevgl/lvgl/blob/master/lv_misc/lv_templ.c) and [lv_misc/lv_templ.h](https://github.com/littlevgl/lvgl/blob/master/lv_misc/lv_templ.h)
4+
5+
## Naming conventions
6+
* Words are separated by '_'
7+
* In variable and function names use only lower case letters (e.g. *height_tmp*)
8+
* In enums and defines use only upper case letters (e.g. *e.g. MAX_LINE_NUM*)
9+
* Global names (API):
10+
* starts with *lv*
11+
* followed by module name: *btn*, *label*, *style* etc.
12+
* followed by the action (for functions): *set*, *get*, *refr* etc.
13+
* closed with the subject: *name*, *size*, *state* etc.
14+
* Typedefs
15+
* prefer `typedef struct` and `typedef enum` instead of `struct name` and `enum name`
16+
* always end `typedef struct` and `typedef enum` type names with `_t`
17+
* Abbreviations:
18+
* Use abbreviations on public names only if they become longer than 32 characters
19+
* Use only very straightforward (e.g. pos: position) or well-established (e.g. pr: press) abbreviations
20+
21+
## Coding guide
22+
* Functions:
23+
* Try to write function shorter than is 50 lines
24+
* Always shorter than 100 lines (except very straightforwards)
25+
* Variables:
26+
* One line, one declaration (BAD: char x, y;)
27+
* Use `<stdint.h>` (*uint8_t*, *int32_t* etc)
28+
* Declare variables when needed (not all at function start)
29+
* Use the smallest required scope
30+
* Variables in a file (outside functions) are always *static*
31+
* Do not use global variables (use functions to set/get static variables)
32+
33+
## Comments
34+
Before every function have a comment like this:
35+
36+
```c
37+
/**
38+
* Return with the screen of an object
39+
* @param obj pointer to an object
40+
* @return pointer to a screen
41+
*/
42+
lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
43+
```
44+
45+
Always use `/* Something */` format and NOT `//Something`
46+
47+
Write readable code to avoid descriptive comments like:
48+
`x++; /* Add 1 to x */`.
49+
The code should show clearly what you are doing.
50+
51+
You should write **why** have you done this:
52+
`x++; /*Because of closing '\0' of the string */`
53+
54+
Short "code summaries" of a few lines are accepted. E.g. `/*Calculate the new coordinates*/`
55+
56+
In comments use \` \` when referring to a variable. E.g. ``/*Update the value of `x_act`*/``
57+
58+
### Formatting
59+
Here is example to show bracket placing and using of white spaces:
60+
```c
61+
/**
62+
* Set a new text for a label. Memory will be allocated to store the text by the label.
63+
* @param label pointer to a label object
64+
* @param text '\0' terminated character string. NULL to refresh with the current text.
65+
*/
66+
void lv_label_set_text(lv_obj_t * label, const char * text)
67+
{ /* Main brackets of functions in new line*/
68+
69+
if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/
70+
71+
lv_obj_inv(label);
72+
73+
lv_label_ext_t * ext = lv_obj_get_ext(label);
74+
75+
/*Comment before a section */
76+
if(text == ext->txt || text == NULL) { /*Bracket of statements start inline*/
77+
lv_label_refr_text(label);
78+
return;
79+
}
80+
81+
...
82+
}
83+
```
84+
85+
Use 4 spaces indentation instead of tab.
86+
87+
You can use **astyle** to format the code. The required config flies are: `docs/astyle_c` and `docs/astyle_h`.
88+
To format the source files:
89+
`$ find . -type f -name "*.c" | xargs astyle --options=docs/astyle_c`
90+
91+
To format the header files:
92+
`$ find . -type f -name "*.h" | xargs astyle --options=docs/astyle_h`
93+
94+
Append `-n` to the end to skip creation of backup file OR use `$ find . -type f -name "*.bak" -delete` (for source file's backups) and `find . -type f -name "*.orig" -delete` (for header file's backups)

src/docs/CONTRIBUTING.md

Lines changed: 66 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,111 @@
11
# Contributing to Littlev Graphics Library
22

3-
**Welcome! It's glad to see that you are interested in contributing to LittlevGL! There are several types of task where you can help to build a better library! Let's see how to get started!**
3+
**Do you have some free time to spend with programming?
4+
Are you working on an Embedded GUI project with LittlevGL?
5+
See how can you help to improve the graphics library!**
46

5-
6-
There are many different possibilities to join the community. If you have some time to work with us I'm sure you will find something that fits you! You can:
7-
- answer other's questions
8-
- report and/or fix bugs
9-
- suggest and/or implement new features
7+
There are many ways to join the community. If you have some time to work with us I'm sure you will find something that fits you! You can:
8+
- help others in the [Forum](https://forum.littlevgl.com/)
109
- improve and/or translate the documentation
1110
- write a blog post about your experiences
11+
- report and/or fix bugs
12+
- suggest and/or implement new features
1213

1314
But first, start with the most Frequently Asked Questions.
1415

15-
## FAQ about contributing
16+
# FAQ about contributing
1617

17-
### What license does my code need to be under?
18+
## Where can I write my question and remarks?
1819

19-
Any code added to LittlevGL must be licensed under [MIT](https://choosealicense.com/licenses/mit/) or another license that is fully compatible. Contributions under other licenses are highly likely to be rejected.
20+
We use the [Forum](https://forum.littlevgl.com/) to ask and answer questions and [GitHub's issue tracker](https://github.com/littlevgl/lvgl/issues) for development-related discussion.
2021

21-
If you borrow code from another project, please make sure to add their copyright notice to your contribution.
22-
23-
### Where do I ask questions, give feedback, or report bugs?
24-
25-
We use the [forum](http://forum.littlevgl.com/) for questions, feature suggestions, and discussions.
26-
27-
We use [GitHub's issue tracker](https://github.com/littlevgl/lvgl/issues) to report bugs.
28-
29-
For both of these there are some rules:
22+
But there are some simple rules:
3023
- Be kind and friendly.
31-
- Speak about one thing in one issue.
32-
- Give feedback and close the issue if your question is answered.
33-
- Explain exactly what you experience or expect. _"The button is not working"_ is not enough info to get help.
34-
- For most issues you should send an absolute minimal code example in order to reproduce the issue. Ideally this should be easily usable in the PC simulator.
24+
- Speak about one thing in one issue/topic.
25+
- Give feedback and close the issue or mark the topic as solved if your question is answered.
26+
- Tell what you experience or expect. _"The button is not working"_ is not enough info to get help.
27+
- If possible send an absolute minimal code example in order to reproduce the issue
3528
- Use [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to format your post.
36-
- If you don't get any answer in a week write a comment like "Can somebody help?". Maybe your issue wasn't noticed.
3729

38-
### How can I send fixes and improvements?
39-
Merging new code happens via Pull Requests. If you are still not familiar with the Pull Requests (PR for short) here is a quick guide about them:
30+
## How can I send fixes and improvements?
31+
32+
Merging new code happens via Pull Requests. If you are still not familiar with the Pull Requests (PR for short) here is a quick guide:
4033
1. **Fork** the [lvgl repository](https://github.com/littlevgl/lvgl). To do this click the "Fork" button in the top right corner. It will "copy" the `lvgl` repository to your GitHub account (`https://github.com/your_name?tab=repositories`)
41-
2. **Clone** the forked repository and add your updates
42-
3. **Create a PR** on the GitHub on the page of you `lvgl` repository(`https://github.com/your_name/lvgl`) by hitting the "New pull request" button
43-
4. **Set the base branch**. It means where you want to merge your update. Bugfixes for the last release go to `master`, new features to the actual `dev-x.y` branch.
34+
2. **Clone** the forked repository and add your changes
35+
3. **Create a PR** on GitHub from the page of your `lvgl` repository (`https://github.com/your_name/lvgl`) by hitting the "New pull request" button
36+
4. **Set the base branch**. It means where you want to merge your update. Fixes go to `master`, new features to the actual `dev-x.y` branch.
4437
5. **Describe** what is in the update. An example code is welcome if applicable.
4538

4639
Some advice:
47-
- If you are not sure about your fix or feature it's better to open an issue first, and discuss the details there.
40+
- If you are not sure about your fix or feature it's better to open an issue first and discuss the details there.
4841
- Maybe your fix or update won't be perfect at first. Don't be afraid, just improve it and push the new commits. The PR will be updated accordingly.
49-
- If your update needs some extra work it's okay to say: _"I'm busy now and I will improve it soon"_ or _"Sorry, I don't have time to improve it, I hope it helps in this form too"_. So it's better to say don't have time to continue then saying nothing.
50-
- Please read and follow this [guide about the coding style](https://docs.littlevgl.com/#Coding-Style-Guide)
42+
- If your update needs some extra work it's okay to say: _"I'm busy now and I will improve it soon"_ or _"Sorry, I don't have time to improve it, I hope it helps in this form too"_.
43+
So it's better to say don't have time to continue than saying nothing.
44+
- Please read and follow this [guide about the coding style](https://github.com/littlevgl/lvgl/blob/master/docs/CODING_STYLE.md)
5145

5246

53-
### Where is the documentation?
47+
## Where is the documentation?
5448

55-
You can read the documentation here: https://docs.littlevgl.com/
56-
You can edit the documentation here: https://github.com/littlevgl/doc
49+
You can read the documentation here: <https://docs.littlevgl.com/>
50+
You can edit the documentation here: <https://github.com/littlevgl/doc>
5751

58-
### Where is the blog?
52+
## Where is the blog?
5953

60-
You can read the blog here: https://blog.littlevgl.com/
61-
You can edit the blog here: https://github.com/littlevgl/blog
54+
You can read the blog here: <https://blog.littlevgl.com/>
55+
You can edit the blog here: <https://github.com/littlevgl/blog>
6256

57+
# So how and where can you contribute?
6358

64-
## So how and where can I contribute?
59+
## Help others in the Forum
6560

66-
### Answering other's questions
61+
It's a great way to contribute to the library if you already use it.
62+
Just go to [https://forum.littlevgl.com/](https://forum.littlevgl.com/) a register (Google and GitHub login also works).
63+
Log in, read the titles and if you are already familiar with a topic, don't be shy, and write your suggestion.
6764

68-
It's a great way to contribute to the library if you already use it. Just go the [issue tracker](https://github.com/littlevgl/lvgl/issues), read the titles and if you are already familiar with a topic, don't be shy, and write your suggestion.
65+
## Improving and/or translating the documentation
6966

70-
### Reporting and/or fixing bugs
71-
For simple bugfixes (typos, missing error handling, fixing a warning) is fine to send a Pull request directly. However, for more complex bugs it's better to open an issue first. In the issue, you should describe how to reproduce the bug and even add the minimal code snippet.
67+
If you would like to contribute to LittlevGL the documentation is the best place to start.
7268

73-
### Suggesting and/or implementing new features
74-
If you have a good idea don't hesitate to share with us. It's even better if you have time to deal with its implementation. Don't be afraid if you still don't know LittlevGL well enough. We will help you to get started.
69+
### Fix typos, add missing parts
70+
71+
If you find a typo, an obscure sentence or something which is not explained well enough in the [English documentation](https://docs.littlevgl.com/en/html/index.html)
72+
click the *"Edit on GitHub"* button in the top right corner and fix the issue by sending a Pull Request.
73+
74+
### Translate the documentation
75+
76+
If you have time and interest you can translate the documentation to your native language or any language you speak.
77+
You can join others to work on an already existing language or you can start a new one.
7578

76-
During the implementation don't forget the [Code style guide](https://docs.littlevgl.com/#Coding-Style-Guide).
79+
To translate the documentation we use [Zanata](https://zanata.org) which is an online translation platform.
80+
You will find the LittlevGL project here: [LittlevGL on Zanata](https://translate.zanata.org/iteration/view/littlevgl-docs/v6.0-doc1?dswid=3430)
7781

78-
### Improving and/or translating the documentation
82+
To get started you need to:
83+
- register at [Zanata](https://zanata.org) which is an online translation platform.
84+
- comment to [this post](https://forum.littlevgl.com/t/translate-the-documentation/238?u=kisvegabor)
85+
- tell your username at *Zanata* and your selected language(s) to get permission the edit the translations
7986

80-
The documentation of LittlevGL is written in Markdown and available [here](https://github.com/littlevgl/doc) for editing. If you find some parts of the documentation obscure or insufficient just search the related `.md` file, hit the edit icon and add your updates. This way a new Pull request will be generated automatically.
87+
Note that a translation will be added to the documentation only if at least the [Porting section](https://docs.littlevgl.com/en/html/porting/index.html) is translated.
8188

82-
If you can devote more time to improve the documentation you can translate it!
83-
1. Just copy the English `.md` files from the root folder to `locale/LANGUAGE_CODE` (language code is e.g. DE, FR, ES etc)
84-
2. Append the language code the end of files (e.g. Welcome_fr.md)
85-
3. Update the filenames in `_Sidebar.md`
86-
4. Translate the page(s) you want
87-
5. Create a Pull request
8889

89-
### Writing a blog post about your experiences
90+
## Writing a blog post about your experiences
9091

91-
Have ported LittlevGL to a new platform? Have you created a fancy GUI? Do you know a great trick?
92-
You can share your knowledge on LittelvGL's blog! It's super easy to add your own post:
92+
Have you ported LittlevGL to a new platform? Have you created a fancy GUI? Do you know a great trick?
93+
You can share your knowledge on LittlevGL's blog! It's super easy to add your own post:
9394
- Fork and clone the [blog repository](https://github.com/littlevgl/blog)
9495
- Add your post in Markdown to the `_posts` folder.
9596
- Store the images and other resources in a dedicated folder in `assets`
9697
- Create a Pull Request
9798

9899
The blog uses [Jekyll](https://jekyllrb.com/) to convert the `.md` files to a webpage. You can easily [run Jekyll offline](https://jekyllrb.com/docs/) to check your post before creating the Pull request
99100

100-
## Summary
101+
## Reporting and/or fixing bugs
102+
For simple bugfixes (typos, missing error handling, fixing a warning) is fine to send a Pull request directly. However, for more complex bugs it's better to open an issue first. In the issue, you should describe how to reproduce the bug and even add the minimal code snippet.
103+
104+
## Suggesting and/or implementing new features
105+
If you have a good idea don't hesitate to share with us. It's even better if you have time to deal with its implementation. Don't be afraid if you still don't know LittlevGL well enough. We will help you to get started.
106+
107+
During the implementation don't forget the [Code style guide](https://github.com/littlevgl/lvgl/blob/master/docs/CODING_STYLE.md).
101108

102-
I hope you have taken a liking to contribute to LittelvGL. A helpful and friendly community is waiting for you! :)
109+
# Summary
103110

111+
I hope you have taken a liking to contribute to LittlevGL. A helpful and friendly community is waiting for you! :)

src/porting/lv_port_disp_template.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo
163163
static void gpu_blend(lv_disp_drv_t * disp_drv, lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa)
164164
{
165165
/*It's an example code which should be done by your GPU*/
166-
167166
uint32_t i;
168167
for(i = 0; i < length; i++) {
169168
dest[i] = lv_color_mix(dest[i], src[i], opa);
@@ -185,12 +184,6 @@ static void gpu_fill_cb(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coor
185184
}
186185
dest_buf+=dest_width; /*Go to the next line*/
187186
}
188-
189-
190-
uint32_t i;
191-
for(i = 0; i < length; i++) {
192-
dest[i] = color;
193-
}
194187
}
195188

196189
#endif /*LV_USE_GPU*/

0 commit comments

Comments
 (0)