mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 02:32:42 -05:00 
			
		
		
		
	Add Fujitsu FX definition to portable.h.
This commit is contained in:
		
							parent
							
								
									961e402e12
								
							
						
					
					
						commit
						c3e153145b
					
				
					 16 changed files with 1611 additions and 1998 deletions
				
			
		| 
						 | 
				
			
			@ -19,9 +19,9 @@ Exec=0
 | 
			
		|||
AutoLoad=1
 | 
			
		||||
 | 
			
		||||
[DirInfo]
 | 
			
		||||
WSP=E:\FreeRTOS\16FX\96340_FreeRTOS_96348hs\96340_FreeRTOS_96348hs\Demo\MB96340_Softune\
 | 
			
		||||
WSP=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\MB96340_Softune\
 | 
			
		||||
 | 
			
		||||
[EditState]
 | 
			
		||||
STATE-1=..\Common\Minimal\crflash_sk16fx100mpc.c:1
 | 
			
		||||
STATE-1=freertos_96348hs_sk16fx100pmc\src\serial\serial.c:192
 | 
			
		||||
Count=1
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
				
			
			@ -23,8 +23,9 @@ $0
 | 
			
		|||
-K UNROLL
 | 
			
		||||
$other
 | 
			
		||||
-INF srcin 
 | 
			
		||||
-D __96340
 | 
			
		||||
$time
 | 
			
		||||
1201715383
 | 
			
		||||
1202809404
 | 
			
		||||
$end
 | 
			
		||||
$1
 | 
			
		||||
-g
 | 
			
		||||
| 
						 | 
				
			
			@ -118,8 +119,9 @@ $0
 | 
			
		|||
-K UNROLL
 | 
			
		||||
$other
 | 
			
		||||
-INF srcin 
 | 
			
		||||
-D __96340
 | 
			
		||||
$time
 | 
			
		||||
1201715383
 | 
			
		||||
1202809404
 | 
			
		||||
$end
 | 
			
		||||
$1
 | 
			
		||||
-g
 | 
			
		||||
| 
						 | 
				
			
			@ -213,8 +215,9 @@ $0
 | 
			
		|||
-K UNROLL
 | 
			
		||||
$other
 | 
			
		||||
-INF srcin 
 | 
			
		||||
-D __96340
 | 
			
		||||
$time
 | 
			
		||||
1201715383
 | 
			
		||||
1202809404
 | 
			
		||||
$end
 | 
			
		||||
$1
 | 
			
		||||
-g
 | 
			
		||||
| 
						 | 
				
			
			@ -308,8 +311,9 @@ $0
 | 
			
		|||
-K UNROLL
 | 
			
		||||
$other
 | 
			
		||||
-INF srcin 
 | 
			
		||||
-D __96340
 | 
			
		||||
$time
 | 
			
		||||
1201715383
 | 
			
		||||
1202809404
 | 
			
		||||
$end
 | 
			
		||||
$1
 | 
			
		||||
-g
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,6 @@ Virtual CPU File=wv907e4.dll
 | 
			
		|||
Core ID=0
 | 
			
		||||
Monitor Load=1
 | 
			
		||||
Monitor Load Condition=Enable
 | 
			
		||||
ChangeFlag=Disable
 | 
			
		||||
[Device]
 | 
			
		||||
Communication=RS COM1 115200
 | 
			
		||||
ProductID=0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,6 @@ Virtual CPU File=wv907e4.dll
 | 
			
		|||
Core ID=0
 | 
			
		||||
Monitor Load=1
 | 
			
		||||
Monitor Load Condition=Enable
 | 
			
		||||
ChangeFlag=Enable
 | 
			
		||||
[Device]
 | 
			
		||||
Communication=USB 
 | 
			
		||||
ProductID=0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
				
			
			@ -1,456 +0,0 @@
 | 
			
		|||
/*
 | 
			
		||||
	FreeRTOS.org V4.7.1 - Copyright (C) 2003-2008 Richard Barry.
 | 
			
		||||
 | 
			
		||||
	This file is part of the FreeRTOS.org distribution.
 | 
			
		||||
 | 
			
		||||
	FreeRTOS.org is free software; you can redistribute it and/or modify
 | 
			
		||||
	it under the terms of the GNU General Public License as published by
 | 
			
		||||
	the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
	(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
	FreeRTOS.org is distributed in the hope that it will be useful,
 | 
			
		||||
	but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
	GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
	You should have received a copy of the GNU General Public License
 | 
			
		||||
	along with FreeRTOS.org; if not, write to the Free Software
 | 
			
		||||
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 | 
			
		||||
 | 
			
		||||
	A special exception to the GPL can be applied should you wish to distribute
 | 
			
		||||
	a combined work that includes FreeRTOS.org, without being obliged to provide
 | 
			
		||||
	the source code for any proprietary components.  See the licensing section
 | 
			
		||||
	of http://www.FreeRTOS.org for full details of how and when the exception
 | 
			
		||||
	can be applied.
 | 
			
		||||
 | 
			
		||||
	***************************************************************************
 | 
			
		||||
 | 
			
		||||
	Please ensure to read the configuration and relevant port sections of the 
 | 
			
		||||
	online documentation.
 | 
			
		||||
 | 
			
		||||
	+++ http://www.FreeRTOS.org +++
 | 
			
		||||
	Documentation, latest information, license and contact details.  
 | 
			
		||||
 | 
			
		||||
	+++ http://www.SafeRTOS.com +++
 | 
			
		||||
	A version that is certified for use in safety critical systems.
 | 
			
		||||
 | 
			
		||||
	+++ http://www.OpenRTOS.com +++
 | 
			
		||||
	Commercial support, development, porting, licensing and training services.
 | 
			
		||||
 | 
			
		||||
	***************************************************************************
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
  MAIN.C
 | 
			
		||||
  - description
 | 
			
		||||
  - See README.TXT for project description and disclaimer.
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 16FX includes */
 | 
			
		||||
#include "mb96348hs.h"
 | 
			
		||||
 | 
			
		||||
/* Scheduler includes. */
 | 
			
		||||
#include "FreeRTOS.h"
 | 
			
		||||
#include "task.h"
 | 
			
		||||
#include "semphr.h"
 | 
			
		||||
#include <watchdog.h>
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Demo task priorities. */
 | 
			
		||||
#define WTC_TASK_PRIORITY			( tskIDLE_PRIORITY + 5 )
 | 
			
		||||
#define mainCHECK_TASK_PRIORITY		( tskIDLE_PRIORITY + 4 )
 | 
			
		||||
#define TASK_UTILITY_PRIORITY		( tskIDLE_PRIORITY + 3 )
 | 
			
		||||
#define mainSEM_TEST_PRIORITY		( tskIDLE_PRIORITY + 3 )
 | 
			
		||||
#define mainCOM_TEST_PRIORITY		( tskIDLE_PRIORITY + 2 )
 | 
			
		||||
#define mainQUEUE_POLL_PRIORITY		( tskIDLE_PRIORITY + 2 )
 | 
			
		||||
#define mainQUEUE_BLOCK_PRIORITY	( tskIDLE_PRIORITY + 2 )
 | 
			
		||||
#define mainDEATH_PRIORITY			( tskIDLE_PRIORITY + 1 )
 | 
			
		||||
#define mainLED_TASK_PRIORITY		( tskIDLE_PRIORITY + 1 )
 | 
			
		||||
#define mainGENERIC_QUEUE_PRIORITY	( tskIDLE_PRIORITY )
 | 
			
		||||
 | 
			
		||||
/* Baud rate used by the COM test tasks. */
 | 
			
		||||
#define mainCOM_TEST_BAUD_RATE	( ( unsigned portLONG ) 19200 )
 | 
			
		||||
 | 
			
		||||
/* The frequency at which the 'Check' tasks executes.  See the comments at the 
 | 
			
		||||
top of the page.  When the system is operating error free the 'Check' task
 | 
			
		||||
toggles an LED every three seconds.  If an error is discovered in any task the
 | 
			
		||||
rate is increased to 500 milliseconds.  [in this case the '*' characters on the 
 | 
			
		||||
LCD represent LED's]*/
 | 
			
		||||
#define mainNO_ERROR_CHECK_DELAY	( (portTickType) 3000 / portTICK_RATE_MS )
 | 
			
		||||
#define mainERROR_CHECK_DELAY		( (portTickType) 500 / portTICK_RATE_MS )
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------*/
 | 
			
		||||
#define ledNUMBER_OF_LEDS	8
 | 
			
		||||
#define mainCOM_TEST_LED	0x05
 | 
			
		||||
#define mainCHECK_TEST_LED	0x07
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * The function that implements the Check task.  See the comments at the head
 | 
			
		||||
 * of the page for implementation details.
 | 
			
		||||
 */
 | 
			
		||||
static void					vErrorChecks( void *pvParameters );
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Called by the Check task.  Returns pdPASS if all the other tasks are found
 | 
			
		||||
 * to be operating without error - otherwise returns pdFAIL.
 | 
			
		||||
 */
 | 
			
		||||
static portSHORT			prvCheckOtherTasksAreStillRunning( void );
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------*/
 | 
			
		||||
