Build with libopencm3 as a submodule.
Fix incompatibilities with latest libopencm3.
This commit is contained in:
parent
206237e8dd
commit
09c0fb5773
|
@ -0,0 +1,3 @@
|
|||
[submodule "libopencm3"]
|
||||
path = libopencm3
|
||||
url = git@github.com:libopencm3/libopencm3.git
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 4e4496f70d00fe24b2c5d594d6500f537eeb6478
|
|
@ -2,10 +2,12 @@ CROSS_COMPILE ?= arm-none-eabi-
|
|||
CC = $(CROSS_COMPILE)gcc
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
|
||||
CFLAGS += -Istm32/include -mcpu=cortex-m3 -mthumb -DSTM32F1
|
||||
CFLAGS += -Istm32/include -mcpu=cortex-m3 -mthumb \
|
||||
-DSTM32F1 -I../libopencm3/include
|
||||
LDFLAGS_BOOT = -lopencm3_stm32f1 -Wl,--defsym,_stack=0x20005000 \
|
||||
-Wl,-T,platforms/stm32/blackmagic.ld -nostartfiles -lc -lnosys \
|
||||
-Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections
|
||||
-Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \
|
||||
-L../libopencm3/lib
|
||||
LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8002000
|
||||
|
||||
VPATH += platforms/stm32
|
||||
|
|
|
@ -228,12 +228,11 @@ static void adc_init(void)
|
|||
adc_off(ADC1);
|
||||
adc_disable_scan_mode(ADC1);
|
||||
adc_set_single_conversion_mode(ADC1);
|
||||
adc_enable_discontinous_mode_regular(ADC1);
|
||||
adc_disable_external_trigger_regular(ADC1);
|
||||
adc_set_right_aligned(ADC1);
|
||||
adc_set_conversion_time_on_all_channels(ADC1, ADC_SMPR_SMP_28DOT5CYC);
|
||||
|
||||
adc_on(ADC1);
|
||||
adc_power_on(ADC1);
|
||||
|
||||
/* Wait for ADC starting up. */
|
||||
for (int i = 0; i < 800000; i++) /* Wait a bit. */
|
||||
|
|
|
@ -2,10 +2,12 @@ CROSS_COMPILE ?= arm-none-eabi-
|
|||
CC = $(CROSS_COMPILE)gcc
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
|
||||
CFLAGS += -mcpu=cortex-m3 -mthumb -DSTM32F1
|
||||
CFLAGS += -mcpu=cortex-m3 -mthumb \
|
||||
-DSTM32F1 -I../libopencm3/include
|
||||
LDFLAGS = -lopencm3_stm32f1 -Wl,--defsym,_stack=0x20005000 \
|
||||
-Wl,-T,platforms/stm32/blackmagic.ld -nostartfiles -lc -lnosys \
|
||||
-Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections
|
||||
-Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \
|
||||
-L../libopencm3/lib
|
||||
|
||||
VPATH += platforms/stm32
|
||||
|
||||
|
|
Loading…
Reference in New Issue