mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-01 08:54:14 -04:00
Update Fujitsu 32bit port - work in progress.
This commit is contained in:
parent
778b0d13ef
commit
ba4d636307
7 changed files with 404 additions and 448 deletions
|
@ -48,8 +48,8 @@
|
|||
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_IDLE_HOOK 1
|
||||
#define configUSE_TICK_HOOK 1
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 100 )
|
||||
#define configUSE_TICK_HOOK 0
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 64000000 ) /* Clock setup from start91460.asm in the demo application. */
|
||||
#define configPER_CLOCK_HZ ( ( unsigned portLONG ) 16000000 ) /* Clock setup from start91460.asm in the demo application. */
|
||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 6 )
|
||||
|
@ -62,7 +62,7 @@
|
|||
#define configUSE_MUTEXES 1
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 1
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 4 )
|
||||
|
||||
|
||||
|
|
|
@ -40,19 +40,18 @@
|
|||
/* Demo app includes. */
|
||||
#include "flash.h"
|
||||
#include "integer.h"
|
||||
#include "comtest.h"
|
||||
#include "comtest2.h"
|
||||
#include "PollQ.h"
|
||||
#include "semtest.h"
|
||||
#include "BlockQ.h"
|
||||
#include "dynamic.h"
|
||||
#include "flop.h"
|
||||
#include "crflash.h"
|
||||
#include "crhook.h"
|
||||
#include "GenQTest.h"
|
||||
#include "QPeek.h"
|
||||
#include "BlockTim.h"
|
||||
#include "death.h"
|
||||
#include "taskutility.h"
|
||||
#include "partest.h"
|
||||
|
||||
/* Demo task priorities. */
|
||||
#define mainWATCHDOG_TASK_PRIORITY ( tskIDLE_PRIORITY + 5 )
|
||||
|
@ -78,7 +77,7 @@ LCD represent LED's]*/
|
|||
#define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS )
|
||||
|
||||
/* The total number of LEDs available. */
|
||||
#define ledNUMBER_OF_LEDS ( 8 )
|
||||
#define mainNO_CO_ROUTINE_LEDs ( 8 )
|
||||
|
||||
/* The first LED used by the comtest tasks. */
|
||||
#define mainCOM_TEST_LED ( 0x05 )
|
||||
|
@ -115,7 +114,7 @@ void main(void)
|
|||
{
|
||||
/* Initialise the hardware ready for the demo. */
|
||||
prvSetupHardware();
|
||||
|
||||
|
||||
/* Start the standard demo application tasks. */
|
||||
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
|
||||
vStartIntegerMathTasks( tskIDLE_PRIORITY );
|
||||
|
@ -125,12 +124,10 @@ void main(void)
|
|||
vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY );
|
||||
vStartDynamicPriorityTasks();
|
||||
vStartMathTasks( tskIDLE_PRIORITY );
|
||||
vStartFlashCoRoutines(ledNUMBER_OF_LEDS);
|
||||
vStartHookCoRoutines();
|
||||
vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
|
||||
vStartQueuePeekTasks();
|
||||
vCreateBlockTimeTasks();
|
||||
|
||||
|
||||
/* Start the 'Check' task which is defined in this file. */
|
||||
xTaskCreate( vErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
|
||||
|
||||
|
@ -160,7 +157,12 @@ void main(void)
|
|||
|
||||
static void vErrorChecks( void *pvParameters )
|
||||
{
|
||||
portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY;
|
||||
portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime;
|
||||
|
||||
|
||||
/* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
|
||||
works correctly. */
|
||||
xLastExecutionTime = xTaskGetTickCount();
|
||||
|
||||
/* Cycle for ever, delaying then checking all the other tasks are still
|
||||
operating without error. */
|
||||
|
@ -169,7 +171,8 @@ portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY;
|
|||
/* Wait until it is time to check again. The time we wait here depends
|
||||
on whether an error has been detected or not. When an error is
|
||||
detected the time is shortened resulting in a faster LED flash rate. */
|
||||
vTaskDelay( xDelayPeriod );
|
||||
/* Perform this check every mainCHECK_DELAY milliseconds. */
|
||||
vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );
|
||||
|
||||
/* See if the other tasks are all ok. */
|
||||
if( prvCheckOtherTasksAreStillRunning() != pdPASS )
|
||||
|
@ -181,14 +184,14 @@ portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY;
|
|||
}
|
||||
|
||||
/* Flash! */
|
||||
vParTestToggleLED(mainCHECK_TEST_LED);
|
||||
vParTestToggleLED( mainCHECK_TEST_LED );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static portSHORT prvCheckOtherTasksAreStillRunning( void )
|
||||
{
|
||||
static portBASE_TYPE xErrorOccurred = pdFALSE;
|
||||
portBASE_TYPE lReturn = pdPASS;
|
||||
|
||||
/* The demo tasks maintain a count that increments every cycle of the task
|
||||
provided that the task has never encountered an error. This function
|
||||
|
@ -198,70 +201,60 @@ static portBASE_TYPE xErrorOccurred = pdFALSE;
|
|||
|
||||
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if( xArePollingQueuesStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreComTestTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreBlockingQueuesStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreMathsTaskStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
}
|
||||
|
||||
if( xAreFlashCoRoutinesStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
}
|
||||
|
||||
if( xAreHookCoRoutinesStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if( xIsCreateTaskStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if ( xAreGenericQueueTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
if ( xAreQueuePeekTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorOccurred = pdTRUE
|
||||
lReturn = pdFAIL;
|
||||
}
|
||||
|
||||
return sNoErrorFound;
|
||||
return lReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -283,20 +276,6 @@ static void prvSetupHardware( void )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* The below callback function is called from Tick ISR if configUSE_TICK_HOOK
|
||||
is configured as 1. This function needs to be uncommented if the crhook.c
|
||||
is not used, since the crhook.c has also defined vApplicationTickHook(). */
|
||||
#if configUSE_TICK_HOOK == 1
|
||||
void vApplicationTickHook ( void )
|
||||
{
|
||||
/* Are we using the tick interrupt to kick the watchdog? */
|
||||
#if WATCHDOG == WTC_IN_TICK
|
||||
Kick_Watchdog();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* The below callback function is called from Delayed ISR if configUSE_IDLE_HOOK
|
||||
is configured as 1. */
|
||||
#if configUSE_IDLE_HOOK == 1
|
||||
|
@ -306,7 +285,24 @@ is configured as 1. */
|
|||
#if WATCHDOG == WTC_IN_IDLE
|
||||
Kick_Watchdog();
|
||||
#endif
|
||||
|
||||
vCoRoutineSchedule();
|
||||
|
||||
#if configUSE_CO_ROUTINES == 1
|
||||
vCoRoutineSchedule();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
The below callback function is called from Tick ISR if configUSE_TICK_HOOK
|
||||
is configured as 1. */
|
||||
#if configUSE_TICK_HOOK == 1
|
||||
void vApplicationTickHook ( void )
|
||||
{
|
||||
#if WATCHDOG == WTC_IN_TICK
|
||||
Kick_Watchdog();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -10,66 +10,48 @@
|
|||
/*************************@INCLUDE_START************************/
|
||||
|
||||
|
||||
/* TODO: Add comment here regarding the behaviour of the demo. */
|
||||
|
||||
|
||||
/* Hardware specific includes. */
|
||||
#include "mb91467d.h"
|
||||
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
#define partstNUM_LEDs 8
|
||||
|
||||
static unsigned portSHORT sState[ ledNUMBER_OF_LEDS ] = { pdFALSE };
|
||||
static unsigned portSHORT sState1[ ledNUMBER_OF_LEDS ] = { pdFALSE };
|
||||
static unsigned portSHORT sState[ partstNUM_LEDs ] = { pdFALSE };
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
static void vPartestInitialise( void )
|
||||
void vParTestInitialise( void )
|
||||
{
|
||||
DDR16=0xFF;
|
||||
DDR25=0xFF;
|
||||
/* Set port for LED outputs. */
|
||||
DDR16 = 0xFF;
|
||||
|
||||
/* Start with LEDs off. */
|
||||
PDR25 = 0x00;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
|
||||
{
|
||||
if (uxLED < ledNUMBER_OF_LEDS)
|
||||
if( uxLED < partstNUM_LEDs )
|
||||
{
|
||||
vTaskSuspendAll();
|
||||
taskENTER_CRITICAL();
|
||||
|
||||
/* Toggle the state of the single genuine on board LED. */
|
||||
if( sState[uxLED])
|
||||
if( sState[ uxLED ])
|
||||
{
|
||||
PDR25 |= (1 << uxLED);
|
||||
PDR25 |= ( 1 << uxLED );
|
||||
}
|
||||
else
|
||||
{
|
||||
PDR25 &= ~(1 << uxLED);
|
||||
PDR25 &= ~( 1 << uxLED );
|
||||
}
|
||||
|
||||
sState[uxLED] = !(sState[uxLED]);
|
||||
sState[ uxLED ] = !( sState[ uxLED ] );
|
||||
|
||||
xTaskResumeAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
uxLED -= ledNUMBER_OF_LEDS;
|
||||
|
||||
vTaskSuspendAll();
|
||||
|
||||
/* Toggle the state of the single genuine on board LED. */
|
||||
if( sState1[uxLED])
|
||||
{
|
||||
PDR16 |= (1 << uxLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
PDR16 &= ~(1 << uxLED);
|
||||
}
|
||||
|
||||
sState1[uxLED] = !(sState1[uxLED]);
|
||||
|
||||
xTaskResumeAll();
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -77,40 +59,22 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
|
|||
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
|
||||
{
|
||||
/* Set or clear the output [in this case show or hide the '*' character. */
|
||||
if( uxLED < ledNUMBER_OF_LEDS )
|
||||
if( uxLED < partstNUM_LEDs )
|
||||
{
|
||||
vTaskSuspendAll();
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( xValue )
|
||||
{
|
||||
PDR25 |= (1 << uxLED);
|
||||
sState[uxLED] = 1;
|
||||
PDR25 |= ( 1 << uxLED );
|
||||
sState[ uxLED ] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
PDR25 &= ~(1 << uxLED);
|
||||
sState[uxLED] = 0;
|
||||
PDR25 &= ~( 1 << uxLED );
|
||||
sState[ uxLED ] = 0;
|
||||
}
|
||||
}
|
||||
xTaskResumeAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
uxLED -= ledNUMBER_OF_LEDS;
|
||||
vTaskSuspendAll();
|
||||
{
|
||||
if( xValue )
|
||||
{
|
||||
PDR16 |= (1 << uxLED);
|
||||
sState1[uxLED] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
PDR16 &= ~(1 << uxLED);
|
||||
sState1[uxLED] = 0;
|
||||
}
|
||||
}
|
||||
xTaskResumeAll();
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue