summaryrefslogtreecommitdiff
path: root/vendor/freertos/FreeRTOSConfig.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-03-30 15:33:36 +0700
committerhathach <[email protected]>2018-03-30 15:33:36 +0700
commit82da013dadf2b2f69f362702ca40708fdec52df4 (patch)
treebfa9a73206ace7aca38dbf008a8277a6ea2d20bc /vendor/freertos/FreeRTOSConfig.h
parent97db3c7c3d7cfbbb19dbda09809aa39bb19608b9 (diff)
get freertos build
Diffstat (limited to 'vendor/freertos/FreeRTOSConfig.h')
-rw-r--r--vendor/freertos/FreeRTOSConfig.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/vendor/freertos/FreeRTOSConfig.h b/vendor/freertos/FreeRTOSConfig.h
index 09b78988a..fa1707f99 100644
--- a/vendor/freertos/FreeRTOSConfig.h
+++ b/vendor/freertos/FreeRTOSConfig.h
@@ -1,12 +1,12 @@
#ifndef __FREERTOS_CONFIG__H
#define __FREERTOS_CONFIG__H
-#include "common/assertion.h"
-
//--------------------------------------------------------------------+
// See http://www.freertos.org/a00110.html.
//--------------------------------------------------------------------+
#if TUSB_CFG_MCU == MCU_LPC43XX
+ // TODO remove
+ #include "lpc43xx_cgu.h"
#define configCPU_CLOCK_HZ CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE)
#else
#define configCPU_CLOCK_HZ SystemCoreClock
@@ -72,7 +72,25 @@
#define INCLUDE_xTimerPendFunctionCall 0
/* Define to trap errors during development. */
-#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); hal_debugger_breakpoint(); }
+
+// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
+#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
+
+static inline void configASSERT_breakpoint(void)
+{
+ // Cortex M CoreDebug->DHCSR
+ volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL);
+
+ // Only halt mcu if debugger is attached
+ if ( (*ARM_CM_DHCSR) & 1UL ) __asm("BKPT #0\n");
+}
+
+#else
+#define configASSERT_breakpoint()
+#endif
+
+
+#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); configASSERT_breakpoint(); }
/* FreeRTOS hooks to NVIC vectors */
#define xPortPendSVHandler PendSV_Handler