diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pyb/rtc.py | 21 | ||||
| -rw-r--r-- | tests/pyb/rtc.py.exp | 9 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/pyb/rtc.py b/tests/pyb/rtc.py index f2c96f160..001553ac3 100644 --- a/tests/pyb/rtc.py +++ b/tests/pyb/rtc.py @@ -28,3 +28,24 @@ set_and_print((2016, 12, 31, 7, 23, 59, 0, 0)) set_and_print((2016, 12, 31, 7, 23, 59, 1, 0)) set_and_print((2016, 12, 31, 7, 23, 59, 59, 0)) set_and_print((2099, 12, 31, 7, 23, 59, 59, 0)) + +# check that calibration works correctly +# save existing calibration value: +cal_tmp = rtc.calibration() + +def set_and_print_calib(cal): + rtc.calibration(cal) + print(rtc.calibration()) + +set_and_print_calib(512) +set_and_print_calib(511) +set_and_print_calib(345) +set_and_print_calib(1) +set_and_print_calib(0) +set_and_print_calib(-1) +set_and_print_calib(-123) +set_and_print_calib(-510) +set_and_print_calib(-511) + +# restore existing calibration value +rtc.calibration(cal_tmp) diff --git a/tests/pyb/rtc.py.exp b/tests/pyb/rtc.py.exp index 43ea70d95..d8d5e0f0a 100644 --- a/tests/pyb/rtc.py.exp +++ b/tests/pyb/rtc.py.exp @@ -14,3 +14,12 @@ (2016, 12, 31, 7, 23, 59, 1) (2016, 12, 31, 7, 23, 59, 59) (2099, 12, 31, 7, 23, 59, 59) +512 +511 +345 +1 +0 +-1 +-123 +-510 +-511 |
