diff --git a/mk/librfn.mk b/mk/librfn.mk index bc695ff..6768da1 100644 --- a/mk/librfn.mk +++ b/mk/librfn.mk @@ -7,7 +7,15 @@ $(info Using $(LIBRFN_DIR) path to librfn library) endif OBJS += \ - ringbuf.o + bitops.o \ + fibre.o \ + fibre_default.o \ + list.o \ + messageq.o \ + regdump.o \ + ringbuf.o \ + time_libopencm3.o \ + util.o vpath %.c $(LIBRFN_DIR)/librfn vpath %.c $(LIBRFN_DIR)/librfn/libopencm3 diff --git a/projects/rfdsatt/Makefile b/projects/rfdsatt/Makefile index 125eb9a..d5ca8a4 100644 --- a/projects/rfdsatt/Makefile +++ b/projects/rfdsatt/Makefile @@ -30,7 +30,7 @@ OBJS = attenuator.o board_rfdsatt_4ch.o LDSCRIPT = ./stm32f103-openblt.ld LIBNAME = opencm3_stm32f1 -DEFS += -DSTM32F1 +DEFS += -DSTM32F1 -DF_CPU=48000000 FP_FLAGS ?= -msoft-float ARCH_FLAGS = -mthumb -mcpu=cortex-m3 $(FP_FLAGS) -mfix-cortex-m3-ldrd diff --git a/projects/rfdsatt/rfdsatt.c b/projects/rfdsatt/rfdsatt.c index 3f343a4..39c4a24 100644 --- a/projects/rfdsatt/rfdsatt.c +++ b/projects/rfdsatt/rfdsatt.c @@ -26,6 +26,8 @@ #include #include +#include + #include #include @@ -40,19 +42,12 @@ static uint32_t last_reset_cause; extern const struct attenuator_cfg board_att_cfg; extern struct attenuator_state *board_att_st[]; -volatile uint32_t jiffies; - -void sys_tick_handler(void) -{ - jiffies++; -} - /* busy wait specified number of ms */ void msleep(uint32_t delay) { - uint32_t wake = jiffies + delay; + uint32_t wake = time_now() + delay; do { - } while (wake > jiffies); + } while (wake > time_now()); } /*********************************************************************** @@ -65,10 +60,6 @@ static void clock_setup(void) /* HCLK=48MHz; ADC=6MHz; APB1=24MHz; APB2=48MHz; USB=48MHz */ /* tick rate of 1ms */ - systick_set_reload(48000); - systick_set_clocksource(STK_CSR_CLKSOURCE_AHB); - systick_counter_enable(); - systick_interrupt_enable(); /* Enable GPIOC clock. */ rcc_periph_clock_enable(RCC_GPIOA);