summaryrefslogtreecommitdiff
path: root/stmhal/rtc.c
diff options
context:
space:
mode:
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) {