Skip to content

Commit 635b7e9

Browse files
committed
1 parent 953af17 commit 635b7e9

File tree

7 files changed

+74
-49
lines changed

7 files changed

+74
-49
lines changed

packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js

+24-23
Original file line numberDiff line numberDiff line change
@@ -969,29 +969,29 @@ function dbg(text) {
969969
// === Body ===
970970

971971
var ASM_CONSTS = {
972-
1045504: ($0) => { startToDebuggerMessage($0); },
973-
1045536: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
974-
1045611: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
975-
1045686: ($0) => { finishToDebuggerMessage($0); },
976-
1045719: ($0, $1) => { lvglCreateScreen($0, $1); },
977-
1045749: ($0, $1) => { lvglDeleteScreen($0, $1); },
978-
1045779: ($0) => { lvglScreenTick($0); },
979-
1045803: ($0, $1, $2, $3) => { lvglOnEventHandler($0, $1, $2, $3); },
980-
1045843: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); },
981-
1045897: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); },
982-
1045951: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); },
983-
1046004: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); },
984-
1046057: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); },
985-
1046110: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); },
986-
1046143: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); },
987-
1046179: ($0, $1) => { lvglSetColorTheme($0, UTF8ToString($1)); },
988-
1046224: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); },
989-
1046330: ($0, $1) => { return eez_mqtt_deinit($0, $1); },
990-
1046366: ($0, $1) => { return eez_mqtt_connect($0, $1); },
991-
1046403: ($0, $1) => { return eez_mqtt_disconnect($0, $1); },
992-
1046443: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); },
993-
1046500: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); },
994-
1046559: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); }
972+
1045600: ($0) => { startToDebuggerMessage($0); },
973+
1045632: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
974+
1045707: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
975+
1045782: ($0) => { finishToDebuggerMessage($0); },
976+
1045815: ($0, $1) => { lvglCreateScreen($0, $1); },
977+
1045845: ($0, $1) => { lvglDeleteScreen($0, $1); },
978+
1045875: ($0) => { lvglScreenTick($0); },
979+
1045899: ($0, $1, $2, $3) => { lvglOnEventHandler($0, $1, $2, $3); },
980+
1045939: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); },
981+
1045993: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); },
982+
1046047: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); },
983+
1046100: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); },
984+
1046153: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); },
985+
1046206: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); },
986+
1046239: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); },
987+
1046275: ($0, $1) => { lvglSetColorTheme($0, UTF8ToString($1)); },
988+
1046320: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); },
989+
1046426: ($0, $1) => { return eez_mqtt_deinit($0, $1); },
990+
1046462: ($0, $1) => { return eez_mqtt_connect($0, $1); },
991+
1046499: ($0, $1) => { return eez_mqtt_disconnect($0, $1); },
992+
1046539: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); },
993+
1046596: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); },
994+
1046655: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); }
995995
};
996996

997997

@@ -4877,6 +4877,7 @@ var _v8_lv_slider_set_left_value = Module['_v8_lv_slider_set_left_value'] = crea
48774877
var _lv_bar_set_start_value = Module['_lv_bar_set_start_value'] = createExportWrapper('lv_bar_set_start_value');
48784878
var _v8_lv_slider_get_left_value = Module['_v8_lv_slider_get_left_value'] = createExportWrapper('v8_lv_slider_get_left_value');
48794879
var _lv_bar_get_start_value = Module['_lv_bar_get_start_value'] = createExportWrapper('lv_bar_get_start_value');
4880+
var _to_lvgl_color = Module['_to_lvgl_color'] = createExportWrapper('to_lvgl_color');
48804881
var _lv_disp_get_scr_prev = Module['_lv_disp_get_scr_prev'] = createExportWrapper('lv_disp_get_scr_prev');
48814882
var _lv_obj_get_disp = Module['_lv_obj_get_disp'] = createExportWrapper('lv_obj_get_disp');
48824883
var _lv_anim_del = Module['_lv_anim_del'] = createExportWrapper('lv_anim_del');
Binary file not shown.

packages/project-editor/flow/runtime/lvgl_runtime_v9.0.js

