From 41f6948545c8f5909413badbef2dcd5794598bf0 Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Sun, 13 Sep 2015 17:06:12 +0200 Subject: cc3200: New WDT API. --- tests/wipy/wdt.py | 37 +++++++++++++++++++++++++++++++++++++ tests/wipy/wdt.py.exp | 7 +++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/wipy/wdt.py create mode 100644 tests/wipy/wdt.py.exp (limited to 'tests') diff --git a/tests/wipy/wdt.py b/tests/wipy/wdt.py new file mode 100644 index 000000000..9be6293b0 --- /dev/null +++ b/tests/wipy/wdt.py @@ -0,0 +1,37 @@ +''' +WDT test for the CC3200 based boards +''' + +from pyb import WDT + +# test the invalid cases first +try: + wdt = WDT(1) +except Exception: + print("Exception") + +try: + wdt = WDT(0, 500) +except Exception: + print("Exception") + +try: + wdt = WDT(1, timeout=2000) +except Exception: + print("Exception") + +wdt = WDT(timeout=1000) +print(wdt) + +try: + wdt = WDT(0, timeout=2000) +except Exception: + print("Exception") + +pyb.delay(500) +wdt.feed() +print(wdt) +pyb.delay(900) +wdt.feed() +print(wdt) +pyb.delay(950) diff --git a/tests/wipy/wdt.py.exp b/tests/wipy/wdt.py.exp new file mode 100644 index 000000000..71f5e13b5 --- /dev/null +++ b/tests/wipy/wdt.py.exp @@ -0,0 +1,7 @@ +Exception +Exception +Exception + +Exception + + -- cgit v1.2.3