summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDaniel Campora <daniel@wipy.io>2015-09-03 10:16:51 +0200
committerDaniel Campora <daniel@wipy.io>2015-09-10 07:59:29 +0200
commit42054c3cad3c31fa25c09450577d986b62d983c0 (patch)
treefde92907b6075f4aa11d14dc19f4b7c92723668a
parent598aad214030685778623f83b7ed5aeb308385b7 (diff)
downloadmicropython-42054c3cad3c31fa25c09450577d986b62d983c0.tar.gz
micropython-42054c3cad3c31fa25c09450577d986b62d983c0.zip
cc3200: Add mphal error to raise hardware related exceptions.
-rw-r--r--cc3200/hal/cc3200_hal.c4
-rw-r--r--cc3200/hal/cc3200_hal.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/cc3200/hal/cc3200_hal.c b/cc3200/hal/cc3200_hal.c
index 526211fee2..827b59f65e 100644
--- a/cc3200/hal/cc3200_hal.c
+++ b/cc3200/hal/cc3200_hal.c
@@ -128,6 +128,10 @@ void HAL_Delay(uint32_t delay) {
}
}
+NORETURN void mp_hal_raise(int errno) {
+ nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, mp_obj_new_int(errno)));
+}
+
void mp_hal_set_interrupt_char (int c) {
mpexception_set_interrupt_char (c);
}
diff --git a/cc3200/hal/cc3200_hal.h b/cc3200/hal/cc3200_hal.h
index dfffe0b7a8..ccf5d493ca 100644
--- a/cc3200/hal/cc3200_hal.h
+++ b/cc3200/hal/cc3200_hal.h
@@ -69,6 +69,7 @@ extern void HAL_SystemDeInit (void);
extern void HAL_IncrementTick(void);
extern uint32_t HAL_GetTick(void);
extern void HAL_Delay(uint32_t delay);
+extern NORETURN void mp_hal_raise(int errno);
extern void mp_hal_set_interrupt_char (int c);
int mp_hal_stdin_rx_chr(void);