summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Borges <paulo.borges@openbossa.org>2013-12-20 18:34:40 -0300
committerPaulo Borges <paulo.borges@openbossa.org>2013-12-22 22:43:06 -0300
commit58004ccadc1c9cc6fa9e153092ff57af5f64d718 (patch)
tree5023bdbe6db4443a6b960ebc9504dddae90589ec
parentfba0798cfacd603bc0c7506f4f5e8ab399115d6a (diff)
nrf51822: Add app_error_handler
-rw-r--r--platform/nrf51822/Makefile.platform1
-rw-r--r--platform/nrf51822/nrf51822.c36
2 files changed, 37 insertions, 0 deletions
diff --git a/platform/nrf51822/Makefile.platform b/platform/nrf51822/Makefile.platform
index 13ff024..e250e20 100644
--- a/platform/nrf51822/Makefile.platform
+++ b/platform/nrf51822/Makefile.platform
@@ -86,6 +86,7 @@ PLATFORM_SOURCE_FILES = system_nrf51.c \
app_fifo.c \
app_gpiote.c \
nrf_delay.c \
+ nrf51822.c \
log.c
PLATFORM_ASM_PATHS = $(SDK_TEMPLATE_PATH)/gcc
diff --git a/platform/nrf51822/nrf51822.c b/platform/nrf51822/nrf51822.c
new file mode 100644
index 0000000..9a928c4
--- /dev/null
+++ b/platform/nrf51822/nrf51822.c
@@ -0,0 +1,36 @@
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2013 Paulo B. de Oliveira Filho <pauloborgesfilho@gmail.com>
+ * Copyright (c) 2013 Claudio Takahasi <claudio.takahasi@gmail.com>
+ * Copyright (c) 2013 João Paulo Rechi Vita <jprvita@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include "log.h"
+
+void app_error_handler(uint32_t error_code, uint32_t line_num,
+ const uint8_t* p_file_name)
+{
+ ERROR("NRF error 0x%04x %s:%d", error_code, p_file_name, line_num);
+}