Unverified Commit 99b32b84 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Update to latest FreeRTOS main, not SMP branch (#2250)

FreeRTOS has merged the SMP branch into its main, so move to that and
adjust the core accordingly.  V11.1.0 + several minor edits.
parent 91240567
Subproject commit e1d1aab5c0e0addd2950ddfb78711a96461c2dcf
Subproject commit 6a303231eceaec08a26a7e534800ba4010cec58d
#define configNUM_CORES 2
#define configUSE_CORE_AFFINITY 1
#define configRUN_MULTIPLE_PRIORITIES 1
#define configNUMBER_OF_CORES 2
#define configUSE_CORE_AFFINITY 1
#define configRUN_MULTIPLE_PRIORITIES 1
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_MINIMAL_IDLE_HOOK 1
#define configUSE_PASSIVE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned long ) F_CPU )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
......@@ -38,7 +38,7 @@ extern unsigned long ulMainGetRunTimeCounterValue(void);
#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 1
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Software timer definitions. */
......@@ -99,7 +99,14 @@ extern unsigned long ulMainGetRunTimeCounterValue(void);
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
extern void rtosFatalError(void);
#ifdef __cplusplus
extern "C" {
#endif
void rtosFatalError(void);
#ifdef __cplusplus
};
#endif
#define configASSERT( x ) \
if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); rtosFatalError(); }
......@@ -107,4 +114,6 @@ extern void rtosFatalError(void);
#define configSUPPORT_PICO_SYNC_INTEROP 1
#define configSUPPORT_PICO_TIME_INTEROP 1
#define LIB_PICO_MULTICORE 1
#include "rp2040_config.h"
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/idle_task_static_memory.c"
#include "../lib/FreeRTOS-Kernel/tasks.c"
//See https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/496
// See https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/496
struct _reent* __wrap___getreent(void) {
// No lock needed because if this changes, we won't be running anymore.
TCB_t *pxCurTask = xTaskGetCurrentTaskHandle();
......@@ -9,6 +9,6 @@ struct _reent* __wrap___getreent(void) {
return _GLOBAL_REENT;
} else {
// We have a task; return its reentrant struct.
return &pxCurTask->xNewLib_reent;
return &pxCurTask->xTLSBlock;
}
}
......@@ -258,7 +258,7 @@ void vApplicationIdleHook(void) {
#endif /* configUSE_IDLE_HOOK == 1 */
/*-----------------------------------------------------------*/
#if ( configUSE_MINIMAL_IDLE_HOOK == 1 )
//#if ( configUSE_MINIMAL_IDLE_HOOK == 1 )
/*
Call the user defined minimalIdle() function from within the idle task.
This allows the application designer to add background functionality
......@@ -267,17 +267,17 @@ void vApplicationIdleHook(void) {
NOTE: vApplicationMinimalIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES, CALL A FUNCTION THAT MIGHT BLOCK.
*/
void minimalIdle(void) __attribute__((weak));
void minimalIdle() {} //Empty minimalIdle function
void passiveIdle(void) __attribute__((weak));
void passiveIdle() {} //Empty minimalIdle function
extern "C"
void vApplicationMinimalIdleHook(void) __attribute__((weak));
//void vApplicationPassiveIdleHook(void) __attribute__((weak));
void vApplicationMinimalIdleHook(void) {
minimalIdle();
void vApplicationPassiveIdleHook(void) {
passiveIdle();
}
#endif /* configUSE_MINIMAL_IDLE_HOOK == 1 */
//#endif /* configUSE_MINIMAL_IDLE_HOOK == 1 */
/*-----------------------------------------------------------*/
#if ( configUSE_TICK_HOOK == 1 )
......@@ -394,6 +394,22 @@ void vApplicationStackOverflowHook(TaskHandle_t xTask __attribute__((unused)),
#endif /* configCHECK_FOR_STACK_OVERFLOW >= 1 */
/*-----------------------------------------------------------*/
extern "C" void vApplicationGetPassiveIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
configSTACK_DEPTH_TYPE * puxIdleTaskStackSize,
BaseType_t xPassiveIdleTaskIndex) {
static StaticTask_t xIdleTaskTCBs[ configNUMBER_OF_CORES ];
static StackType_t uxIdleTaskStacks[ configNUMBER_OF_CORES ][ configMINIMAL_STACK_SIZE ];
*ppxIdleTaskTCBBuffer = &(xIdleTaskTCBs[ xPassiveIdleTaskIndex ]);
*ppxIdleTaskStackBuffer = &(uxIdleTaskStacks[ xPassiveIdleTaskIndex ][ 0 ]);
*puxIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}
#if ( configSUPPORT_STATIC_ALLOCATION >= 1 )
extern "C"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment