update TemplateDevice

This commit is contained in:
pikastech 2022-06-04 16:28:58 +08:00
parent 905c33e131
commit f0231b752b
2 changed files with 7 additions and 0 deletions

View File

@ -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):

View File

@ -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);
}