+24-23
Original file line numberDiff line numberDiff line change
@@ -969,29 +969,29 @@ function dbg(text) {
969969
// === Body ===
970970

971971
var ASM_CONSTS = {
972-
1039808: ($0) => { startToDebuggerMessage($0); },
973-
1039840: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
974-
1039915: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
975-
1039990: ($0) => { finishToDebuggerMessage($0); },
976-
1040023: ($0, $1) => { lvglCreateScreen($0, $1); },
977-
1040053: ($0, $1) => { lvglDeleteScreen($0, $1); },
978-
1040083: ($0) => { lvglScreenTick($0); },
979-
1040107: ($0, $1, $2, $3) => { lvglOnEventHandler($0, $1, $2, $3); },
980-
1040147: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); },
981-
1040201: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); },
982-
1040255: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); },
983-
1040308: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); },
984-
1040361: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); },
985-
1040414: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); },
986-
1040447: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); },
987-
1040483: ($0, $1) => { lvglSetColorTheme($0, UTF8ToString($1)); },
988-
1040528: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); },
989-
1040634: ($0, $1) => { return eez_mqtt_deinit($0, $1); },
990-
1040670: ($0, $1) => { return eez_mqtt_connect($0, $1); },
991-
1040707: ($0, $1) => { return eez_mqtt_disconnect($0, $1); },
992-
1040747: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); },
993-
1040804: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); },
994-
1040863: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); }
972+
1039904: ($0) => { startToDebuggerMessage($0); },
973+
1039936: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
974+
1040011: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
975+
1040086: ($0) => { finishToDebuggerMessage($0); },
976+
1040119: ($0, $1) => { lvglCreateScreen($0, $1); },
977+
1040149: ($0, $1) => { lvglDeleteScreen($0, $1); },
978+
1040179: ($0) => { lvglScreenTick($0); },
979+
1040203: ($0, $1, $2, $3) => { lvglOnEventHandler($0, $1, $2, $3); },
980+
1040243: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); },
981+
1040297: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); },
982+
1040351: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); },
983+
1040404: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); },
984+
1040457: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); },
985+
1040510: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); },
986+
1040543: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); },
987+
1040579: ($0, $1) => { lvglSetColorTheme($0, UTF8ToString($1)); },
988+
1040624: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); },
989+
1040730: ($0, $1) => { return eez_mqtt_deinit($0, $1); },
990+
1040766: ($0, $1) => { return eez_mqtt_connect($0, $1); },
991+
1040803: ($0, $1) => { return eez_mqtt_disconnect($0, $1); },
992+
1040843: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); },
993+
1040900: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); },
994+
1040959: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); }
995995
};
996996

997997

@@ -4867,6 +4867,7 @@ var _lvglGetTabName = Module['_lvglGetTabName'] = createExportWrapper('lvglGetTa
48674867
var _lv_tabview_get_tab_bar = Module['_lv_tabview_get_tab_bar'] = createExportWrapper('lv_tabview_get_tab_bar');
48684868
var _lv_obj_get_child_by_type = Module['_lv_obj_get_child_by_type'] = createExportWrapper('lv_obj_get_child_by_type');
48694869
var _lv_label_get_text = Module['_lv_label_get_text'] = createExportWrapper('lv_label_get_text');
4870+
var _to_lvgl_color = Module['_to_lvgl_color'] = createExportWrapper('to_lvgl_color');
48704871
var _lv_group_init = Module['_lv_group_init'] = createExportWrapper('lv_group_init');
48714872
var _lv_group_deinit = Module['_lv_group_deinit'] = createExportWrapper('lv_group_deinit');
48724873
var _lv_ll_init = Module['_lv_ll_init'] = createExportWrapper('lv_ll_init');
Binary file not shown.

packages/project-editor/lvgl/widgets/Led.tsx

+14-1
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,25 @@ export class LVGLLedWidget extends LVGLWidget {
162162
);
163163
} else {
164164
code.addToTick("color", () => {
165-
const new_val = code.evalUnsignedIntegerProperty(
165+
let new_val = code.evalUnsignedIntegerProperty(
166166
"uint32_t",
167167
"new_val",
168168
this.color as string,
169169
"Failed to evaluate Color in Led widget"
170170
);
171+
if (code.lvglBuild) {
172+
if (code.isV9) {
173+
code.lvglBuild.line(
174+
`new_val = lv_color_to_u32(lv_color_hex(new_val));`
175+
);
176+
} else {
177+
code.lvglBuild.line(
178+
`new_val = lv_color_to32(lv_color_hex(new_val));`
179+
);
180+
}
181+
} else {
182+
new_val &= code.callFreeFunction("to_lvgl_color", new_val);
183+
}
171184

172185
let cur_val;
173186

packages/project-editor/ui-components/PropertyGrid/Property.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,8 @@ export const Property = observer(
987987
type="text"
988988
className="form-control"
989989
value={this._value || ""}
990-
readOnly
990+
onChange={this.onChange}
991+
readOnly={readOnly}
991992
/>
992993
{!readOnly && (
993994
<>
@@ -1050,7 +1051,8 @@ export const Property = observer(
10501051
type="text"
10511052
className="form-control"
10521053
value={this._value || ""}
1053-
readOnly
1054+
onChange={this.onChange}
1055+
readOnly={readOnly}
10541056
/>
10551057
{!readOnly && (
10561058
<>

wasm/lvgl-runtime/common/src/studio_api.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -615,4 +615,12 @@ EM_PORT_API(int32_t) v8_lv_slider_get_left_value(const lv_obj_t *obj) {
615615

616616
#endif
617617

618+
EM_PORT_API(uint32_t) to_lvgl_color(uint32_t color) {
619+
#if LVGL_VERSION_MAJOR >= 9
620+
return lv_color_to_u32(lv_color_hex(color));
621+
#else
622+
return lv_color_to32(lv_color_hex(color));
623+
#endif
624+
}
625+
618626
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)