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
# build type specific flags
CFLAGS_debug=-O0 -ggdb #-DDEBUG
CFLAGS_debug=-O0 -ggdb -DDEBUG
LDFLAGS_debug=
CFLAGS_release=-Os -ggdb

View File

@ -14,37 +14,19 @@ extern funcp_t __fini_array_start, __fini_array_end;
void main(void);
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)
{
#ifndef DEBUG
volatile unsigned *src;
#endif
volatile unsigned *dest;
funcp_t *fp;
#ifndef DEBUG
for (src = &_data_loadaddr, dest = &_data;
dest < &_edata;
src++, dest++) {
*dest = *src;
}
#else
// set vector table offset register to the RAM base address
SCB_VTOR = 0x20000000;
dest = &_edata;
#endif
while (dest < &_ebss) {
*dest++ = 0;