summaryrefslogtreecommitdiff
path: root/tests/wipy/timer.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wipy/timer.py')
-rw-r--r--tests/wipy/timer.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/wipy/timer.py b/tests/wipy/timer.py
index f62899b47..db25870db 100644
--- a/tests/wipy/timer.py
+++ b/tests/wipy/timer.py
@@ -1,18 +1,18 @@
-'''
+"""
Timer test for the CC3200 based boards.
-'''
+"""
from machine import Timer
import os
import time
mch = os.uname().machine
-if 'LaunchPad' in mch:
- pwm_pin = ('GP24')
-elif 'WiPy' in mch:
- pwm_pin = ('GP24')
+if "LaunchPad" in mch:
+ pwm_pin = "GP24"
+elif "WiPy" in mch:
+ pwm_pin = "GP24"
else:
- raise Exception('Board not supported!')
+ raise Exception("Board not supported!")
for i in range(4):
tim = Timer(i, mode=Timer.PERIODIC)
@@ -49,6 +49,7 @@ class TimerTest:
def timer_isr(self, tim_ch):
self.int_count += 1
+
timer_test = TimerTest()
ch = timer_test.tim.channel(Timer.A, freq=5)
print(ch.freq() == 5)
@@ -92,26 +93,26 @@ for i in range(1000):
try:
tim = Timer(0, mode=12)
except:
- print('Exception')
+ print("Exception")
try:
tim = Timer(4, mode=Timer.ONE_SHOT)
except:
- print('Exception')
+ print("Exception")
try:
tim = Timer(0, mode=Timer.PWM, width=32)
except:
- print('Exception')
+ print("Exception")
tim = Timer(0, mode=Timer.PWM)
try:
ch = tim.channel(TIMER_A | TIMER_B, freq=10)
except:
- print('Exception')
+ print("Exception")
try:
ch = tim.channel(TIMER_A, freq=4)
except:
- print('Exception')
+ print("Exception")