summaryrefslogtreecommitdiff
path: root/stmhal/rtc.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2017-08-28 13:59:26 -0700
committerGitHub <noreply@github.com>2017-08-28 13:59:26 -0700
commit447a4b1ecd5655357c9daaace03b91355d2e2c6d (patch)
tree46ca08a93e9870aab4fbb533843f3c99796cbdf4 /stmhal/rtc.c
parent4e63d55d8d0df6d7600bb684fa90a8cb54708ba8 (diff)
parentc679c80c710fd4a0e37ad87200d8a721e19727aa (diff)
Merge pull request #208 from adafruit/merge-v1.9.2
Merge MicroPython v1.9.2
Diffstat (limited to 'stmhal/rtc.c')
-rw-r--r--stmhal/rtc.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/stmhal/rtc.c b/stmhal/rtc.c
index bc9c889c2..6cb6ef047 100644
--- a/stmhal/rtc.c
+++ b/stmhal/rtc.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -26,12 +26,9 @@
#include <stdio.h>
-#include STM32_HAL_H
-
#include "py/runtime.h"
#include "rtc.h"
#include "irq.h"
-#include "mphalport.h"
/// \moduleref pyb
/// \class RTC - real time clock
@@ -415,7 +412,7 @@ STATIC void RTC_CalendarConfig(void) {
}
/******************************************************************************/
-// Micro Python bindings
+// MicroPython bindings
typedef struct _pyb_rtc_obj_t {
mp_obj_base_t base;
@@ -578,7 +575,7 @@ mp_obj_t pyb_rtc_wakeup(mp_uint_t n_args, const mp_obj_t *args) {
wut -= 0x10000;
if (wut > 0x10000) {
// wut still too large
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "wakeup value too large"));
+ mp_raise_ValueError("wakeup value too large");
}
}
}
@@ -688,12 +685,10 @@ mp_obj_t pyb_rtc_calibration(mp_uint_t n_args, const mp_obj_t *args) {
}
return mp_obj_new_int(cal & 1);
} else {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError,
- "calibration value out of range"));
+ mp_raise_ValueError("calibration value out of range");
}
#else
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError,
- "calibration value out of range"));
+ mp_raise_ValueError("calibration value out of range");
#endif
}
if (cal > 0) {