summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/machine_rtc.c
diff options
context:
space:
mode:
authorJavier Candeira <javier@candeira.com>2017-08-09 14:40:45 +1000
committerJavier Candeira <javier@candeira.com>2017-08-13 22:52:33 +1000
commit35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db (patch)
tree26616de189a9154309287846bf76fb1cdab8ce51 /esp8266/machine_rtc.c
parentb6a328956467339f568b19d9192fbbfdfa47a572 (diff)
downloadmicropython-35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db.tar.gz
micropython-35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db.zip
all: Raise exceptions via mp_raise_XXX
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
Diffstat (limited to 'esp8266/machine_rtc.c')
-rw-r--r--esp8266/machine_rtc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/esp8266/machine_rtc.c b/esp8266/machine_rtc.c
index 2ad44318f2..c5d04e0cfa 100644
--- a/esp8266/machine_rtc.c
+++ b/esp8266/machine_rtc.c
@@ -183,8 +183,7 @@ STATIC mp_obj_t pyb_rtc_memory(mp_uint_t n_args, const mp_obj_t *args) {
mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_READ);
if (bufinfo.len > MEM_USER_MAXLEN) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError,
- "buffer too long"));
+ mp_raise_ValueError("buffer too long");
}
len = bufinfo.len;
@@ -208,7 +207,7 @@ STATIC mp_obj_t pyb_rtc_alarm(mp_obj_t self_in, mp_obj_t alarm_id, mp_obj_t time
// check we want alarm0
if (mp_obj_get_int(alarm_id) != 0) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid alarm"));
+ mp_raise_ValueError("invalid alarm");
}
// set expiry time (in microseconds)
@@ -245,7 +244,7 @@ STATIC mp_obj_t pyb_rtc_irq(size_t n_args, const mp_obj_t *pos_args, mp_map_t *k
// check we want alarm0
if (args[ARG_trigger].u_int != 0) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid alarm"));
+ mp_raise_ValueError("invalid alarm");
}
// set the wake value