mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
fix macro in stddevice
This commit is contained in:
parent
33e2a02caf
commit
34ad50ffe8
@ -102,31 +102,31 @@ class Time(BaseDev):
|
||||
def sleep(self, s: float):
|
||||
"""Sleep for s seconds."""
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
|
||||
def time(self) -> float:
|
||||
"""Get the current time."""
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
|
||||
def time_ns(self) -> int:
|
||||
"""Get the current time in nanoseconds."""
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
|
||||
def gmtime(self, unix_time: float):
|
||||
"""Convert unix time to struct_time."""
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
|
||||
def localtime(self, unix_time: float):
|
||||
"""Convert unix time to struct_time."""
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
|
||||
def mktime(self) -> int:
|
||||
"""Convert struct_time to unix time."""
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
|
||||
def asctime(self):
|
||||
"""Convert struct_time to string."""
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
|
||||
def ctime(self, unix_time: float):
|
||||
"""Convert unix time to string."""
|
||||
|
||||
@ -137,7 +137,7 @@ class Time(BaseDev):
|
||||
def sleep_ms(self, ms: int): ...
|
||||
|
||||
@abstractmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
|
||||
def platformGetTick(): ...
|
||||
|
||||
|
||||
@ -450,10 +450,10 @@ class CAN(BaseDev):
|
||||
|
||||
|
||||
class BaseDev:
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_EVENT_ENABLE")
|
||||
def addEventCallBack(self, eventCallback: any):
|
||||
""" Add an event callback. """
|
||||
|
||||
@abstractmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
@PIKA_C_MACRO_IF("PIKA_EVENT_ENABLE")
|
||||
def platformGetEventId(self): ...
|
||||
|
Loading…
x
Reference in New Issue
Block a user