mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
Update 3.PikaScript标准开发流程.md
This commit is contained in:
parent
60bca2615a
commit
56f5dc559d
@ -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()
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user