Do not run demo script by default
This commit is contained in:
parent
912ef6b4cf
commit
24c169e13b
@ -50,6 +50,8 @@
|
|||||||
<p>
|
<p>
|
||||||
<button onclick="mp_js_process_char(4);">Paste (Ctrl+D)</button>
|
<button onclick="mp_js_process_char(4);">Paste (Ctrl+D)</button>
|
||||||
<p>
|
<p>
|
||||||
|
<button onclick="for(var i = 0;i < lines.length;i++) { mp_js_do_str(lines[i]); }">Run basic demo</button>
|
||||||
|
<p>
|
||||||
<i>Simulator revision v1.0</i>
|
<i>Simulator revision v1.0</i>
|
||||||
<!-- scripts -->
|
<!-- scripts -->
|
||||||
<script src="lvgl_mp.js"></script>
|
<script src="lvgl_mp.js"></script>
|
||||||
@ -68,6 +70,7 @@
|
|||||||
function processScriptArg(url){
|
function processScriptArg(url){
|
||||||
// read text from URL location
|
// read text from URL location
|
||||||
var request = new XMLHttpRequest();
|
var request = new XMLHttpRequest();
|
||||||
|
console.log("GET " + url);
|
||||||
request.open('GET', url, true);
|
request.open('GET', url, true);
|
||||||
request.send(null);
|
request.send(null);
|
||||||
request.onreadystatechange = function () {
|
request.onreadystatechange = function () {
|
||||||
@ -90,7 +93,7 @@
|
|||||||
"import lvgl as lv",
|
"import lvgl as lv",
|
||||||
"lv.init()",
|
"lv.init()",
|
||||||
"import SDL",
|
"import SDL",
|
||||||
"SDL.init()",
|
"SDL.init()",
|
||||||
|
|
||||||
/* Register SDL display driver. */
|
/* Register SDL display driver. */
|
||||||
"disp_buf1 = lv.disp_buf_t()",
|
"disp_buf1 = lv.disp_buf_t()",
|
||||||
@ -155,12 +158,7 @@
|
|||||||
console.log("Custom script: " + custom);
|
console.log("Custom script: " + custom);
|
||||||
if(custom !== undefined && custom !== null)
|
if(custom !== undefined && custom !== null)
|
||||||
processScriptArg(custom);
|
processScriptArg(custom);
|
||||||
else {
|
|
||||||
/* Run init script */
|
|
||||||
for(var i = 0;i < lines.length;i++){
|
|
||||||
mp_js_do_str(lines[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*Setup lv_task_handler loop*/
|
/*Setup lv_task_handler loop*/
|
||||||
var the_mp_handle_pending = Module.cwrap('mp_handle_pending', null);
|
var the_mp_handle_pending = Module.cwrap('mp_handle_pending', null);
|
||||||
function handle_pending() {
|
function handle_pending() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user