mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-02-05 17:28:23 +08:00
imporve VM run sys info output
This commit is contained in:
parent
d4e60e302c
commit
5497dde01c
@ -740,6 +740,11 @@
|
|||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\pikascript\pikascript-api\PikaPiZero_OLED-api.c</FilePath>
|
<FilePath>..\pikascript\pikascript-api\PikaPiZero_OLED-api.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>PikaPiZero_Point-api.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\pikascript\pikascript-api\PikaPiZero_Point-api.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -2,27 +2,31 @@ import PikaStdLib
|
|||||||
import STM32
|
import STM32
|
||||||
import PikaPiZero
|
import PikaPiZero
|
||||||
|
|
||||||
x = 0
|
p0 = PikaPiZero.Point()
|
||||||
y = 0
|
p0.x = 0
|
||||||
|
p0.y = 0
|
||||||
|
print(p0.x)
|
||||||
mem = PikaStdLib.MemChecker()
|
mem = PikaStdLib.MemChecker()
|
||||||
print('mem used max:')
|
print('mem used max:')
|
||||||
mem.max()
|
mem.max()
|
||||||
oled.drawPoint(x, y)
|
oled.drawPoint(p0.x, p0.y)
|
||||||
while True:
|
while True:
|
||||||
if right.read() == 1:
|
if right.read() == 1:
|
||||||
if x < 15:
|
print('right')
|
||||||
x = x + 1
|
if p0.x < 15:
|
||||||
oled.drawPoint(x, y)
|
p0.x = p0.x + 1
|
||||||
|
print(p0.x)
|
||||||
|
oled.drawPoint(p0.x, p0.y)
|
||||||
if left.read() == 0:
|
if left.read() == 0:
|
||||||
if x > 0:
|
if p0.x > 0:
|
||||||
x = x - 1
|
p0.x = p0.x - 1
|
||||||
oled.drawPoint(x, y)
|
oled.drawPoint(p0.x, p0.y)
|
||||||
if up.read() == 0:
|
if up.read() == 0:
|
||||||
if y > 0:
|
if p0.y > 0:
|
||||||
y = y - 1
|
p0.y = p0.y - 1
|
||||||
oled.drawPoint(x, y)
|
oled.drawPoint(p0.x, p0.y)
|
||||||
if down.read() == 0:
|
if down.read() == 0:
|
||||||
if y < 7:
|
if p0.y < 7:
|
||||||
y = y + 1
|
p0.y = p0.y + 1
|
||||||
oled.drawPoint(x, y)
|
oled.drawPoint(p0.x, p0.y)
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ nextLine:
|
|||||||
return nextAddr;
|
return nextAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char* useFlashAsBuff(char* pikaAsm, Args* buffs) {
|
char* useFlashAsBuff(char* pikaAsm, Args* buffs) {
|
||||||
/* not write flash when asm is old */
|
/* not write flash when asm is old */
|
||||||
if (strEqu(pikaAsm, __platformLoadPikaAsm())) {
|
if (strEqu(pikaAsm, __platformLoadPikaAsm())) {
|
||||||
args_deinit(buffs);
|
args_deinit(buffs);
|
||||||
@ -561,7 +561,10 @@ Args* pikaVM_runAsm(PikaObj* self, char* pikaAsm) {
|
|||||||
__platformPrintf("%s\r\n", sysOut);
|
__platformPrintf("%s\r\n", sysOut);
|
||||||
}
|
}
|
||||||
if (0 != errcode) {
|
if (0 != errcode) {
|
||||||
__platformPrintf("[info] input commond: %s\r\n", thisLine);
|
Args *buffs = New_strBuff();
|
||||||
|
char *onlyThisLine = strsGetFirstToken(buffs, thisLine, '\n');
|
||||||
|
__platformPrintf("[info] input commond: %s\r\n", onlyThisLine);
|
||||||
|
args_deinit(buffs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
__clearInvokeQueues(self);
|
__clearInvokeQueues(self);
|
||||||
|
@ -9,5 +9,6 @@ int32_t pikaVM_runAsmLine(PikaObj* self,
|
|||||||
int32_t lineAddr,
|
int32_t lineAddr,
|
||||||
Args* sysRes);
|
Args* sysRes);
|
||||||
int32_t __clearInvokeQueues(PikaObj* self);
|
int32_t __clearInvokeQueues(PikaObj* self);
|
||||||
|
char* useFlashAsBuff(char* pikaAsm, Args* buffs);
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user