static unsigned portCHAR	sState[2] = { 0xFF, 0xFF };
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
 * The below callback function is called from Tick ISR if configUSE_TICK_HOOK 
 | 
			
		||||
 * is configured as 1.
 | 
			
		||||
 *---------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/*void vApplicationTickHook ( void )
 | 
			
		||||
{
 | 
			
		||||
#if WATCHDOG == WTC_IN_TICK
 | 
			
		||||
	Kick_Watchdog();
 | 
			
		||||
#endif
 | 
			
		||||
}*/
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
 * The below callback function is called from Delayed ISR if configUSE_IDLE_HOOK 
 | 
			
		||||
 * is configured as 1.
 | 
			
		||||
 *---------------------------------------------------------------------------*/
 | 
			
		||||
void vApplicationIdleHook( void )
 | 
			
		||||
{
 | 
			
		||||
	#if WATCHDOG == WTC_IN_IDLE
 | 
			
		||||
	Kick_Watchdog();
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartFlashCoRoutines == 1 || INCLUDE_StartHookCoRoutines == 1 )
 | 
			
		||||
	vCoRoutineSchedule();
 | 
			
		||||
	#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
 * Initialize Port 00
 | 
			
		||||
 *---------------------------------------------------------------------------*/
 | 
			
		||||
