X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Flib%2Fstm32f407.c;h=10ec8f463df142c69b744b3305f6621e33d30728;hp=603c0ebbb78e59f68feed946bd072914da8260e8;hb=60c3c89f25870849e5c64dd415429822f483bc3f;hpb=5bffb24e3e49be3e6667f45950cb158eda019b37 diff --git a/firmware/lib/stm32f407.c b/firmware/lib/stm32f407.c index 603c0eb..10ec8f4 100644 --- a/firmware/lib/stm32f407.c +++ b/firmware/lib/stm32f407.c @@ -6,6 +6,11 @@ #include "platform.h" +//! Count the length of a string. +uint32_t strlen(const char *s){ + return 0; +} + //! Initialize the STM32F4xx ports and USB. void stm32f4xx_init(){ @@ -42,3 +47,21 @@ void setbaud1(unsigned char rate){ } +//Declarations +void nmi_handler(void); +void hardfault_handler(void); +int main(void); + +//From min.s +void Reset_Handler(void); + + + +// Define the vector table +unsigned int * myvectors[50] + __attribute__ ((section("vectors")))= { + (unsigned int *) 0x20000800, // stack pointer + (unsigned int *) Reset_Handler, // code entry point + (unsigned int *) main, // NMI handler (not really) + (unsigned int *) main, // hard fault handler (let's hope not) +};