From fc4047e4b4b38c6c778f2d5f71c7412ecbab3152 Mon Sep 17 00:00:00 2001 From: Tomaz Solc Date: Mon, 24 Sep 2012 12:54:53 +0200 Subject: 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. --- lib/stm32/f1/Makefile | 4 ++-- lib/stm32/f1/rcc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/stm32/f1') diff --git a/lib/stm32/f1/Makefile b/lib/stm32/f1/Makefile index 3b4252b..4fdbf43 100644 --- a/lib/stm32/f1/Makefile +++ b/lib/stm32/f1/Makefile @@ -31,9 +31,9 @@ ARFLAGS = rcs OBJS = vector.o rcc.o gpio.o usart.o adc.o spi.o flash.o nvic.o \ rtc.o i2c.o dma.o systick.o exti.o scb.o ethernet.o \ usb_f103.o usb.o usb_control.o usb_standard.o can.o \ - timer.o usb_f107.o desig.o crc.o + timer.o usb_f107.o desig.o crc.o assert.o -VPATH += ../../usb:../ +VPATH += ../../usb:../:../../cm3 include ../../Makefile.include diff --git a/lib/stm32/f1/rcc.c b/lib/stm32/f1/rcc.c index 5fd9c62..ab3350b 100644 --- a/lib/stm32/f1/rcc.c +++ b/lib/stm32/f1/rcc.c @@ -48,6 +48,7 @@ LGPL License Terms @ref lgpl_license /**@{*/ +#include #include #include @@ -166,8 +167,7 @@ int rcc_osc_ready_int_flag(osc_t osc) break; } - /* Shouldn't be reached. */ - return -1; + cm3_assert_not_reached(); } /*-----------------------------------------------------------------------------*/ -- cgit v1.2.3