10000 Update to lvgl v7.2 and merge master · mhepp63/lv_binding_micropython@1738b99 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1738b99

Browse files
committed
Update to lvgl v7.2 and merge master
2 parents 5ed21f1 + 41cfb1e commit 1738b99

File tree

9 files changed

+50
-207
lines changed

9 files changed

+50
-207
lines changed

.github/auto-comment.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Comment to a new issue.
2+
pullRequestOpened: |
3+
Thank you for raising your pull request.
4+
5+
To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin).
6+
7+
The text of DCO can be read here: https://developercertificate.org/
8+
For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site.
9+
10+
By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO.
11+
12+
No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment.

driver/SDL/modSDL.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#include "../include/common.h"
2+
#ifndef _POSIX_C_SOURCE
3+
#define _POSIX_C_SOURCE
4+
#endif
25
#include <errno.h>
36
#include <signal.h>
47
#include <pthread.h>

driver/esp32/ili9341.py

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -446,108 +446,3 @@ def stat(self):
446446
self.flush_acc_dma_cycles = 0
447447

448448
return time, setup, dma, px
449-
450-
451-
#####################################
452-
# TESTING - only if running as main
453-
#####################################
454-
455-
if __name__ == '__main__':
456-
457-
lv.init()
458-
disp = ili9341()
459-
460-
import rtch
461-
touch = rtch.touch(xp = 32, yp = 33, xm = 25, ym = 26, touch_rail = 27, touch_sense = 33)
462-
touch.init()
463-
indev_drv = lv.indev_drv_t()
464-
lv.indev_drv_init(indev_drv)
465-
indev_drv.type = lv.INDEV_TYPE.POINTER;
466-
indev_drv.read_cb = touch.read;
467-
lv.indev_drv_register(indev_drv);
468-
469-
# Animation helper class
470-
471-
class Anim(lv.anim_t):
472-
def __init__(self, obj, val, size, exec_cb, path_cb, time=500, playback = False, ready_cb=None):
473-
super().__init__()
474-
lv.anim_init(self)
475-
lv.anim_set_time(self, time, 0)
476-
lv.anim_set_values(self, val, val+size)
477-
if callable(exec_cb):
478-
lv.anim_set_custom_exec_cb(self, exec_cb)
479-
else:
480-
lv.anim_set_exec_cb(self, obj, exec_cb)
481-
lv.anim_set_path_cb(self, path_cb )
482-
if playback: lv.anim_set_playback(self, 0)
483-
if ready_cb: lv.anim_set_ready_cb(self, ready_cb)
484-
lv.anim_create(self)
485-
486-
# An animated chart
487-
488-
class AnimatedChart(lv.chart):
489-
def __init__(self, parent, val, size):
490-
super().__init__(parent)
491-
self.val = val
492-
self.size = size
493-
self.max = 2000
494-
self.min = 500
495-
self.factor = 100
496-
self.anim_phase1()
497-
498-
def anim_phase1(self):
499-
Anim(
500-
self,
501-
self.val,
502-
self.size,
503-
lambda a, val: self.set_range(0, val),
504-
lv.anim_path_ease_in,
505-
ready_cb=lambda a:self.anim_phase2(),
506-
time=(self.max * self.factor) // 100)
507-
508-
def anim_phase2(self):
509-
Anim(
510-
self,
511-
self.val+self.size,
512-
-self.size,
513-
lambda a, val: self.set_range(0, val),
514-
lv.anim_path_ease_out,
515-
ready_cb=lambda a:self.anim_phase1(),
516-
time=(self.min * self.factor) // 100)
517-
518-
# Create the chart
519-
520-
scr = lv.obj()
521-
chart = AnimatedChart(scr, 100, 1000)
522-
chart.set_width(scr.get_width() - 100)
523-
chart.align(scr, lv.ALIGN.CENTER, 0, 0)
524-
series1 = chart.add_series(lv.color_hex(0xFF0000))
525-
chart.set_type(chart.TYPE.POINT | chart.TYPE.LINE)
526-
chart.set_series_width(3)
527-
chart.set_range(0,100)
528-
chart.init_points(series1, 10)
529-
chart.set_points(series1, [10,20,30,20,10,40,50,90,95,90])
530-
chart.set_x_tick_texts('a\nb\nc\nd\ne', 2, lv.chart.AXIS.DRAW_LAST_TICK)
531-
chart.set_x_tick_length(10, 5)
532-
chart.set_y_tick_texts('1\n2\n3\n4\n5', 2, lv.chart.AXIS.DRAW_LAST_TICK)
533-
chart.set_y_tick_length(10, 5)
534-
chart.set_div_line_count(3, 3)
535-
chart.set_margin(30)
536-
537-
# Create a slider that controls the chart animation speed
538-
539-
def on_slider_changed(self, obj=None, event=-1):
540-
chart.factor = slider.get_value()
541-
542-
slider = lv.slider(scr)
543-
slider.align(chart, lv.ALIGN.OUT_RIGHT_TOP, 10, 0)
544-
slider.set_width(30)
545-
slider.set_height(chart.get_height())
546-
slider.set_range(10, 200)
547-
slider.set_value(chart.factor, 0)
548-
slider.set_event_cb(on_slider_changed)
549-
550-
# Load the screen
551-
552-
lv.scr_load(scr)
553-

examples/advanced_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def anim_phase1(self):
201201
self,
202202
self.val,
203203
self.size,
204-
lambda a, val: self.set_range(0, val),
204+
lambda a, val: self.set_y_range(self.AXIS.PRIMARY_Y,0, val),
205205
lv.anim_path_t.ease_in,
206206
ready_cb=lambda a:self.anim_phase2(),
207207
time=(self.max * self.factor) // 100,
@@ -212,7 +212,7 @@ def anim_phase2(self):
212212
self,
213213
self.val + self.size,
214214
-self.size,
215-
lambda a, val: self.set_range(0, val),
215+
lambda a, val: self.set_y_range(self.AXIS.PRIMARY_Y, 0, val),
216216
lv.anim_path_t.ease_out,
217217
ready_cb=lambda a:self.anim_phase1(),
218218
time=(self.min * self.factor) // 100,
@@ -230,7 +230,7 @@ def __init__(self, app, page):
230230
self.chart.set_style_local_line_width(self.chart.PART.SERIES, lv.STATE.DEFAULT, 3)
231231
self.chart.add_style(self.chart.PART.SERIES, ColorStyle(0x055))
232232
self.chart.add_style(self.chart.PART.BG, ChartPaddingStyle())
233-
self.chart.set_range(0,100)
233+
self.chart.set_y_range(self.chart.AXIS.PRIMARY_Y, 0,100)
234234
self.chart.init_points(self.series1, 10)
235235
self.chart.set_points(self.series1, [10, 20, 30, 20, 10, 40, 50, 90, 95, 90])
236236
self.chart.set_x_tick_texts("a\nb\nc\nd\ne", 2, lv.chart.AXIS.DRAW_LAST_TICK)

examples/chart_anim_example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def anim_phase1(self):
145145
self,
146146
self.val,
147147
self.size,
148-
lambda a, val: self.set_range(0, val),
148+
lambda a, val: self.set_y_range(self.AXIS.PRIMARY_Y,0, val),
149149
lv.anim_path_t.ease_in,
150150
ready_cb=lambda a:self.anim_phase2(),
151151
time=(self.max * self.factor) // 100,
@@ -156,7 +156,7 @@ def anim_phase2(self):
156156
self,
157157
self.val+self.size,
158158
-self.size,
159-
lambda a, val: self.set_range(0, val),
159+
lambda a, val: self.set_y_range(self.AXIS.PRIMARY_Y,0, val),
160160
lv.anim_path_t.ease_out,
161161
ready_cb=lambda a:self.anim_phase1(),
162162
time=(self.min * self.factor) // 100,
@@ -170,7 +170,7 @@ def anim_phase2(self):
170170
chart.align(scr, lv.ALIGN.CENTER, 0, 0)
171171
series1 = chart.add_series(lv.color_hex(0xFF0000))
172172
chart.set_type(chart.TYPE.LINE)
173-
chart.set_range(0, 100)
173+
chart.set_y_range(chart.AXIS.PRIMARY_Y, 0,100)
174174
chart.init_points(series1, 10)
175175
chart.set_points(series1, [10, 20, 30, 20, 10, 40, 50, 90, 95, 90])
176176
chart.set_x_tick_texts("a\nb\nc\nd\ne", 2, lv.chart.AXIS.DRAW_LAST_TICK)

0 commit comments

Comments
 (0)
0