static void prvInitPort00( void )
 | 
			
		||||
{
 | 
			
		||||
	DDR00 = 0xFF;
 | 
			
		||||
	PDR00 = 0xFF;
 | 
			
		||||
	DDR09 = 0xFF;
 | 
			
		||||
	PDR09 = 0xFF;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
 * Setup the hardware
 | 
			
		||||
 *---------------------------------------------------------------------------*/
 | 
			
		||||
static void prvSetupHardware( void )
 | 
			
		||||
{
 | 
			
		||||
	prvInitPort00();
 | 
			
		||||
 | 
			
		||||
	#if WATCHDOG != WTC_NONE
 | 
			
		||||
	InitWatchdog();
 | 
			
		||||
	#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
 * main()
 | 
			
		||||
 *---------------------------------------------------------------------------*/
 | 
			
		||||
void main( void )
 | 
			
		||||
{
 | 
			
		||||
	InitIrqLevels();		/* Initialize interrupts */
 | 
			
		||||
	__set_il( 7 );			/* Allow all levels      */
 | 
			
		||||
 | 
			
		||||
	prvSetupHardware();
 | 
			
		||||
 | 
			
		||||
	#if WATCHDOG == WTC_IN_TASK
 | 
			
		||||
	vStartWatchdogTask( WTC_TASK_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	/* Start the standard demo application tasks. */
 | 
			
		||||
	#if ( INCLUDE_StartLEDFlashTasks == 1 )
 | 
			
		||||
	vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartIntegerMathTasks == 1 )
 | 
			
		||||
	vStartIntegerMathTasks( tskIDLE_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_AltStartComTestTasks == 1 )
 | 
			
		||||
	vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED - 1 );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartPolledQueueTasks == 1 )
 | 
			
		||||
	vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartSemaphoreTasks == 1 )
 | 
			
		||||
	vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartBlockingQueueTasks == 1 )
 | 
			
		||||
	vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartDynamicPriorityTasks == 1 )
 | 
			
		||||
	vStartDynamicPriorityTasks();
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartMathTasks == 1 )
 | 
			
		||||
	vStartMathTasks( tskIDLE_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartFlashCoRoutines == 1 )
 | 
			
		||||
	vStartFlashCoRoutines( ledNUMBER_OF_LEDS );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartHookCoRoutines == 1 )
 | 
			
		||||
	vStartHookCoRoutines();
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartGenericQueueTasks == 1 )
 | 
			
		||||
	vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartQueuePeekTasks == 1 )
 | 
			
		||||
	vStartQueuePeekTasks();
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_CreateBlockTimeTasks == 1 )
 | 
			
		||||
	vCreateBlockTimeTasks();
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_CreateSuicidalTasks == 1 )
 | 
			
		||||
	vCreateSuicidalTasks( mainDEATH_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_TraceListTasks == 1 )
 | 
			
		||||
	vTraceListTasks( TASK_UTILITY_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	/* Start the 'Check' task which is defined in this file. */
 | 
			
		||||
	xTaskCreate( vErrorChecks, (signed portCHAR *) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
 | 
			
		||||
 | 
			
		||||
	vTaskStartScheduler();
 | 
			
		||||
 | 
			
		||||
	/* Should not reach here */
 | 
			
		||||
	while( 1 )
 | 
			
		||||
	{
 | 
			
		||||
		__asm( " NOP " );	/*  //  */
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
 | 
			
		||||
{
 | 
			
		||||
	if( uxLED < ledNUMBER_OF_LEDS )
 | 
			
		||||
	{
 | 
			
		||||
		vTaskSuspendAll();
 | 
			
		||||
 | 
			
		||||
		/* Toggle the state of the single genuine on board LED. */
 | 
			
		||||
		if( (sState[0] & ((portCHAR) (1 << uxLED))) == 0 )
 | 
			
		||||
		{
 | 
			
		||||
			PDR09 |= ( 1 << uxLED );
 | 
			
		||||
			sState[0] |= ( 1 << uxLED );
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			PDR09 &= ~( 1 << uxLED );
 | 
			
		||||
			sState[0] &= ~( 1 << uxLED );
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		xTaskResumeAll();
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		vTaskSuspendAll();
 | 
			
		||||
 | 
			
		||||
		uxLED -= ledNUMBER_OF_LEDS;
 | 
			
		||||
 | 
			
		||||
		if( (sState[1] & ((portCHAR) (1 << uxLED))) == 0 )
 | 
			
		||||
		{
 | 
			
		||||
			PDR00 |= ( 1 << uxLED );
 | 
			
		||||
			sState[1] |= ( 1 << uxLED );
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			PDR00 &= ~( 1 << uxLED );
 | 
			
		||||
			sState[1] &= ~( 1 << uxLED );
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		xTaskResumeAll();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
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 )
 | 
			
		||||
	{
 | 
			
		||||
		vTaskSuspendAll();
 | 
			
		||||
		{
 | 
			
		||||
			if( xValue )
 | 
			
		||||
			{
 | 
			
		||||
				PDR09 &= ~( 1 << uxLED );
 | 
			
		||||
				sState[0] &= ~( 1 << uxLED );
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				PDR09 |= ( 1 << uxLED );
 | 
			
		||||
				sState[0] |= ( 1 << uxLED );
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		xTaskResumeAll();
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		vTaskSuspendAll();
 | 
			
		||||
		{
 | 
			
		||||
			if( xValue )
 | 
			
		||||
			{
 | 
			
		||||
				PDR00 &= ~( 1 << uxLED );
 | 
			
		||||
				sState[1] &= ~( 1 << uxLED );
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				PDR00 |= ( 1 << uxLED );
 | 
			
		||||
				sState[1] |= ( 1 << uxLED );
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		xTaskResumeAll();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
static void vErrorChecks( void *pvParameters )
 | 
			
		||||
{
 | 
			
		||||
	static volatile unsigned portLONG	ulDummyVariable = 3UL;
 | 
			
		||||
	portTickType						xDelayPeriod = mainNO_ERROR_CHECK_DELAY;
 | 
			
		||||
	( void ) pvParameters;
 | 
			
		||||
 | 
			
		||||
	/* Cycle for ever, delaying then checking all the other tasks are still
 | 
			
		||||
	operating without error. */
 | 
			
		||||
	for( ;; )
 | 
			
		||||
	{
 | 
			
		||||
		/* 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 a bit of 32bit maths to ensure the registers used by the 
 | 
			
		||||
		integer tasks get some exercise outside of the integer tasks 
 | 
			
		||||
		themselves. The result here is not important we are just deliberately
 | 
			
		||||
		changing registers used by other tasks to ensure that their context
 | 
			
		||||
		switch is operating as required. - see the demo application 
 | 
			
		||||
		documentation for more info. */
 | 
			
		||||
		ulDummyVariable *= 3UL;
 | 
			
		||||
 | 
			
		||||
		/* See if the other tasks are all ok. */
 | 
			
		||||
		if( prvCheckOtherTasksAreStillRunning() != pdPASS )
 | 
			
		||||
		{
 | 
			
		||||
			/* An error occurred in one of the tasks so shorten the delay 
 | 
			
		||||
			period - which has the effect of increasing the frequency of the
 | 
			
		||||
			LED toggle. */
 | 
			
		||||
			xDelayPeriod = mainERROR_CHECK_DELAY;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* Flash! */
 | 
			
		||||
		vParTestToggleLED( mainCHECK_TEST_LED );
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
static portSHORT prvCheckOtherTasksAreStillRunning( void )
 | 
			
		||||
{
 | 
			
		||||
	static portSHORT	sNoErrorFound = pdTRUE;
 | 
			
		||||
 | 
			
		||||
	/* The demo tasks maintain a count that increments every cycle of the task
 | 
			
		||||
	provided that the task has never encountered an error.  This function 
 | 
			
		||||
	checks the counts maintained by the tasks to ensure they are still being
 | 
			
		||||
	incremented.  A count remaining at the same value between calls therefore
 | 
			
		||||
	indicates that an error has been detected.  Only tasks that do not flash
 | 
			
		||||
	an LED are checked. */
 | 
			
		||||
	#if ( INCLUDE_StartIntegerMathTasks == 1 )
 | 
			
		||||
	if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_AltStartComTestTasks == 1 )
 | 
			
		||||
	if( xAreComTestTasksStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartPolledQueueTasks == 1 )
 | 
			
		||||
	if( xArePollingQueuesStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartSemaphoreTasks == 1 )
 | 
			
		||||
	if( xAreSemaphoreTasksStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartBlockingQueueTasks == 1 )
 | 
			
		||||
	if( xAreBlockingQueuesStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartDynamicPriorityTasks == 1 )
 | 
			
		||||
	if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartMathTasks == 1 )
 | 
			
		||||
	if( xAreMathsTaskStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartFlashCoRoutines == 1 )
 | 
			
		||||
	if( xAreFlashCoRoutinesStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartHookCoRoutines == 1 )
 | 
			
		||||
	if( xAreHookCoRoutinesStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartGenericQueueTasks == 1 )
 | 
			
		||||
	if( xAreGenericQueueTasksStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_StartQueuePeekTasks == 1 )
 | 
			
		||||
	if( xAreQueuePeekTasksStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_CreateBlockTimeTasks == 1 )
 | 
			
		||||
	if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	#if ( INCLUDE_CreateSuicidalTasks == 1 )
 | 
			
		||||
	if( xIsCreateTaskStillRunning() != pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		sNoErrorFound = pdFALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#endif
 | 
			
		||||
	return sNoErrorFound;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------*/
 | 
			
		||||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
/*
 | 
			
		||||
	FreeRTOS.org V4.5.0 - Copyright (C) 2003-2007 Richard Barry.
 | 
			
		||||
	FreeRTOS.org V4.7.1 - Copyright (C) 2003-2008 Richard Barry.
 | 
			
		||||
 | 
			
		||||
	This file is part of the FreeRTOS.org distribution.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -24,18 +24,39 @@
 | 
			
		|||
	can be applied.
 | 
			
		||||
 | 
			
		||||
	***************************************************************************
 | 
			
		||||
	See http://www.FreeRTOS.org for documentation, latest information, license 
 | 
			
		||||
	and contact details.  Please ensure to read the configuration and relevant 
 | 
			
		||||
	port sections of the online documentation.
 | 
			
		||||
 | 
			
		||||
	Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
 | 
			
		||||
	with commercial development and support options.
 | 
			
		||||
	Please ensure to read the configuration and relevant port sections of the 
 | 
			
		||||
	online documentation.
 | 
			
		||||
 | 
			
		||||
	+++ http://www.FreeRTOS.org +++
 | 
			
		||||
	Documentation, latest information, license and contact details.  
 | 
			
		||||
 | 
			
		||||
	+++ http://www.SafeRTOS.com +++
 | 
			
		||||
	A version that is certified for use in safety critical systems.
 | 
			
		||||
 | 
			
		||||
	+++ http://www.OpenRTOS.com +++
 | 
			
		||||
	Commercial support, development, porting, licensing and training services.
 | 
			
		||||
 | 
			
		||||
	***************************************************************************
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#ifndef FREERTOS_CONFIG_H
 | 
			
		||||
#define FREERTOS_CONFIG_H
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * The below define should be same as the option selected by the Memory 
 | 
			
		||||
 * Model (Project->Setup Project->C Compiler->Catagory->Target Depend ) 
 | 
			
		||||
 *
 | 
			
		||||
 * Valid settings here include:
 | 
			
		||||
 * portSMALL     16 Bit    16 Bit
 | 
			
		||||
 * portMEDIUM    16 Bit    24 Bit
 | 
			
		||||
 * portCOMPACT   24 Bit    16 Bit
 | 
			
		||||
 * portLARGE     24 Bit    24 Bit
 | 
			
		||||
 */
 | 
			
		||||
#define configMEMMODEL portMEDIUM
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------
 | 
			
		||||
 * Application specific definitions.
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			@ -45,16 +66,15 @@
 | 
			
		|||
 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
 | 
			
		||||
 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 
 | 
			
		||||
 *----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
#define configUSE_PREEMPTION		1
 | 
			
		||||
#define configUSE_IDLE_HOOK			1
 | 
			
		||||
#define configUSE_TICK_HOOK			1
 | 
			
		||||
#define configCPU_CLOCK_HZ			( ( unsigned portLONG ) 56000000 )	/* Clock setup from start.asm in the demo application. */
 | 
			
		||||
#define configCLKP1_CLOCK_HZ		( ( unsigned portLONG ) 56000000 )	/* Clock setup from start.asm in the demo application. */
 | 
			
		||||
#define configTICK_RATE_HZ			( ( portTickType ) 100 )
 | 
			
		||||
#define configTICK_RATE_HZ			( (portTickType) 100 )
 | 
			
		||||
#define configMAX_PRIORITIES		( ( unsigned portBASE_TYPE ) 6 )
 | 
			
		||||
#define configMINIMAL_STACK_SIZE	( ( unsigned portSHORT ) 176 )
 | 
			
		||||
#define configTOTAL_HEAP_SIZE		( ( size_t ) ( 21504 ) )
 | 
			
		||||
#define configTOTAL_HEAP_SIZE		( (size_t) (21504) )
 | 
			
		||||
#define configMAX_TASK_NAME_LEN		( 20 )
 | 
			
		||||
#define configUSE_TRACE_FACILITY	1
 | 
			
		||||
#define configUSE_16_BIT_TICKS		1
 | 
			
		||||
| 
						 | 
				
			
			@ -67,18 +87,14 @@
 | 
			
		|||
 | 
			
		||||
/* Set the following definitions to 1 to include the API function, or zero
 | 
			
		||||
to exclude the API function. */
 | 
			
		||||
 | 
			
		||||
#define INCLUDE_vTaskPrioritySet			1
 | 
			
		||||
#define INCLUDE_uxTaskPriorityGet			1
 | 
			
		||||
#define INCLUDE_vTaskDelete					1
 | 
			
		||||
#define INCLUDE_vTaskCleanUpResources		1
 | 
			
		||||
#define INCLUDE_vTaskSuspend				1
 | 
			
		||||
#define INCLUDE_vResumeFromISR				1
 | 
			
		||||
//#define INCLUDE_xTaskResumeFromISR        1
 | 
			
		||||
#define INCLUDE_vTaskDelayUntil				1
 | 
			
		||||
#define INCLUDE_vTaskDelay					1
 | 
			
		||||
#define INCLUDE_xTaskGetSchedulerState		1
 | 
			
		||||
#define INCLUDE_xTaskGetCurrentTaskHandle	1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* FREERTOS_CONFIG_H */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,12 +1,17 @@
 | 
			
		|||
/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
 | 
			
		||||
 | 
			
		||||
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
 | 
			
		||||
 | 
			
		||||
/* ELIGIBILITY FOR ANY PURPOSES.                                             */
 | 
			
		||||
 | 
			
		||||
/*                 (C) Fujitsu Microelectronics Europe GmbH                  */
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
  config.h
 | 
			
		||||
  - This file contains the defines to include or exclude a certain demo
 | 
			
		||||
    application function.
 | 
			
		||||
/*---------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* The below are the defines that includes the corresponding function (those create related
 | 
			
		||||
 * tasks) if they are defined and vice a versa.
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			@ -29,7 +34,6 @@
 | 
			
		|||
 * requires high amount of memory. It should be noted that if all the task are tried to be inclued
 | 
			
		||||
 * then the compiler would give memory overflow error.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#if __CONFIG__ == 1
 | 
			
		||||
	#define INCLUDE_AltStartComTestTasks	1
 | 
			
		||||
	#define INCLUDE_StartMathTasks			0
 | 
			
		||||
| 
						 | 
				
			
			@ -41,9 +45,9 @@
 | 
			
		|||
	#define INCLUDE_CreateBlockTimeTasks	0
 | 
			
		||||
	#define INCLUDE_TraceListTasks			1
 | 
			
		||||
#elif __CONFIG__ == 3
 | 
			
		||||
	#define INCLUDE_AltStartComTestTasks		1
 | 
			
		||||
	#define INCLUDE_StartMathTasks				1
 | 
			
		||||
	#define INCLUDE_CreateBlockTimeTasks		1
 | 
			
		||||
	#define INCLUDE_AltStartComTestTasks	0
 | 
			
		||||
	#define INCLUDE_StartMathTasks			0
 | 
			
		||||
	#define INCLUDE_CreateBlockTimeTasks	0
 | 
			
		||||
	#define INCLUDE_TraceListTasks			0
 | 
			
		||||
#elif __CONFIG__ == 4
 | 
			
		||||
	#define INCLUDE_AltStartComTestTasks	0
 | 
			
		||||
| 
						 | 
				
			
			@ -51,5 +55,9 @@
 | 
			
		|||
	#define INCLUDE_CreateBlockTimeTasks	1
 | 
			
		||||
	#define INCLUDE_TraceListTasks			1
 | 
			
		||||
#else
 | 
			
		||||
	#define INCLUDE_AltStartComTestTasks	0
 | 
			
		||||
	#define INCLUDE_StartMathTasks			0
 | 
			
		||||
	#define INCLUDE_CreateBlockTimeTasks	0
 | 
			
		||||
	#define INCLUDE_TraceListTasks			0
 | 
			
		||||
	#error __CONFIG__ should be defined and it should have value between 1 to 4
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -171,45 +171,59 @@ void main( void )
 | 
			
		|||
	#if ( INCLUDE_StartLEDFlashTasks == 1 )
 | 
			
		||||
		vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartIntegerMathTasks == 1 )
 | 
			
		||||
		vStartIntegerMathTasks( tskIDLE_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_AltStartComTestTasks == 1 )
 | 
			
		||||
		vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED - 1 );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartPolledQueueTasks == 1 )
 | 
			
		||||
		vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartSemaphoreTasks == 1 )
 | 
			
		||||
		vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartBlockingQueueTasks == 1 )
 | 
			
		||||
		vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartDynamicPriorityTasks == 1 )
 | 
			
		||||
		vStartDynamicPriorityTasks();
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartMathTasks == 1 )
 | 
			
		||||
		vStartMathTasks( tskIDLE_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartFlashCoRoutines == 1 )
 | 
			
		||||
		vStartFlashCoRoutines( ledNUMBER_OF_LEDS );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartHookCoRoutines == 1 )
 | 
			
		||||
		vStartHookCoRoutines();
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartGenericQueueTasks == 1 )
 | 
			
		||||
		vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_StartQueuePeekTasks == 1 )
 | 
			
		||||
		vStartQueuePeekTasks();
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_CreateBlockTimeTasks == 1 )
 | 
			
		||||
		vCreateBlockTimeTasks();
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_CreateSuicidalTasks == 1 )
 | 
			
		||||
		vCreateSuicidalTasks( mainDEATH_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	#if ( INCLUDE_TraceListTasks == 1 )
 | 
			
		||||
		vTraceListTasks( TASK_UTILITY_PRIORITY );
 | 
			
		||||
	#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
/*
 | 
			
		||||
	FreeRTOS.org V4.6.1 - Copyright (C) 2003-2007 Richard Barry.
 | 
			
		||||
	FreeRTOS.org V4.7.1 - Copyright (C) 2003-2008 Richard Barry.
 | 
			
		||||
 | 
			
		||||
	This file is part of the FreeRTOS.org distribution.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -24,17 +24,22 @@
 | 
			
		|||
	can be applied.
 | 
			
		||||
 | 
			
		||||
	***************************************************************************
 | 
			
		||||
	See http://www.FreeRTOS.org for documentation, latest information, license 
 | 
			
		||||
	and contact details.  Please ensure to read the configuration and relevant 
 | 
			
		||||
	port sections of the online documentation.
 | 
			
		||||
 | 
			
		||||
	Also see http://www.SafeRTOS.com a version that has been certified for use
 | 
			
		||||
	in safety critical systems, plus commercial licensing, development and
 | 
			
		||||
	support options.
 | 
			
		||||
	Please ensure to read the configuration and relevant port sections of the 
 | 
			
		||||
	online documentation.
 | 
			
		||||
 | 
			
		||||
	+++ http://www.FreeRTOS.org +++
 | 
			
		||||
	Documentation, latest information, license and contact details.  
 | 
			
		||||
 | 
			
		||||
	+++ http://www.SafeRTOS.com +++
 | 
			
		||||
	A version that is certified for use in safety critical systems.
 | 
			
		||||
 | 
			
		||||
	+++ http://www.OpenRTOS.com +++
 | 
			
		||||
	Commercial support, development, porting, licensing and training services.
 | 
			
		||||
 | 
			
		||||
	***************************************************************************
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER.   
 | 
			
		||||
 * 
 | 
			
		||||
 * This file only supports UART 1
 | 
			
		||||
| 
						 | 
				
			
			@ -62,23 +67,21 @@ static volatile portSHORT sTHREEmpty;
 | 
			
		|||
static volatile portSHORT	queueFail = pdFALSE;
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	/* Initialise the hardware. */
 | 
			
		||||
	portENTER_CRITICAL();
 | 
			
		||||
	{
 | 
			
		||||
		/* Create the queues used by the com test task. */
 | 
			
		||||
		xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
 | 
			
		||||
		xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
 | 
			
		||||
		xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof(signed portCHAR) );
 | 
			
		||||
		xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof(signed portCHAR) );
 | 
			
		||||
 | 
			
		||||
		if ( xRxedChars == 0)
 | 
			
		||||
		if( xRxedChars == 0 )
 | 
			
		||||
		{
 | 
			
		||||
			queueFail = pdTRUE;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if ( xCharsForTx == 0)
 | 
			
		||||
		if( xCharsForTx == 0 )
 | 
			
		||||
		{
 | 
			
		||||
			queueFail = pdTRUE;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -94,6 +97,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned
 | 
			
		|||
		DDR08_D2 = 0;	/* switch P08_2 to input */
 | 
			
		||||
		DDR08_D3 = 1;	/* switch P08_3 to output */
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	portEXIT_CRITICAL();
 | 
			
		||||
 | 
			
		||||
	/* Unlike other ports, this serial code does not allow for more than one
 | 
			
		||||
| 
						 | 
				
			
			@ -107,7 +111,7 @@ signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcR
 | 
			
		|||
{
 | 
			
		||||
	/* Get the next character from the buffer.  Return false if no characters
 | 
			
		||||
	are available, or arrive before xBlockTime expires. */
 | 
			
		||||
	if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
 | 
			
		||||
	if( xQueueReceive(xRxedChars, pcRxedChar, xBlockTime) )
 | 
			
		||||
	{
 | 
			
		||||
		return pdTRUE;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -143,7 +147,7 @@ signed portBASE_TYPE xReturn;
 | 
			
		|||
			/* Return false if after the block time there is no room on the Tx 
 | 
			
		||||
			queue.  It is ok to block inside a critical section as each task
 | 
			
		||||
			maintains it's own critical section status. */
 | 
			
		||||
			if (xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) == pdTRUE)
 | 
			
		||||
			if( xQueueSend(xCharsForTx, &cOutChar, xBlockTime) == pdTRUE )
 | 
			
		||||
			{
 | 
			
		||||
				xReturn = pdPASS;
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			@ -153,7 +157,7 @@ signed portBASE_TYPE xReturn;
 | 
			
		|||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (pdPASS == xReturn)
 | 
			
		||||
		if( pdPASS == xReturn )
 | 
			
		||||
		{
 | 
			
		||||
			/* Turn on the Tx interrupt so the ISR will remove the character from the
 | 
			
		||||
			queue and send it.   This does not need to be in a critical section as
 | 
			
		||||
| 
						 | 
				
			
			@ -161,8 +165,8 @@ signed portBASE_TYPE xReturn;
 | 
			
		|||
			will simply turn off the Tx interrupt again. */
 | 
			
		||||
			SSR0_TIE = 1;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	portEXIT_CRITICAL();
 | 
			
		||||
 | 
			
		||||
	return pdPASS;
 | 
			
		||||
| 
						 | 
				
			
			@ -172,36 +176,35 @@ signed portBASE_TYPE xReturn;
 | 
			
		|||
/*
 | 
			
		||||
 * UART RX interrupt service routine.
 | 
			
		||||
 */
 | 
			
		||||
 __interrupt void UART0_RxISR (void)
 | 
			
		||||
__interrupt void UART0_RxISR( void )
 | 
			
		||||
{
 | 
			
		||||
	volatile signed portCHAR cChar;
 | 
			
		||||
volatile signed portCHAR	cChar;
 | 
			
		||||
 | 
			
		||||
	/* Get the character from the UART and post it on the queue of Rxed 
 | 
			
		||||
	characters. */
 | 
			
		||||
	cChar = RDR0;
 | 
			
		||||
 | 
			
		||||
	if( xQueueGenericSendFromISR( xRxedChars, (const void * const) &cChar, (signed portBASE_TYPE) pdFALSE, (portBASE_TYPE) 0 ) )
 | 
			
		||||
	if( xQueueGenericSendFromISR(xRxedChars, ( const void *const ) &cChar, (signed portBASE_TYPE) pdFALSE, (portBASE_TYPE) 0) )
 | 
			
		||||
	{
 | 
			
		||||
		/*If the post causes a task to wake force a context switch 
 | 
			
		||||
		as the woken task may have a higher priority than the task we have 
 | 
			
		||||
		interrupted. */
 | 
			
		||||
		portYIELDFromISR();
 | 
			
		||||
		portYIELD_FROM_ISR();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * UART Tx interrupt service routine.
 | 
			
		||||
 */
 | 
			
		||||
__interrupt void UART0_TxISR (void)
 | 
			
		||||
__interrupt void UART0_TxISR( void )
 | 
			
		||||
{
 | 
			
		||||
	signed portCHAR cChar;
 | 
			
		||||
	signed portBASE_TYPE xTaskWoken;
 | 
			
		||||
signed portCHAR			cChar;
 | 
			
		||||
signed portBASE_TYPE	xTaskWoken;
 | 
			
		||||
 | 
			
		||||
	/* The previous character has been transmitted.  See if there are any
 | 
			
		||||
	further characters waiting transmission. */
 | 
			
		||||
	if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWoken ) == pdTRUE )
 | 
			
		||||
	if( xQueueReceiveFromISR(xCharsForTx, &cChar, &xTaskWoken) == pdTRUE )
 | 
			
		||||
	{
 | 
			
		||||
		/* There was another character queued - transmit it now. */
 | 
			
		||||
		TDR0 = cChar;
 | 
			
		||||
| 
						 | 
				
			
			@ -215,4 +218,3 @@ __interrupt void UART0_TxISR (void)
 | 
			
		|||
		SSR0_TIE = 0;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,28 +1,31 @@
 | 
			
		|||
/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
 | 
			
		||||
 | 
			
		||||
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
 | 
			
		||||
 | 
			
		||||
/* ELIGIBILITY FOR ANY PURPOSES.                                             */
 | 
			
		||||
 | 
			
		||||
/*                 (C) Fujitsu Microelectronics Europe GmbH                  */
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------
 | 
			
		||||
  taskutility.C
 | 
			
		||||
  - 
 | 
			
		||||
-------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
/*************************@INCLUDE_START************************/
 | 
			
		||||
#include "mb96348hs.h"
 | 
			
		||||
#include "FreeRTOS.h"
 | 
			
		||||
#include "task.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void vUART1Task( void *pvParameters );
 | 
			
		||||
 | 
			
		||||
/**************************@INCLUDE_END*************************/
 | 
			
		||||
 | 
			
		||||
/*********************@GLOBAL_VARIABLES_START*******************/
 | 
			
		||||
const char	ASCII[] = "0123456789ABCDEF";
 | 
			
		||||
 | 
			
		||||
xTaskHandle UART_TaskHandle;
 | 
			
		||||
 | 
			
		||||
void InitUart1(void)
 | 
			
		||||
void InitUart1( void )
 | 
			
		||||
{
 | 
			
		||||
	/* Initialize UART asynchronous mode */
 | 
			
		||||
	BGR1 = configCLKP1_CLOCK_HZ / 9600; /* 9600 Baud @ CLKP1 - 56 MHz */
 | 
			
		||||
| 
						 | 
				
			
			@ -36,77 +39,92 @@ void InitUart1(void)
 | 
			
		|||
	DDR08_D6 = 1;						/* switch P08_6 to output */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Putch1(char ch)         /* sends a char */
 | 
			
		||||
void Putch1( char ch )	/* sends a char */
 | 
			
		||||
{
 | 
			
		||||
  while (SSR1_TDRE == 0);    /* wait for transmit buffer empty 	*/
 | 
			
		||||
	while( SSR1_TDRE == 0 );
 | 
			
		||||
 | 
			
		||||
	/* wait for transmit buffer empty 	*/
 | 
			
		||||
	TDR1 = ch;	/* put ch into buffer			*/
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char Getch1(void)            /* waits for and returns incomming char 	*/
 | 
			
		||||
char Getch1( void ) /* waits for and returns incomming char 	*/
 | 
			
		||||
{
 | 
			
		||||
	volatile unsigned	ch;
 | 
			
		||||
 | 
			
		||||
  while(SSR1_RDRF == 0);	 /* wait for data received  	*/
 | 
			
		||||
  if (SSR1_ORE)              /* overrun error 		*/
 | 
			
		||||
	while( SSR1_RDRF == 0 );
 | 
			
		||||
 | 
			
		||||
	/* wait for data received  	*/
 | 
			
		||||
	if( SSR1_ORE )		/* overrun error 		*/
 | 
			
		||||
	{
 | 
			
		||||
		ch = RDR1;		/* reset error flags 		*/
 | 
			
		||||
    return (char)(-1);
 | 
			
		||||
		return ( char ) ( -1 );
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
  return (RDR1);            /* return char 			*/
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Puts1(const char *Name1)  /* Puts a String to UART */
 | 
			
		||||
{
 | 
			
		||||
  volatile portSHORT i,len;
 | 
			
		||||
  len = strlen(Name1);
 | 
			
		||||
	
 | 
			
		||||
  for (i=0; i<strlen(Name1); i++)   /* go through string                     */
 | 
			
		||||
	{
 | 
			
		||||
    if (Name1[i] == 10)
 | 
			
		||||
      Putch1(13);
 | 
			
		||||
    Putch1(Name1[i]);              /* send it out                           */
 | 
			
		||||
		return( RDR1 ); /* return char 			*/
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Puthex1(unsigned long n, unsigned char digits)
 | 
			
		||||
void Puts1( const char *Name1 ) /* Puts a String to UART */
 | 
			
		||||
{
 | 
			
		||||
   unsigned portCHAR digit=0,div=0,i;
 | 
			
		||||
	volatile portSHORT	i, len;
 | 
			
		||||
	len = strlen( Name1 );
 | 
			
		||||
 | 
			
		||||
   div=(4*(digits-1));	/* init shift divisor */
 | 
			
		||||
   for (i=0;i<digits;i++)
 | 
			
		||||
	for( i = 0; i < strlen(Name1); i++ )	/* go through string                     */
 | 
			
		||||
	{
 | 
			
		||||
     digit = ((n >> div)&0xF); /* get hex-digit value */
 | 
			
		||||
	 Putch1(digit + ((digit < 0xA) ? '0' : 'A' - 0xA));
 | 
			
		||||
     div-=4;     		/* next digit shift */
 | 
			
		||||
		if( Name1[i] == 10 )
 | 
			
		||||
		{
 | 
			
		||||
			Putch1( 13 );
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		Putch1( Name1[i] );					/* send it out                           */
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Putdec1(unsigned long x, int digits)
 | 
			
		||||
void Puthex1( unsigned long n, unsigned char digits )
 | 
			
		||||
{
 | 
			
		||||
	unsigned portCHAR	digit = 0, div = 0, i;
 | 
			
		||||
 | 
			
		||||
	div = ( 4 * (digits - 1) );				/* init shift divisor */
 | 
			
		||||
	for( i = 0; i < digits; i++ )
 | 
			
		||||
	{
 | 
			
		||||
		digit = ( (n >> div) & 0xF );		/* get hex-digit value */
 | 
			
		||||
		Putch1( digit + ((digit < 0xA) ? '0' : 'A' - 0xA) );
 | 
			
		||||
		div -= 4;		/* next digit shift */
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Putdec1( unsigned long x, int digits )
 | 
			
		||||
{
 | 
			
		||||
	portSHORT	i;
 | 
			
		||||
	portCHAR buf[10],sign=1;
 | 
			
		||||
	portCHAR	buf[10], sign = 1;
 | 
			
		||||
 | 
			
		||||
	if (digits < 0) {     /* should be print of zero? */
 | 
			
		||||
	  digits *= (-1);
 | 
			
		||||
	  sign =1;
 | 
			
		||||
	}  
 | 
			
		||||
	buf[digits]='\0';			/* end sign of string */
 | 
			
		||||
	
 | 
			
		||||
	for (i=digits; i>0; i--) {
 | 
			
		||||
		buf[i-1] = ASCII[x % 10];
 | 
			
		||||
		x = x/10;
 | 
			
		||||
	if( digits < 0 )
 | 
			
		||||
	{					/* should be print of zero? */
 | 
			
		||||
		digits *= ( -1 );
 | 
			
		||||
		sign = 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
    if ( sign )
 | 
			
		||||
	buf[digits] = '\0'; /* end sign of string */
 | 
			
		||||
 | 
			
		||||
	for( i = digits; i > 0; i-- )
 | 
			
		||||
	{
 | 
			
		||||
		buf[i - 1] = ASCII[x % 10];
 | 
			
		||||
		x = x / 10;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if( sign )
 | 
			
		||||
	{
 | 
			
		||||
		for( i = 0; buf[i] == '0'; i++ )
 | 
			
		||||
		{				/* no print of zero */
 | 
			
		||||
			if( i < digits - 1 )
 | 
			
		||||
			{
 | 
			
		||||
	  for (i=0; buf[i]=='0'; i++) { /* no print of zero */
 | 
			
		||||
		if ( i<digits-1)
 | 
			
		||||
				buf[i] = ' ';
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Puts1(buf);					/* send string */
 | 
			
		||||
	Puts1( buf );		/* send string */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void vTraceListTasks( unsigned portBASE_TYPE uxPriority )
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +132,7 @@ void vTraceListTasks( unsigned portBASE_TYPE uxPriority )
 | 
			
		|||
	portENTER_CRITICAL();
 | 
			
		||||
	InitUart1();
 | 
			
		||||
	portENTER_CRITICAL();
 | 
			
		||||
	xTaskCreate( vUART1Task , ( signed portCHAR * ) "UART1",  ( unsigned portSHORT ) 2048, ( void * ) NULL, uxPriority, &UART_TaskHandle );
 | 
			
		||||
	xTaskCreate( vUART1Task, (signed portCHAR *) "UART1", ( unsigned portSHORT ) 2048, ( void * ) NULL, uxPriority, &UART_TaskHandle );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void vUART1Task( void *pvParameters )
 | 
			
		||||
| 
						 | 
				
			
			@ -122,77 +140,79 @@ static void vUART1Task( void *pvParameters )
 | 
			
		|||
	portCHAR			tasklist_buff[512];
 | 
			
		||||
	portCHAR			trace_buff[512];
 | 
			
		||||
	unsigned portLONG	trace_len;
 | 
			
		||||
	signed portLONG i, j, l=0;
 | 
			
		||||
	signed portLONG		i, j, l = 0;
 | 
			
		||||
 | 
			
		||||
	unsigned portCHAR	ch;
 | 
			
		||||
	
 | 
			
		||||
	( void ) pvParameters;
 | 
			
		||||
 | 
			
		||||
	Puts1("\n -------------MB96348 FreeRTOS DEMO Task List and Trace Utility----------- \n");
 | 
			
		||||
	Puts1( "\n -------------MB96348 FreeRTOS DEMO Task List and Trace Utility----------- \n" );
 | 
			
		||||
 | 
			
		||||
	for(;;)
 | 
			
		||||
	for( ;; )
 | 
			
		||||
	{
 | 
			
		||||
		Puts1("\n\rPress any of the following keys for the corresponding functionality: ");
 | 
			
		||||
		Puts1( "\n\rPress any of the following keys for the corresponding functionality: " );
 | 
			
		||||
 | 
			
		||||
		Puts1("\n\r1: To call vTaskList() and display current task status ");
 | 
			
		||||
		Puts1( "\n\r1: To call vTaskList() and display current task status " );
 | 
			
		||||
 | 
			
		||||
		Puts1("\n\r2: To call vTaskStartTrace() and to display trace results once the trace ends");
 | 
			
		||||
		Puts1( "\n\r2: To call vTaskStartTrace() and to display trace results once the trace ends" );
 | 
			
		||||
 | 
			
		||||
		SSR1_RIE=1;
 | 
			
		||||
		SSR1_RIE = 1;
 | 
			
		||||
 | 
			
		||||
		vTaskSuspend(NULL);
 | 
			
		||||
		vTaskSuspend( NULL );
 | 
			
		||||
 | 
			
		||||
	 	ch=Getch1();
 | 
			
		||||
		ch = Getch1();
 | 
			
		||||
 | 
			
		||||
		switch ( ch ) 
 | 
			
		||||
		switch( ch )
 | 
			
		||||
		{
 | 
			
		||||
			case '1':
 | 
			
		||||
				vTaskList( ( signed char * ) tasklist_buff );
 | 
			
		||||
				Puts1("\n\rThe current task list is as follows....");
 | 
			
		||||
				Puts1("\n\r----------------------------------------------");
 | 
			
		||||
				Puts1("\n\rName          State  Priority  Stack   Number");
 | 
			
		||||
				Puts1("\n\r----------------------------------------------");
 | 
			
		||||
				Puts1(tasklist_buff);
 | 
			
		||||
				Puts1("\r----------------------------------------------");
 | 
			
		||||
				vTaskList( (signed char *) tasklist_buff );
 | 
			
		||||
				Puts1( "\n\rThe current task list is as follows...." );
 | 
			
		||||
				Puts1( "\n\r----------------------------------------------" );
 | 
			
		||||
				Puts1( "\n\rName          State  Priority  Stack   Number" );
 | 
			
		||||
				Puts1( "\n\r----------------------------------------------" );
 | 
			
		||||
				Puts1( tasklist_buff );
 | 
			
		||||
				Puts1( "\r----------------------------------------------" );
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			case '2':
 | 
			
		||||
				vTaskStartTrace(( signed char * ) trace_buff, 512);
 | 
			
		||||
				Puts1("\n\rThe trace started!!");
 | 
			
		||||
				vTaskDelay( ( portTickType ) 500);
 | 
			
		||||
				vTaskStartTrace( (signed char *) trace_buff, 512 );
 | 
			
		||||
				Puts1( "\n\rThe trace started!!" );
 | 
			
		||||
				vTaskDelay( (portTickType) 500 );
 | 
			
		||||
				trace_len = ulTaskEndTrace();
 | 
			
		||||
				Puts1("\n\rThe trace ended!!");
 | 
			
		||||
				Puts1("\n\rThe trace is as follows....");
 | 
			
		||||
				Puts1("\n\r--------------------------------------------------------");
 | 
			
		||||
				Puts1("\n\r  Tick     | Task Number  |     Tick     | Task Number  |");
 | 
			
		||||
				Puts1("\n\r--------------------------------------------------------\n\r");
 | 
			
		||||
				Puts1( "\n\rThe trace ended!!" );
 | 
			
		||||
				Puts1( "\n\rThe trace is as follows...." );
 | 
			
		||||
				Puts1( "\n\r--------------------------------------------------------" );
 | 
			
		||||
				Puts1( "\n\r  Tick     | Task Number  |     Tick     | Task Number  |" );
 | 
			
		||||
				Puts1( "\n\r--------------------------------------------------------\n\r" );
 | 
			
		||||
 | 
			
		||||
				for( i = 0 ; i < trace_len ; i+=4 )
 | 
			
		||||
				for( i = 0; i < trace_len; i += 4 )
 | 
			
		||||
				{
 | 
			
		||||
					for( j = i+3 ; j >= i ; j-- )
 | 
			
		||||
					for( j = i + 3; j >= i; j-- )
 | 
			
		||||
					{
 | 
			
		||||
						Puthex1(trace_buff[j],2);
 | 
			
		||||
						Puthex1( trace_buff[j], 2 );
 | 
			
		||||
					}
 | 
			
		||||
					Puts1("   |   ");
 | 
			
		||||
 | 
			
		||||
					Puts1( "   |   " );
 | 
			
		||||
					l++;
 | 
			
		||||
					if ( l == 4)
 | 
			
		||||
					if( l == 4 )
 | 
			
		||||
					{
 | 
			
		||||
						Puts1("\n");
 | 
			
		||||
						Puts1( "\n" );
 | 
			
		||||
						l = 0;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				Puts1("\r--------------------------------------------------------");
 | 
			
		||||
 | 
			
		||||
				Puts1( "\r--------------------------------------------------------" );
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			default:
 | 
			
		||||
				break;
 | 
			
		||||
		}
 | 
			
		||||
		Puts1("\n");
 | 
			
		||||
 | 
			
		||||
		Puts1( "\n" );
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__interrupt void UART1_RxISR ( void )
 | 
			
		||||
__interrupt void UART1_RxISR( void )
 | 
			
		||||
{
 | 
			
		||||
	SSR1_RIE=0;
 | 
			
		||||
	SSR1_RIE = 0;
 | 
			
		||||
	vTaskResume( UART_TaskHandle );
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,12 +2,12 @@
 | 
			
		|||
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
 | 
			
		||||
/* ELIGIBILITY FOR ANY PURPOSES.                                             */
 | 
			
		||||
/*                 (C) Fujitsu Microelectronics Europe GmbH                  */
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
  VECTORS.C
 | 
			
		||||
  - Interrupt level (priority) setting
 | 
			
		||||
  - Interrupt vector definition
 | 
			
		||||
-----------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
#include "mb96348hs.h"
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -19,32 +19,31 @@
 | 
			
		|||
   appropriate controller is used.
 | 
			
		||||
   NOTE: value 7 disables the interrupt and value 0 sets highest priority.
 | 
			
		||||
-----------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
#define MIN_ICR				12
 | 
			
		||||
#define MAX_ICR				96
 | 
			
		||||
 | 
			
		||||
#define DEFAULT_ILM_MASK	7
 | 
			
		||||
 | 
			
		||||
void InitIrqLevels(void)
 | 
			
		||||
void InitIrqLevels( void )
 | 
			
		||||
{
 | 
			
		||||
  volatile int irq;
 | 
			
		||||
volatile int irq;
 | 
			
		||||
 | 
			
		||||
  for (irq = MIN_ICR; irq <= MAX_ICR; irq++) 
 | 
			
		||||
	for( irq = MIN_ICR; irq <= MAX_ICR; irq++ )
 | 
			
		||||
	{
 | 
			
		||||
    ICR = (irq << 8) | DEFAULT_ILM_MASK;
 | 
			
		||||
		ICR = ( irq << 8 ) | DEFAULT_ILM_MASK;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
  ICR = ((51 & 0xFF) << 8) | 6;		/* Reload Timer 0 of MB9634x Series */
 | 
			
		||||
  ICR = ((12 & 0xFF) << 8) | 6;		/* Delayed interrupt of 16FX Family */
 | 
			
		||||
	ICR = ( (51 & 0xFF) << 8 ) | ( DEFAULT_ILM_MASK - 1 );			/* Reload Timer 0 of MB9634x Series */
 | 
			
		||||
	ICR = ( (12 & 0xFF) << 8 ) | ( DEFAULT_ILM_MASK - 1 );			/* Delayed interrupt of 16FX Family */
 | 
			
		||||
 | 
			
		||||
#if ( INCLUDE_AltStartComTestTasks == 1 )  
 | 
			
		||||
  ICR = (79 << 8) | 5;				/* UART 0 Rx of MB9634x Series*/
 | 
			
		||||
  ICR = (80 << 8) | 5;				/* UART 0 Tx of MB9634x Series*/
 | 
			
		||||
#endif
 | 
			
		||||
	#if ( INCLUDE_AltStartComTestTasks == 1 )
 | 
			
		||||
		ICR = ( 79 << 8 ) | ( DEFAULT_ILM_MASK - 1 );				/* UART 0 Rx of MB9634x Series */
 | 
			
		||||
		ICR = ( 80 << 8 ) | ( DEFAULT_ILM_MASK - 1 );				/* UART 0 Tx of MB9634x Series */
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
#if ( INCLUDE_TraceListTasks == 1 )    
 | 
			
		||||
  ICR = (81 << 8) | 5;				/* UART 1 Rx of MB9634x Series*/
 | 
			
		||||
#endif  
 | 
			
		||||
	#if ( INCLUDE_TraceListTasks == 1 )
 | 
			
		||||
		ICR = ( 81 << 8 ) | ( DEFAULT_ILM_MASK - 1 );				/* UART 1 Rx of MB9634x Series */
 | 
			
		||||
	#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			@ -52,22 +51,21 @@ void InitIrqLevels(void)
 | 
			
		|||
   Add your own prototypes here. Each vector definition needs is proto-
 | 
			
		||||
   type. Either do it here or include a header file containing them.
 | 
			
		||||
-----------------------------------------------------------------------------*/
 | 
			
		||||
__interrupt void		DefaultIRQHandler( void );
 | 
			
		||||
 | 
			
		||||
__interrupt void DefaultIRQHandler (void);
 | 
			
		||||
 | 
			
		||||
extern __interrupt void prvRLT0_TICKISR (void);
 | 
			
		||||
extern __interrupt void prvRLT0_TICKISR( void );
 | 
			
		||||
 | 
			
		||||
#if ( INCLUDE_AltStartComTestTasks == 1 )
 | 
			
		||||
extern __interrupt void UART0_RxISR (void);
 | 
			
		||||
extern __interrupt void UART0_TxISR (void);
 | 
			
		||||
extern __interrupt void UART0_RxISR( void );
 | 
			
		||||
extern __interrupt void UART0_TxISR( void );
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern __interrupt void vPortYield (void);
 | 
			
		||||
extern __interrupt void vPortYieldDelayed (void);
 | 
			
		||||
extern __interrupt void vPortYield( void );
 | 
			
		||||
extern __interrupt void vPortYieldDelayed( void );
 | 
			
		||||
 | 
			
		||||
#if ( INCLUDE_TraceListTasks == 1 )
 | 
			
		||||
extern __interrupt void UART1_RxISR (void);
 | 
			
		||||
extern __interrupt void UART1_RxISR( void );
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
   Vector definiton for MB9634x
 | 
			
		||||
   Use following statements to define vectors. All resource related
 | 
			
		||||
| 
						 | 
				
			
			@ -76,7 +74,6 @@ extern __interrupt void UART1_RxISR (void);
 | 
			
		|||
   NOTE: If software interrupts 0 to 7 are defined here, this might 
 | 
			
		||||
   conflict with the reset vector in the start-up file.
 | 
			
		||||
-----------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
#pragma intvect DefaultIRQHandler 11		/* Non-maskable Interrupt       */
 | 
			
		||||
 | 
			
		||||
#pragma intvect vPortYieldDelayed 12		/* Delayed Interrupt            */
 | 
			
		||||
| 
						 | 
				
			
			@ -151,19 +148,17 @@ extern __interrupt void UART1_RxISR (void);
 | 
			
		|||
#pragma intvect DefaultIRQHandler 78		/* ALARM1                       */
 | 
			
		||||
 | 
			
		||||
#if ( INCLUDE_AltStartComTestTasks == 1 )
 | 
			
		||||
#pragma intvect UART0_RxISR       79   /* LIN-UART 0 RX                */
 | 
			
		||||
#pragma intvect UART0_TxISR       80   /* LIN-UART 0 TX                */
 | 
			
		||||
	#pragma intvect UART0_RxISR 79			/* LIN-UART 0 RX                */
 | 
			
		||||
	#pragma intvect UART0_TxISR 80			/* LIN-UART 0 TX                */
 | 
			
		||||
#else
 | 
			
		||||
#pragma intvect DefaultIRQHandler 79   /* LIN-UART 0 RX                */
 | 
			
		||||
#pragma intvect DefaultIRQHandler 80   /* LIN-UART 0 TX                */
 | 
			
		||||
	#pragma intvect DefaultIRQHandler 79	/* LIN-UART 0 RX                */
 | 
			
		||||
	#pragma intvect DefaultIRQHandler 80	/* LIN-UART 0 TX                */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if ( INCLUDE_TraceListTasks == 1 )
 | 
			
		||||
#pragma intvect UART1_RxISR 	  81   /* LIN-UART 1 RX                */
 | 
			
		||||
	#pragma intvect UART1_RxISR 81			/* LIN-UART 1 RX                */
 | 
			
		||||
#else
 | 
			
		||||
#pragma intvect DefaultIRQHandler 81   /* LIN-UART 1 RX                */
 | 
			
		||||
	#pragma intvect DefaultIRQHandler 81	/* LIN-UART 1 RX                */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#pragma intvect DefaultIRQHandler 82		/* LIN-UART 1 TX                */
 | 
			
		||||
#pragma intvect DefaultIRQHandler 83		/* LIN-UART 2 RX                */
 | 
			
		||||
#pragma intvect DefaultIRQHandler 84		/* LIN-UART 2 TX                */
 | 
			
		||||
| 
						 | 
				
			
			@ -187,12 +182,10 @@ extern __interrupt void UART1_RxISR (void);
 | 
			
		|||
   This function is a placeholder for all vector definitions. Either use
 | 
			
		||||
   your own placeholder or add necessary code here. 
 | 
			
		||||
-----------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
__interrupt 
 | 
			
		||||
void DefaultIRQHandler (void)
 | 
			
		||||
__interrupt void DefaultIRQHandler( void )
 | 
			
		||||
{
 | 
			
		||||
	__DI();				/* disable interrupts */
 | 
			
		||||
    while(1)
 | 
			
		||||
	while( 1 )
 | 
			
		||||
	{
 | 
			
		||||
		__wait_nop();	/* halt system */
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,12 +1,15 @@
 | 
			
		|||
/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
 | 
			
		||||
 | 
			
		||||
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
 | 
			
		||||
 | 
			
		||||
/* ELIGIBILITY FOR ANY PURPOSES.                                             */
 | 
			
		||||
 | 
			
		||||
/*                 (C) Fujitsu Microelectronics Europe GmbH                  */
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------
 | 
			
		||||
  watchdog.c
 | 
			
		||||
  - This file contains the function deefinition for hardware watchdog.
 | 
			
		||||
-------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
#include "mb96348hs.h"
 | 
			
		||||
#include "FreeRTOS.h"
 | 
			
		||||
#include "task.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -16,29 +19,29 @@
 | 
			
		|||
 * Setup Watchdog
 | 
			
		||||
 *---------------------------------------------------------------------------*/
 | 
			
		||||
#if WATCHDOG != WTC_NONE
 | 
			
		||||
void InitWatchdog(void)
 | 
			
		||||
void InitWatchdog( void )
 | 
			
		||||
{
 | 
			
		||||
	WDTC_WTI = WTC_PER_2_23;	/* 2^23/CLKWT */
 | 
			
		||||
	WDTC_WTCS = WTC_CLKMC;		/* CLKWT=CLKMC, Watchdog expiration delay = 2.097s @ 4MHZ CLKMC*/
 | 
			
		||||
	WDTCP = 0x00;				/* Activate Watchdog, Clear Pattern 0x00 */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
 * The below task clears the watchdog and blocks itself for WTC_CLR_PER ticks.
 | 
			
		||||
 *---------------------------------------------------------------------------*/
 | 
			
		||||
#if WATCHDOG == WTC_IN_TASK
 | 
			
		||||
static void prvWatchdogTask	( void *pvParameters )
 | 
			
		||||
static void prvWatchdogTask( void *pvParameters )
 | 
			
		||||
{
 | 
			
		||||
	const portTickType	xFrequency = WTC_CLR_PER;
 | 
			
		||||
	portTickType		xLastWakeTime;
 | 
			
		||||
 | 
			
		||||
	( void ) pvParameters;
 | 
			
		||||
 | 
			
		||||
	/* Get currrent tick count */
 | 
			
		||||
	xLastWakeTime = xTaskGetTickCount();
 | 
			
		||||
 | 
			
		||||
    for( ; ; )
 | 
			
		||||
	for( ;; )
 | 
			
		||||
	{
 | 
			
		||||
		/* Get currrent tick count */
 | 
			
		||||
		xLastWakeTime = xTaskGetTickCount();
 | 
			
		||||
| 
						 | 
				
			
			@ -49,6 +52,7 @@ static void prvWatchdogTask	( void *pvParameters )
 | 
			
		|||
		vTaskDelayUntil( &xLastWakeTime, xFrequency );
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*---------------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			@ -57,6 +61,7 @@ static void prvWatchdogTask	( void *pvParameters )
 | 
			
		|||
#if WATCHDOG == WTC_IN_TASK
 | 
			
		||||
void vStartWatchdogTask( unsigned portBASE_TYPE uxPriority )
 | 
			
		||||
{
 | 
			
		||||
	xTaskCreate( prvWatchdogTask , ( signed portCHAR * ) "KickWTC",   portMINIMAL_STACK_SIZE, ( void * ) NULL, uxPriority, ( xTaskHandle * ) NULL );
 | 
			
		||||
	xTaskCreate( prvWatchdogTask, (signed portCHAR *) "KickWTC", portMINIMAL_STACK_SIZE, ( void * ) NULL, uxPriority, ( xTaskHandle * ) NULL );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,11 +1,16 @@
 | 
			
		|||
/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
 | 
			
		||||
 | 
			
		||||
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
 | 
			
		||||
 | 
			
		||||
/* ELIGIBILITY FOR ANY PURPOSES.                                             */
 | 
			
		||||
 | 
			
		||||
/*                 (C) Fujitsu Microelectronics Europe GmbH                  */
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------
 | 
			
		||||
  watchdog.h
 | 
			
		||||
  - This file contains the defines and function declaration for hardware watchdog.
 | 
			
		||||
-------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Clear watchdog defines 
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			@ -15,7 +20,9 @@
 | 
			
		|||
#define WTC_IN_IDLE 3			/* Clear Watchdog in Idle Hook */
 | 
			
		||||
 | 
			
		||||
#define WATCHDOG	WTC_IN_TASK /* Clear Watchdog in vWatchdogTask() */
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Watchdog period defines
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			@ -35,7 +42,9 @@
 | 
			
		|||
#define WTC_PER_2_22	13		/* The watchdog period is 2^22/CLKWT */
 | 
			
		||||
#define WTC_PER_2_23	14		/* The watchdog period is 2^23/CLKWT */
 | 
			
		||||
#define WTC_PER_2_24	15		/* The watchdog period is 2^24/CLKWT */
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Watchdog Clock source defines
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			@ -44,30 +53,38 @@
 | 
			
		|||
							   changing RC clock while watchdog opeation causes reset */
 | 
			
		||||
#define WTC_CLKMC	2			/* The watchdog clock is CLKMC */
 | 
			
		||||
#define WTC_CLKSC	3			/* The watchdog clock is CLKSC */
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Watchdog Reset at transition to Stop mode defines
 | 
			
		||||
 */
 | 
			
		||||
#define WTC_RSTP_0	0			/* No watchdog reset at transition to Stop mode */
 | 
			
		||||
#define WTC_RSTP_1	1			/* watchdog reset at transition to Stop mode */
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * After every WTC_CLR_PER ticks the watchdog would be cleared in the prvWatchdogTask(). 
 | 
			
		||||
 * This period needs to be chosed in accordance with the current CLKWT and the above 
 | 
			
		||||
 * setting WTC_PER_2_XX.
 | 
			
		||||
 */
 | 
			
		||||
#define WTC_CLR_PER 100			/* The watchdog clear period in RTOS ticks */
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Kick_watchdog Macro to clear watchdog 
 | 
			
		||||
 */
 | 
			
		||||
#define Kick_Watchdog() \
 | 
			
		||||
	{		WDTCP = 0x00;						\
 | 
			
		||||
	{					\
 | 
			
		||||
		WDTCP = 0x00;	\
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/*------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Watchdog function declarations 
 | 
			
		||||
 */
 | 
			
		||||
void InitWatchdog (void);
 | 
			
		||||
void vStartWatchdogTask(unsigned portBASE_TYPE uxPriority);
 | 
			
		||||
 | 
			
		||||
void	InitWatchdog( void );
 | 
			
		||||
void	vStartWatchdogTask( unsigned portBASE_TYPE uxPriority );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@ $CPUSERIES-907
 | 
			
		|||
$Prj-Config_1
 | 
			
		||||
$0
 | 
			
		||||
-g
 | 
			
		||||
-w 3
 | 
			
		||||
-w 0
 | 
			
		||||
-INF LIST
 | 
			
		||||
-D __CONFIG__=1
 | 
			
		||||
-I ".\Src"
 | 
			
		||||
| 
						 | 
				
			
			@ -23,8 +23,9 @@ $0
 | 
			
		|||
-K UNROLL
 | 
			
		||||
$other
 | 
			
		||||
-INF srcin
 | 
			
		||||
-D __96340
 | 
			
		||||
$time
 | 
			
		||||
1201716243
 | 
			
		||||
1202822767
 | 
			
		||||
$end
 | 
			
		||||
$1
 | 
			
		||||
-g
 | 
			
		||||
| 
						 | 
				
			
			@ -71,7 +72,7 @@ $2
 | 
			
		|||
$other
 | 
			
		||||
-Xset_rora
 | 
			
		||||
$time
 | 
			
		||||
1201864951
 | 
			
		||||
1202811016
 | 
			
		||||
$end
 | 
			
		||||
$3
 | 
			
		||||
-dt s,d,r,a
 | 
			
		||||
| 
						 | 
				
			
			@ -81,7 +82,7 @@ $3
 | 
			
		|||
-Xdof
 | 
			
		||||
$other
 | 
			
		||||
$time
 | 
			
		||||
1201864951
 | 
			
		||||
1202811016
 | 
			
		||||
$end
 | 
			
		||||
$4
 | 
			
		||||
-Xdof
 | 
			
		||||
| 
						 | 
				
			
			@ -119,8 +120,9 @@ $0
 | 
			
		|||
-K UNROLL
 | 
			
		||||
$other
 | 
			
		||||
-INF srcin
 | 
			
		||||
-D __96340
 | 
			
		||||
$time
 | 
			
		||||
1201716243
 | 
			
		||||
1202809391
 | 
			
		||||
$end
 | 
			
		||||
$1
 | 
			
		||||
-g
 | 
			
		||||
| 
						 | 
				
			
			@ -166,7 +168,7 @@ $2
 | 
			
		|||
$other
 | 
			
		||||
-Xset_rora
 | 
			
		||||
$time
 | 
			
		||||
1201864951
 | 
			
		||||
1202811016
 | 
			
		||||
$end
 | 
			
		||||
$3
 | 
			
		||||
-dt s,d,r,a
 | 
			
		||||
| 
						 | 
				
			
			@ -176,7 +178,7 @@ $3
 | 
			
		|||
-Xdof
 | 
			
		||||
$other
 | 
			
		||||
$time
 | 
			
		||||
1201864951
 | 
			
		||||
1202811016
 | 
			
		||||
$end
 | 
			
		||||
$4
 | 
			
		||||
-Xdof
 | 
			
		||||
| 
						 | 
				
			
			@ -193,7 +195,7 @@ $Prjend
 | 
			
		|||
$Prj-Config_3
 | 
			
		||||
$0
 | 
			
		||||
-g
 | 
			
		||||
-w 3
 | 
			
		||||
-w 1
 | 
			
		||||
-INF LIST
 | 
			
		||||
-D __CONFIG__=3
 | 
			
		||||
-I ".\Src"
 | 
			
		||||
| 
						 | 
				
			
			@ -214,8 +216,9 @@ $0
 | 
			
		|||
-K UNROLL
 | 
			
		||||
$other
 | 
			
		||||
-INF srcin
 | 
			
		||||
-D __96340
 | 
			
		||||
$time
 | 
			
		||||
1201716243
 | 
			
		||||
1202828865
 | 
			
		||||
$end
 | 
			
		||||
$1
 | 
			
		||||
-g
 | 
			
		||||
| 
						 | 
				
			
			@ -261,7 +264,7 @@ $2
 | 
			
		|||
$other
 | 
			
		||||
-Xset_rora
 | 
			
		||||
$time
 | 
			
		||||
1201864951
 | 
			
		||||
1202811016
 | 
			
		||||
$end
 | 
			
		||||
$3
 | 
			
		||||
-dt s,d,r,a
 | 
			
		||||
| 
						 | 
				
			
			@ -271,7 +274,7 @@ $3
 | 
			
		|||
-Xdof
 | 
			
		||||
$other
 | 
			
		||||
$time
 | 
			
		||||
1201864951
 | 
			
		||||
1202811016
 | 
			
		||||
$end
 | 
			
		||||
$4
 | 
			
		||||
-Xdof
 | 
			
		||||
| 
						 | 
				
			
			@ -288,7 +291,7 @@ $Prjend
 | 
			
		|||
$Prj-Config_4
 | 
			
		||||
$0
 | 
			
		||||
-g
 | 
			
		||||
-w 3
 | 
			
		||||
-w 1
 | 
			
		||||
-INF LIST
 | 
			
		||||
-D __CONFIG__=4
 | 
			
		||||
-I ".\Src"
 | 
			
		||||
| 
						 | 
				
			
			@ -309,8 +312,9 @@ $0
 | 
			
		|||
-K UNROLL
 | 
			
		||||
$other
 | 
			
		||||
-INF srcin
 | 
			
		||||
-D __96340
 | 
			
		||||
$time
 | 
			
		||||
1201716243
 | 
			
		||||
1202825423
 | 
			
		||||
$end
 | 
			
		||||
$1
 | 
			
		||||
-g
 | 
			
		||||
| 
						 | 
				
			
			@ -356,7 +360,7 @@ $2
 | 
			
		|||
$other
 | 
			
		||||
-Xset_rora
 | 
			
		||||
$time
 | 
			
		||||
1201864951
 | 
			
		||||
1202811016
 | 
			
		||||
$end
 | 
			
		||||
$3
 | 
			
		||||
-dt s,d,r,a
 | 
			
		||||
| 
						 | 
				
			
			@ -366,7 +370,7 @@ $3
 | 
			
		|||
-Xdof
 | 
			
		||||
$other
 | 
			
		||||
$time
 | 
			
		||||
1201864951
 | 
			
		||||
1202811016
 | 
			
		||||
$end
 | 
			
		||||
$4
 | 
			
		||||
-Xdof
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue