drop two-line vector.c dispatchers in favor of central dispatch
This commit is contained in:
parent
172ce56e3c
commit
5afa53f01a
@ -20,6 +20,9 @@
|
|||||||
|
|
||||||
#include <libopencm3/cm3/vector.h>
|
#include <libopencm3/cm3/vector.h>
|
||||||
|
|
||||||
|
/* load optional platform dependent initialization routines */
|
||||||
|
#include "../dispatch/vector.c"
|
||||||
|
|
||||||
#define WEAK __attribute__ ((weak))
|
#define WEAK __attribute__ ((weak))
|
||||||
|
|
||||||
/* Symbols exported by the linker script(s): */
|
/* Symbols exported by the linker script(s): */
|
||||||
@ -70,6 +73,9 @@ void WEAK reset_handler(void)
|
|||||||
while (dest < &_ebss)
|
while (dest < &_ebss)
|
||||||
*dest++ = 0;
|
*dest++ = 0;
|
||||||
|
|
||||||
|
/* might be provided by platform specific vector.c */
|
||||||
|
pre_main();
|
||||||
|
|
||||||
/* Call the application's entry point. */
|
/* Call the application's entry point. */
|
||||||
main();
|
main();
|
||||||
}
|
}
|
||||||
|
11
lib/dispatch/vector.c
Normal file
11
lib/dispatch/vector.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#if defined(STM32F4)
|
||||||
|
# include "../stm32/f4/vector.c"
|
||||||
|
|
||||||
|
#elif defined(LPC43XX)
|
||||||
|
# include "../lpc43xx/vector.c"
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static void pre_main(void) {}
|
||||||
|
|
||||||
|
#endif
|
@ -1,2 +0,0 @@
|
|||||||
#include <libopencm3/efm32/tinygecko/irq.h>
|
|
||||||
#include "../../cm3/vector.c"
|
|
@ -1,2 +0,0 @@
|
|||||||
#include <libopencm3/lm3s/irq.h>
|
|
||||||
#include "../cm3/vector.c"
|
|
@ -1,2 +0,0 @@
|
|||||||
#include <libopencm3/lpc17xx/irq.h>
|
|
||||||
#include "../cm3/vector.c"
|
|
@ -18,17 +18,13 @@
|
|||||||
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/lpc43xx/irq.h>
|
|
||||||
#define reset_handler original_reset_handler
|
|
||||||
#include "../cm3/vector.c"
|
|
||||||
#undef reset_handler
|
|
||||||
#include <libopencm3/cm3/common.h>
|
#include <libopencm3/cm3/common.h>
|
||||||
|
|
||||||
extern unsigned _etext_ram, _text_ram, _etext_rom;
|
extern unsigned _etext_ram, _text_ram, _etext_rom;
|
||||||
|
|
||||||
#define CREG_M4MEMMAP MMIO32( (0x40043000 + 0x100) )
|
#define CREG_M4MEMMAP MMIO32( (0x40043000 + 0x100) )
|
||||||
|
|
||||||
void WEAK reset_handler(void)
|
static void pre_main(void)
|
||||||
{
|
{
|
||||||
volatile unsigned *src, *dest;
|
volatile unsigned *src, *dest;
|
||||||
|
|
||||||
@ -49,6 +45,4 @@ void WEAK reset_handler(void)
|
|||||||
|
|
||||||
/* Continue Execution in RAM */
|
/* Continue Execution in RAM */
|
||||||
}
|
}
|
||||||
|
|
||||||
original_reset_handler();
|
|
||||||
}
|
}
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
#include <libopencm3/stm32/f1/irq.h>
|
|
||||||
#include "../../cm3/vector.c"
|
|
@ -1,2 +0,0 @@
|
|||||||
#include <libopencm3/stm32/f2/irq.h>
|
|
||||||
#include "../../cm3/vector.c"
|
|
@ -18,16 +18,10 @@
|
|||||||
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/f4/irq.h>
|
|
||||||
#define reset_handler original_reset_handler
|
|
||||||
#include "../../cm3/vector.c"
|
|
||||||
#undef reset_handler
|
|
||||||
#include <libopencm3/stm32/f4/scb.h>
|
#include <libopencm3/stm32/f4/scb.h>
|
||||||
|
|
||||||
void WEAK reset_handler(void)
|
static void pre_main(void)
|
||||||
{
|
{
|
||||||
/* Enable access to Floating-Point coprocessor. */
|
/* Enable access to Floating-Point coprocessor. */
|
||||||
SCB_CPACR |= SCB_CPACR_FULL * (SCB_CPACR_CP10 | SCB_CPACR_CP11);
|
SCB_CPACR |= SCB_CPACR_FULL * (SCB_CPACR_CP10 | SCB_CPACR_CP11);
|
||||||
|
|
||||||
original_reset_handler();
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user