From 56f5dc559d6c06267e067439528803d6cdd60af6 Mon Sep 17 00:00:00 2001 From: Lyon <88232613+mimilib@users.noreply.github.com> Date: Fri, 27 Aug 2021 16:24:22 +0800 Subject: [PATCH] =?UTF-8?q?Update=203.PikaScript=E6=A0=87=E5=87=86?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E6=B5=81=E7=A8=8B.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/3.PikaScript标准开发流程.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/3.PikaScript标准开发流程.md b/doc/3.PikaScript标准开发流程.md index e932e0696..a668701e5 100644 --- a/doc/3.PikaScript标准开发流程.md +++ b/doc/3.PikaScript标准开发流程.md @@ -87,3 +87,21 @@ mem.now() pika预编译器会为导入的包生成.h声明文件和-api.c构造器文件。文件名以包名开头,每个类对应一个.h文件和一个-api.c文件。 ![image](https://user-images.githubusercontent.com/88232613/131096295-8b1b2161-cb59-45e6-92f3-eb2cf79a47f7.png) + +而PikaMain-api.c和PikaMain.h则是对应了一个特殊的类,这个类是PikaScript的主类,由main.py编译而成。 +![image](https://user-images.githubusercontent.com/88232613/131096521-569e30a0-876e-4bb5-bfd3-0c01b6b8a38f.png) + +pikaScript.c和pikaScript.h则是根据main.py编译出的初始化函数,运行初始化函数时,会自动执行启动脚本。 +![image](https://user-images.githubusercontent.com/88232613/131096760-20592a84-bbc1-4b61-a57f-299183983adf.png) + +在现在的main.py中,启动脚本就是: +``` +print('hello wrold') +uart.setName('com1') +uart.send('My name is:') +uart.printName() +print('mem used max:') +mem.max() +print('mem used now:') +mem.now() +```