From 59b8634e10a2c173a2cdfc55191df85544b44a12 Mon Sep 17 00:00:00 2001
From: Sasan Golchin <ahmad.golchin@mail.polimi.it>
Date: Thu, 13 Oct 2016 11:24:10 +0200
Subject: [PATCH] SysTick leftover code cleared for stm32F407discovery board

---
 .../common/interfaces-impl/portability.cpp          | 13 -------------
 .../core/stage_1_boot.cpp                           |  3 ++-
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/portability.cpp b/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/portability.cpp
index c01d8c82..9b27e6ce 100644
--- a/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/portability.cpp
+++ b/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/portability.cpp
@@ -40,18 +40,6 @@
 #include <cassert>
 #include "interfaces/cstimer.h"
 
-/**
- * \internal
- * timer interrupt routine.
- * Since inside naked functions only assembler code is allowed, this function
- * only calls the ctxsave/ctxrestore macros (which are in assembler), and calls
- * the implementation code in ISR_preempt()
- */
-void SysTick_Handler()   __attribute__((naked));
-void SysTick_Handler()
-{
-}
-
 /**
  * \internal
  * software interrupt routine.
@@ -285,7 +273,6 @@ void IRQportableStartKernel()
     SCB->CCR |= SCB_CCR_DIV_0_TRP_Msk;
     NVIC_SetPriorityGrouping(7);//This should disable interrupt nesting
     NVIC_SetPriority(SVCall_IRQn,3);//High priority for SVC (Max=0, min=15)
-    NVIC_SetPriority(SysTick_IRQn,3);//High priority for SysTick (Max=0, min=15)
     NVIC_SetPriority(MemoryManagement_IRQn,2);//Higher priority for MemoryManagement (Max=0, min=15)
     
     #ifdef WITH_PROCESSES
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f407vg_stm32f4discovery/core/stage_1_boot.cpp b/miosix/arch/cortexM4_stm32f4/stm32f407vg_stm32f4discovery/core/stage_1_boot.cpp
index 5a339790..41405d27 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f407vg_stm32f4discovery/core/stage_1_boot.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f407vg_stm32f4discovery/core/stage_1_boot.cpp
@@ -99,7 +99,7 @@ void /*__attribute__((weak))*/ UsageFault_Handler();
 void /*__attribute__((weak))*/ SVC_Handler();
 void /*__attribute__((weak))*/ DebugMon_Handler();
 void /*__attribute__((weak))*/ PendSV_Handler();
-void /*__attribute__((weak))*/ SysTick_Handler();
+void __attribute__((weak)) SysTick_Handler();
 
 //Interrupt handlers
 void __attribute__((weak)) WWDG_IRQHandler();
@@ -377,3 +377,4 @@ void (* const __Vectors[])() __attribute__ ((section(".isr_vector"))) =
 #pragma weak CRYP_IRQHandler = Default_Handler
 #pragma weak HASH_RNG_IRQHandler = Default_Handler
 #pragma weak FPU_IRQHandler = Default_Handler
+#pragma weak SysTick_Handler = Default_Handler
\ No newline at end of file
-- 
GitLab