aboutsummaryrefslogtreecommitdiff
path: root/test1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test1.cpp')
-rw-r--r--test1.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/test1.cpp b/test1.cpp
index 0e6ffe6..85dee38 100644
--- a/test1.cpp
+++ b/test1.cpp
@@ -18,6 +18,7 @@ extern "C" void high();
extern "C" void low();
SCB_Type *__SCB = ((SCB_Type *) SCB_BASE);
+//extern SCB_Type *__SCB;
struct hardfault_data_t {
uint32_t r0;
@@ -54,10 +55,11 @@ void HardFault_Handler_C(uint32_t * hardfault_args) {
*/
int main() {
-// SystemInit();
+ SystemInit();
+ SCB->SHCSR |= SCB_SHCSR_USGFAULTENA_Msk | SCB_SHCSR_MEMFAULTPENDED_Msk | SCB_SHCSR_BUSFAULTENA_Msk;
-// RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
-// RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOA, ENABLE);
+ RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
+ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOA, ENABLE);
// GPIO_InitTypeDef init;
// GPIO_StructInit(&init);