|
|
@@ -41,8 +41,17 @@
|
|
|
*
|
|
|
* See http://www.freertos.org/a00110.html.
|
|
|
*----------------------------------------------------------*/
|
|
|
-#include "nrf.h"
|
|
|
|
|
|
+// for OPT_MCU_
|
|
|
+#include "tusb_option.h"
|
|
|
+
|
|
|
+#if CFG_TUSB_MCU == OPT_MCU_NRF5X
|
|
|
+ #include "nrf.h"
|
|
|
+#elif CFG_TUSB_MCU == OPT_MCU_SAMD21 || CFG_TUSB_MCU == OPT_MCU_SAMD51
|
|
|
+ #include "sam.h"
|
|
|
+#else
|
|
|
+ #error "FreeRTOSConfig.h need to include low level mcu header for configuration"
|
|
|
+#endif
|
|
|
|
|
|
#define configUSE_PREEMPTION 1
|
|
|
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
|
|
@@ -50,7 +59,7 @@
|
|
|
#define configTICK_RATE_HZ ( 1000 )
|
|
|
#define configMAX_PRIORITIES ( 5 )
|
|
|
#define configMINIMAL_STACK_SIZE ( 128 )
|
|
|
-#define configTOTAL_HEAP_SIZE ( 16*1024 )
|
|
|
+#define configTOTAL_HEAP_SIZE ( 4*1024 )
|
|
|
#define configMAX_TASK_NAME_LEN 16
|
|
|
#define configUSE_16_BIT_TICKS 0
|
|
|
#define configIDLE_SHOULD_YIELD 1
|
|
|
@@ -108,18 +117,18 @@
|
|
|
/* Define to trap errors during development. */
|
|
|
// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
|
|
|
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
|
|
|
-#define configASSERT(_exp) \
|
|
|
- do {\
|
|
|
- if ( !(_exp) ) { \
|
|
|
- volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
|
|
|
- if ( (*ARM_CM_DHCSR) & 1UL ) { /* Only halt mcu if debugger is attached */ \
|
|
|
- taskDISABLE_INTERRUPTS(); \
|
|
|
- __asm("BKPT #0\n"); \
|
|
|
+ #define configASSERT(_exp) \
|
|
|
+ do {\
|
|
|
+ if ( !(_exp) ) { \
|
|
|
+ volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
|
|
|
+ if ( (*ARM_CM_DHCSR) & 1UL ) { /* Only halt mcu if debugger is attached */ \
|
|
|
+ taskDISABLE_INTERRUPTS(); \
|
|
|
+ __asm("BKPT #0\n"); \
|
|
|
+ }\
|
|
|
}\
|
|
|
- }\
|
|
|
- } while(0)
|
|
|
+ } while(0)
|
|
|
#else
|
|
|
-#define configASSERT( x )
|
|
|
+ #define configASSERT( x )
|
|
|
#endif
|
|
|
|
|
|
/* FreeRTOS hooks to NVIC vectors */
|
|
|
@@ -144,15 +153,6 @@
|
|
|
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
|
|
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
|
|
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
|
|
-
|
|
|
-/* SD priority
|
|
|
- * 0: SD timing critical
|
|
|
- * 1: SD memory protection
|
|
|
- * 2: App Highest
|
|
|
- * 3: App High
|
|
|
- * 4: SD non-time-critical
|
|
|
- * 5+ Remaining Application
|
|
|
- */
|
|
|
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
|
|
|
|
|
|
/* Interrupt priorities used by the kernel port layer itself. These are generic
|