Code cleanup

This commit is contained in:
Thomas Kolb 2016-08-17 22:04:04 +02:00
parent dac3d34691
commit c93c3d41fb
2 changed files with 1 additions and 19 deletions

View file

@ -49,7 +49,7 @@ LDFLAGS+=-Lfxplib/lib/$(BUILD) -lfxp_stm32f0
LDFLAGS+=-Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group LDFLAGS+=-Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
# build type specific flags # build type specific flags
CFLAGS_debug=-O0 -ggdb #-DDEBUG CFLAGS_debug=-O0 -ggdb -DDEBUG
LDFLAGS_debug= LDFLAGS_debug=
CFLAGS_release=-Os -ggdb CFLAGS_release=-Os -ggdb

View file

@ -14,37 +14,19 @@ extern funcp_t __fini_array_start, __fini_array_end;
void main(void); void main(void);
caddr_t _sbrk(int incr); caddr_t _sbrk(int incr);
#if 0
// from libopencm3: lib/stm32/f4/vector_chipset.c
static void pre_main(void)
{
/* Enable access to Floating-Point coprocessor. */
SCB_CPACR |= SCB_CPACR_FULL * (SCB_CPACR_CP10 | SCB_CPACR_CP11);
}
#endif
void __attribute__ ((naked)) reset_handler(void) void __attribute__ ((naked)) reset_handler(void)
{ {
#ifndef DEBUG
volatile unsigned *src; volatile unsigned *src;
#endif
volatile unsigned *dest; volatile unsigned *dest;
funcp_t *fp; funcp_t *fp;
#ifndef DEBUG
for (src = &_data_loadaddr, dest = &_data; for (src = &_data_loadaddr, dest = &_data;
dest < &_edata; dest < &_edata;
src++, dest++) { src++, dest++) {
*dest = *src; *dest = *src;
} }
#else
// set vector table offset register to the RAM base address
SCB_VTOR = 0x20000000;
dest = &_edata;
#endif
while (dest < &_ebss) { while (dest < &_ebss) {
*dest++ = 0; *dest++ = 0;