<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/include}""/>\r
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/MicroBlaze}""/>\r
</option>\r
+ <option id="xilinx.gnu.compiler.misc.other.1660455181" name="Other flags" superClass="xilinx.gnu.compiler.misc.other" value="-c -fmessage-length=0" valueType="string"/>\r
<inputType id="xilinx.gnu.compiler.input.505106416" name="C source files" superClass="xilinx.gnu.compiler.input"/>\r
</tool>\r
<tool id="xilinx.gnu.mb.cxx.toolchain.compiler.debug.2087155544" name="MicroBlaze g++ compiler" superClass="xilinx.gnu.mb.cxx.toolchain.compiler.debug">\r
<listOptionValue builtIn="false" value="../../RTOSDemoBSP/microblaze_0/lib"/>\r
</option>\r
<option id="xilinx.gnu.c.linker.option.lscript.1073578867" name="Linker Script" superClass="xilinx.gnu.c.linker.option.lscript" value="../src/lscript.ld" valueType="string"/>\r
+ <option id="xilinx.gnu.c.link.option.ldflags.471396681" name="Linker Flags" superClass="xilinx.gnu.c.link.option.ldflags" value="-Map=output.map" valueType="string"/>\r
+ <option id="xilinx.gnu.c.link.option.other.791541632" name="Other options (-XLinker [option])" superClass="xilinx.gnu.c.link.option.other" valueType="stringList"/>\r
<inputType id="xilinx.gnu.linker.input.1399699093" superClass="xilinx.gnu.linker.input">\r
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>\r
<additionalInput kind="additionalinput" paths="$(LIBS)"/>\r
#define configCPU_CLOCK_HZ ( XPAR_MICROBLAZE_CORE_CLOCK_FREQ_HZ ) /* Not actually used in this demo as the timer is set up in main and uses the peripheral clock, not the CPU clock. */\r
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )\r
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 6 )\r
-#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 60 * 1024 ) )\r
+#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 200 * 1024 ) )\r
#define configMAX_TASK_NAME_LEN ( 10 )\r
#define configUSE_TRACE_FACILITY 0\r
-#define configUSE_16_BIT_TICKS 1\r
+#define configUSE_16_BIT_TICKS 0\r
#define configIDLE_SHOULD_YIELD 1\r
#define configUSE_MUTEXES 1\r
#define configQUEUE_REGISTRY_SIZE 0\r
#define configUSE_MALLOC_FAILED_HOOK 1\r
#define configUSE_APPLICATION_TASK_TAG 0\r
#define configUSE_COUNTING_SEMAPHORES 1\r
-#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 230 )\r
+#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 250 )\r
#define configINTERRUPT_STACK_SIZE configMINIMAL_STACK_SIZE\r
\r
/* Co-routine definitions. */\r
\r
/* Software timer definitions. */\r
#define configUSE_TIMERS 1\r
-#define configTIMER_TASK_PRIORITY ( 3 )\r
+#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )\r
#define configTIMER_QUEUE_LENGTH 10\r
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE )\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
+void vlistGET_OWNER_OF_NEXT_ENTRY( void *pxTCB, xList *pxList )\r
+{\r
+xList * const pxConstList = ( pxList );\r
+ /* Increment the index to the next item and return the item, ensuring */\r
+ /* we don't return the marker used at the end of the list. */\r
+ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext;\r
+ if( ( pxConstList )->pxIndex == ( xListItem * ) &( ( pxConstList )->xListEnd ) )\r
+ {\r
+ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext;\r
+ }\r
+ ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner;\r
+}\r
\r
/* To limit the amount of stack required by each task, this port uses a\r
separate stack for interrupts. */\r
-unsigned long *pulISRStack;\r
+unsigned long ulISRStack;\r
+unsigned long *pulISRStack = &ulISRStack;\r
\r
/* The instance of the interrupt controller used by this port. */\r
static XIntc xInterruptControllerInstance;\r
pxTopOfStack--;\r
*pxTopOfStack = ( portSTACK_TYPE ) pxCode; /* R14 - return address for interrupt. */\r
pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x0f; /* R15 - return address for subroutine. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) NULL; /* R15 - return address for subroutine. */\r
pxTopOfStack--;\r
*pxTopOfStack = ( portSTACK_TYPE ) 0x10; /* R16 - return address for trap (debugger). */\r
pxTopOfStack--;\r
portBASE_TYPE xPortStartScheduler( void )\r
{\r
extern void ( vPortStartFirstTask )( void );\r
-extern unsigned long *_stack;\r
+extern unsigned long _stack[];\r
\r
/* Setup the hardware to generate the tick. Interrupts are disabled when\r
this function is called. */\r
vApplicationSetupTimerInterrupt();\r
\r
/* Allocate the stack to be used by the interrupt handler. */\r
- pulISRStack = _stack;\r
+ pulISRStack = ( unsigned long * ) _stack;\r
+ pulISRStack--;\r
\r
/* Restore the context of the first task that is going to run. From here\r
on, the created tasks will be executing. */\r
prvLockQueue( pxQueue );\r
if( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0U )\r
{\r
- /* There is nothing in the queue, block for the specified period. */\r
- vTaskPlaceOnEventListRestricted( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait );\r
+ /* There is nothing in the queue, block for the specified period,\r
+ provided the period is not zero. This guards against the case\r
+ where the time to wake is set to zero because there are no active\r
+ timers, but the tick count value also happens to be zero - creating\r
+ a block time of zero which confuses the logic. */\r
+ if( 1 )//_RB_if( xTicksToWait != 0U ) //_RB_ This should not be needed as the scheduler is suspended so the tick count cannot increment.\r
+ {\r
+ vTaskPlaceOnEventListRestricted( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait );\r
+ }\r
}\r
prvUnlockQueue( pxQueue );\r
}\r
designed for use by kernel code, and has special calling requirements -\r
it should be called from a critical section. */\r
\r
- \r
+\r
/* Place the event list item of the TCB in the appropriate event list.\r
In this case it is assume that this is the only task that is going to\r
be waiting on this event list, so the faster vListInsertEnd() function\r
/* Just to avoid compiler warnings. */\r
( void ) pvParameters;\r
\r
+ vTaskDelay( 2 );\r
+\r
for( ;; )\r
{\r
/* Query the timers list to see if it contains any timers, and if so,\r
" addi r31, r0, 1031 \n\t"\r
);\r
\r
+ /* Yield. */\r
+ asm volatile ( "Loop_Start_2: \n\t" \\r
+ "bralid r14, VPortYieldASM \n\t" \\r
+ "or r0, r0, r0 \n\t" );\r
+\r
/* Now test the register values to ensure they contain the same value that\r
was written to them above. This task will get preempted frequently so \r
other tasks are likely to have executed since the register values were \r
written. */\r
-\r
- asm volatile ( "Loop_Start_2: \n\t" \\r
- " xori r18, r3, 103 \n\t" \\r
+ asm volatile ( " xori r18, r3, 103 \n\t" \\r
" bnei r18, Error_Loop_2 \n\t" \\r
" xori r18, r4, 104 \n\t" \\r
" bnei r18, Error_Loop_2 \n\t" \\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY );\r
-// vStartQueuePeekTasks();\r
-// vStartRecursiveMutexTasks();\r
-// vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
+ vStartQueuePeekTasks();\r
+ vStartRecursiveMutexTasks();\r
+ vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
\r
/* The suicide tasks must be created last as they need to know how many\r
tasks were running prior to their creation in order to ascertain whether\r
the reasons stated in the comments above the call to\r
vStartTimerDemoTask(), that the check timer is not actually started\r
until after the scheduler has been started. */\r
-// xCheckTimer = xTimerCreate( ( const signed char * ) "Check timer", mainNO_ERROR_CHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback );\r
+ xCheckTimer = xTimerCreate( ( const signed char * ) "Check timer", mainNO_ERROR_CHECK_TIMER_PERIOD, pdTRUE, ( void * ) 0, vCheckTimerCallback );\r
\r
/* Ensure the check timer will start running as soon as the scheduler\r
starts. The block time is set to 0 (mainDONT_BLOCK), but would be\r
ingnored at this point anyway as block times can only be specified when\r
the scheduler is running. */\r
-// xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
+ xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
\r
/* Start the tasks running. */\r
vTaskStartScheduler();\r