diff options
Diffstat (limited to 'src/wiring')
-rw-r--r-- | src/wiring/WProgram.h | 18 | ||||
-rw-r--r-- | src/wiring/wiring.c | 8 | ||||
-rw-r--r-- | src/wiring/wiring.h | 3 |
3 files changed, 28 insertions, 1 deletions
diff --git a/src/wiring/WProgram.h b/src/wiring/WProgram.h new file mode 100644 index 0000000..111c7dc --- /dev/null +++ b/src/wiring/WProgram.h @@ -0,0 +1,18 @@ +#include "stm32f10x_map.h" +#include "stm32f10x_lib.h" +#include "stm32f10x_flash.h" +#include "stm32f10x_usart.h" +#include "Serial.h" +#include "timers.h" +#include "wiring.h" +#include "util.h" +#include "systick.h" +#include "adc.h" +#include "gpio.h" +#include "pwm.h" +#include "ext_interrupts.h" +#include "usart.h" +#include "usb.h" + +void setup(); +void loop(); diff --git a/src/wiring/wiring.c b/src/wiring/wiring.c index 83679c7..bedce55 100644 --- a/src/wiring/wiring.c +++ b/src/wiring/wiring.c @@ -33,8 +33,14 @@ void init(void) { } void NVIC_Configuration(void) { +#ifdef VECT_TAB_ROM + NVIC_SetVectorTable(USER_ADDR_ROM, 0x0); +#elifdef VECT_TAB_RAM + NVIC_SetVectorTable(USER_ADDR_RAM, 0x0); +#else // VECT_TAB_BASE /* Set the Vector Table base location at 0x08000000 */ - NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0); + NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0); +#endif } diff --git a/src/wiring/wiring.h b/src/wiring/wiring.h index 789e697..4bf93bc 100644 --- a/src/wiring/wiring.h +++ b/src/wiring/wiring.h @@ -26,6 +26,9 @@ extern "C"{ #define LSBFIRST 0 #define MSBFIRST 1 +#define USER_ADDR_ROM 0x08005000 +#define USER_ADDR_RAM 0x20000C00 + #define lowByte(w) ((w) & 0xff) #define highByte(w) ((w) >> 8) #define bitRead(value, bit) (((value) >> (bit)) & 0x01) |