From 8f251e8a9d46634be4741f7f1aef3d52fb1b7dba Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 31 Dec 2010 18:18:39 +0100 Subject: Some more file/path restructuring. All #includes now explicitly use the "" format. If you want to get rid of the "libopencm3" prefix in your local project you can add a respective -I entry in your Makefile (not recommended though). All .ld files and .a libs are installed in $(TOOLCHAIN_DIR)/lib directly (as before), but are now renamed to avoid potential conflicts now or in the future. Examples: libopencm3_lpc13xx.a libopencm3_lpc13xx.ld libopencm3_stm32.a libopencm3_stm32.ld --- lib/stm32/adc.c | 2 +- lib/stm32/can.c | 4 +-- lib/stm32/dma.c | 2 +- lib/stm32/ethernet.c | 2 +- lib/stm32/exti.c | 4 +-- lib/stm32/flash.c | 2 +- lib/stm32/gpio.c | 2 +- lib/stm32/i2c.c | 2 +- lib/stm32/libopencm3_stm32.ld | 63 +++++++++++++++++++++++++++++++++++++++++++ lib/stm32/nvic.c | 2 +- lib/stm32/rcc.c | 4 +-- lib/stm32/rtc.c | 6 ++--- lib/stm32/scb.c | 2 +- lib/stm32/spi.c | 2 +- lib/stm32/stm32.ld | 63 ------------------------------------------- lib/stm32/systick.c | 2 +- lib/stm32/timer.c | 2 +- lib/stm32/usart.c | 2 +- 18 files changed, 84 insertions(+), 84 deletions(-) create mode 100644 lib/stm32/libopencm3_stm32.ld delete mode 100644 lib/stm32/stm32.ld (limited to 'lib/stm32') diff --git a/lib/stm32/adc.c b/lib/stm32/adc.c index fa32b25..058837c 100644 --- a/lib/stm32/adc.c +++ b/lib/stm32/adc.c @@ -31,7 +31,7 @@ * reg16 = adc_read(ADC1, ADC_CH_0); */ -#include +#include void rcc_set_adc_clk(u32 prescaler) { diff --git a/lib/stm32/can.c b/lib/stm32/can.c index 73f102f..3266133 100644 --- a/lib/stm32/can.c +++ b/lib/stm32/can.c @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include void can_reset(u32 canport) { diff --git a/lib/stm32/dma.c b/lib/stm32/dma.c index 84a10c7..8feb2c9 100644 --- a/lib/stm32/dma.c +++ b/lib/stm32/dma.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include void dma_enable_mem2mem_mode(u32 dma, u8 channel) { diff --git a/lib/stm32/ethernet.c b/lib/stm32/ethernet.c index 980b941..4a4d080 100644 --- a/lib/stm32/ethernet.c +++ b/lib/stm32/ethernet.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include void eth_smi_write(u8 phy, u8 reg, u16 data) { diff --git a/lib/stm32/exti.c b/lib/stm32/exti.c index 4961eab..cdc2347 100644 --- a/lib/stm32/exti.c +++ b/lib/stm32/exti.c @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include void exti_set_trigger(u32 extis, exti_trigger_type trig) { diff --git a/lib/stm32/flash.c b/lib/stm32/flash.c index b623fc7..98f7777 100644 --- a/lib/stm32/flash.c +++ b/lib/stm32/flash.c @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include +#include void flash_prefetch_buffer_enable(void) { diff --git a/lib/stm32/gpio.c b/lib/stm32/gpio.c index 4811b54..333fcaf 100644 --- a/lib/stm32/gpio.c +++ b/lib/stm32/gpio.c @@ -34,7 +34,7 @@ * - GPIO remapping support */ -#include +#include void gpio_set_mode(u32 gpioport, u8 mode, u8 cnf, u16 gpios) { diff --git a/lib/stm32/i2c.c b/lib/stm32/i2c.c index e16b824..e1a3b84 100644 --- a/lib/stm32/i2c.c +++ b/lib/stm32/i2c.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include void i2c_peripheral_enable(u32 i2c) { diff --git a/lib/stm32/libopencm3_stm32.ld b/lib/stm32/libopencm3_stm32.ld new file mode 100644 index 0000000..b0e202e --- /dev/null +++ b/lib/stm32/libopencm3_stm32.ld @@ -0,0 +1,63 @@ +/* + * This file is part of the libopencm3 project. + * + * Copyright (C) 2009 Uwe Hermann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* Generic linker script for STM32 targets using libopencm3. */ + +/* Memory regions must be defined in the ld script which includes this one. */ + +/* Enforce emmition of the vector table */ +EXTERN (vector_table) + +/* Define sections. */ +SECTIONS +{ + . = ORIGIN(rom); + + .text : { + *(.vectors) /* Vector table */ + *(.text*) /* Program code */ + *(.rodata*) /* Read-only data */ + _etext = .; + } >rom + + . = ORIGIN(ram); + + .data : { + _data = .; + *(.data*) /* Read-write initialized data */ + _edata = .; + } >ram AT >rom + + .bss : { + *(.bss*) /* Read-write zero initialized data */ + *(COMMON) + _ebss = .; + } >ram AT >rom + + /* + * The .eh_frame section appears to be used for C++ exception handling. + * You may need to fix this if you're using C++. + */ + /DISCARD/ : { *(.eh_frame) } + + end = .; +} + +PROVIDE(_stack = 0x20000800); + diff --git a/lib/stm32/nvic.c b/lib/stm32/nvic.c index c9dcf3c..cf77cc3 100644 --- a/lib/stm32/nvic.c +++ b/lib/stm32/nvic.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include void nvic_enable_irq(u8 irqn) { diff --git a/lib/stm32/rcc.c b/lib/stm32/rcc.c index eddc667..997163a 100644 --- a/lib/stm32/rcc.c +++ b/lib/stm32/rcc.c @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include void rcc_osc_ready_int_clear(osc_t osc) { diff --git a/lib/stm32/rtc.c b/lib/stm32/rtc.c index 1396559..4495641 100644 --- a/lib/stm32/rtc.c +++ b/lib/stm32/rtc.c @@ -18,9 +18,9 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include void rtc_awake_from_off(osc_t clock_source) { diff --git a/lib/stm32/scb.c b/lib/stm32/scb.c index cd95bca..dfee6c3 100644 --- a/lib/stm32/scb.c +++ b/lib/stm32/scb.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include void scb_reset_core(void) { diff --git a/lib/stm32/spi.c b/lib/stm32/spi.c index 918617a..733a1bc 100644 --- a/lib/stm32/spi.c +++ b/lib/stm32/spi.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include /* * SPI and I2S code. diff --git a/lib/stm32/stm32.ld b/lib/stm32/stm32.ld deleted file mode 100644 index b0e202e..0000000 --- a/lib/stm32/stm32.ld +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of the libopencm3 project. - * - * Copyright (C) 2009 Uwe Hermann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* Generic linker script for STM32 targets using libopencm3. */ - -/* Memory regions must be defined in the ld script which includes this one. */ - -/* Enforce emmition of the vector table */ -EXTERN (vector_table) - -/* Define sections. */ -SECTIONS -{ - . = ORIGIN(rom); - - .text : { - *(.vectors) /* Vector table */ - *(.text*) /* Program code */ - *(.rodata*) /* Read-only data */ - _etext = .; - } >rom - - . = ORIGIN(ram); - - .data : { - _data = .; - *(.data*) /* Read-write initialized data */ - _edata = .; - } >ram AT >rom - - .bss : { - *(.bss*) /* Read-write zero initialized data */ - *(COMMON) - _ebss = .; - } >ram AT >rom - - /* - * The .eh_frame section appears to be used for C++ exception handling. - * You may need to fix this if you're using C++. - */ - /DISCARD/ : { *(.eh_frame) } - - end = .; -} - -PROVIDE(_stack = 0x20000800); - diff --git a/lib/stm32/systick.c b/lib/stm32/systick.c index 998c0ed..882601d 100644 --- a/lib/stm32/systick.c +++ b/lib/stm32/systick.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include void systick_set_reload(u32 value) { diff --git a/lib/stm32/timer.c b/lib/stm32/timer.c index be90d06..ae51f1e 100644 --- a/lib/stm32/timer.c +++ b/lib/stm32/timer.c @@ -25,7 +25,7 @@ * TIM_CR1_CMS_CENTRE_3, TIM_CR1_DIR_UP); */ -#include +#include void timer_set_mode(u32 timer_peripheral, u8 clock_div, u8 alignment, u8 direction) diff --git a/lib/stm32/usart.c b/lib/stm32/usart.c index a16e45a..f644776 100644 --- a/lib/stm32/usart.c +++ b/lib/stm32/usart.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include void usart_set_baudrate(u32 usart, u32 baud) { -- cgit v1.2.3