mirror of
https://gitee.com/quecpython/helios-service.git
synced 2025-05-19 06:08:22 +08:00
28 lines
530 B
Python
28 lines
530 B
Python
import sys_bus
|
||
from machine import Pin, ExtInt
|
||
from usr.bin.third_party.ql_interrupter import WatchDog
|
||
|
||
|
||
def topic1_cb(topic, msg):
|
||
print("topic1_cb topic = {} msg = {}".format(topic, msg))
|
||
|
||
|
||
def topic2_cb(topic, msg):
|
||
print("topic2_cb topic = {} msg = {}".format(topic, msg))
|
||
|
||
|
||
# 订阅喂狗后,硬件狗拉GPIO 告知模块喂狗成功
|
||
|
||
sys_bus.subscribe("WDT_KICK_TOPIC", topic1_cb)
|
||
|
||
# 订阅喂狗后的回调
|
||
|
||
sys_bus.subscribe("WDT_KICK_TOPIC_FEED", topic2_cb)
|
||
|
||
|
||
wd = WatchDog(Pin.GPIO17, 1, 10000)
|
||
|
||
wd.start()
|
||
|
||
|