mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
update TemplateDevice
This commit is contained in:
parent
905c33e131
commit
f0231b752b
@ -15,6 +15,7 @@ class Time(PikaStdDevice.Time):
|
||||
# override
|
||||
def sleep_s(self, s: int): ...
|
||||
def sleep_ms(self, ms: int): ...
|
||||
def platformGetTick(): ...
|
||||
|
||||
|
||||
class ADC(PikaStdDevice.ADC):
|
||||
|
@ -6,3 +6,9 @@ void TemplateDevice_Time_sleep_ms(PikaObj *self, int ms){
|
||||
void TemplateDevice_Time_sleep_s(PikaObj *self, int s){
|
||||
|
||||
}
|
||||
|
||||
static volatile uint64_t tick_ms = 0;
|
||||
void TemplateDevice_Time_platformGetTick(PikaObj *self){
|
||||
tick_ms += 50;
|
||||
obj_setInt(self, "tick", tick_ms);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user