summaryrefslogtreecommitdiffstatshomepage
path: root/cc3200/mods/pybrtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'cc3200/mods/pybrtc.c')
-rw-r--r--cc3200/mods/pybrtc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/cc3200/mods/pybrtc.c b/cc3200/mods/pybrtc.c
index db00f49399..134bd440e7 100644
--- a/cc3200/mods/pybrtc.c
+++ b/cc3200/mods/pybrtc.c
@@ -25,11 +25,11 @@
* THE SOFTWARE.
*/
-#include <std.h>
-
#include "py/mpconfig.h"
#include "py/obj.h"
#include "py/runtime.h"
+#include "py/mperrno.h"
+#include "lib/timeutils/timeutils.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
@@ -38,7 +38,6 @@
#include "pybrtc.h"
#include "mpirq.h"
#include "pybsleep.h"
-#include "timeutils.h"
#include "simplelink.h"
#include "modnetwork.h"
#include "modwlan.h"
@@ -197,7 +196,7 @@ STATIC uint pyb_rtc_datetime_s_us(const mp_obj_t datetime, uint32_t *seconds) {
// set date and time
mp_obj_t *items;
- uint len;
+ size_t len;
mp_obj_get_array(datetime, &len, &items);
// verify the tuple
@@ -294,7 +293,7 @@ STATIC mp_obj_t pyb_rtc_make_new(const mp_obj_type_t *type, size_t n_args, size_
// check the peripheral id
if (args[0].u_int != 0) {
- mp_raise_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable);
+ mp_raise_OSError(MP_ENODEV);
}
// setup the object
@@ -362,7 +361,7 @@ STATIC mp_obj_t pyb_rtc_alarm (mp_uint_t n_args, const mp_obj_t *pos_args, mp_ma
// check the alarm id
if (args[0].u_int != 0) {
- mp_raise_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable);
+ mp_raise_OSError(MP_ENODEV);
}
uint32_t f_seconds;
@@ -397,7 +396,7 @@ STATIC mp_obj_t pyb_rtc_alarm_left (mp_uint_t n_args, const mp_obj_t *args) {
// only alarm id 0 is available
if (n_args > 1 && mp_obj_get_int(args[1]) != 0) {
- mp_raise_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable);
+ mp_raise_OSError(MP_ENODEV);
}
// get the current time
@@ -415,7 +414,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_rtc_alarm_left_obj, 1, 2, pyb_rtc
STATIC mp_obj_t pyb_rtc_alarm_cancel (mp_uint_t n_args, const mp_obj_t *args) {
// only alarm id 0 is available
if (n_args > 1 && mp_obj_get_int(args[1]) != 0) {
- mp_raise_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable);
+ mp_raise_OSError(MP_ENODEV);
}
// disable the alarm
pyb_rtc_disable_alarm();