aboutsummaryrefslogtreecommitdiff
path: root/lib/stm32/f4
diff options
context:
space:
mode:
authorTomaz Solc2012-09-24 12:54:53 +0200
committerTomaz Solc2012-10-02 08:48:45 +0200
commitfc4047e4b4b38c6c778f2d5f71c7412ecbab3152 (patch)
tree33f7ca414e43decd2496cad20c4d2e702e43d929 /lib/stm32/f4
parent7851515c5c749294e82ce20cb23c6d528fb804b5 (diff)
Add assert macros to aid in debugging.
Adds libopencm3/cm3/assert.h header that provides assertion check macros similar to those provided by the standard C library. Thanks to Nicolas Schodet for help.
Diffstat (limited to 'lib/stm32/f4')
-rw-r--r--lib/stm32/f4/Makefile3
-rw-r--r--lib/stm32/f4/rcc.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/stm32/f4/Makefile b/lib/stm32/f4/Makefile
index 5760d29..85870a7 100644
--- a/lib/stm32/f4/Makefile
+++ b/lib/stm32/f4/Makefile
@@ -31,7 +31,8 @@ ARFLAGS = rcs
OBJS = vector.o rcc.o gpio.o usart.o spi.o flash.o nvic.o \
i2c.o systick.o exti.o scb.o pwr.o timer.o \
usb.o usb_standard.o usb_control.o usb_f107.o \
+ assert.o
-VPATH += ../../usb:../
+VPATH += ../../usb:../:../../cm3
include ../../Makefile.include
diff --git a/lib/stm32/f4/rcc.c b/lib/stm32/f4/rcc.c
index 6294ff7..f506d4b 100644
--- a/lib/stm32/f4/rcc.c
+++ b/lib/stm32/f4/rcc.c
@@ -19,6 +19,7 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <libopencm3/cm3/assert.h>
#include <libopencm3/stm32/f4/rcc.h>
#include <libopencm3/stm32/f4/pwr.h>
#include <libopencm3/stm32/f4/flash.h>
@@ -139,8 +140,7 @@ int rcc_osc_ready_int_flag(osc_t osc)
break;
}
- /* Shouldn't be reached. */
- return -1;
+ cm3_assert_not_reached();
}
void rcc_css_int_clear(void)