From 79524783fe5b4664496f06bb2a7e41f316f243b2 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Sun, 10 Feb 2008 14:48:23 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@157 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/MB91460_Softune/SRC/partest/partest.c | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 Demo/MB91460_Softune/SRC/partest/partest.c diff --git a/Demo/MB91460_Softune/SRC/partest/partest.c b/Demo/MB91460_Softune/SRC/partest/partest.c new file mode 100644 index 000000000..d741f5f4c --- /dev/null +++ b/Demo/MB91460_Softune/SRC/partest/partest.c @@ -0,0 +1,117 @@ +/* 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 */ +/*------------------------------------------------------------------------ + MAIN.C + - description + - See README.TXT for project description and disclaimer. +-------------------------------------------------------------------------*/ +/*************************@INCLUDE_START************************/ + + +/* TODO: Add comment here regarding the behaviour of the demo. */ + + +/* Hardware specific includes. */ +#include "mb91467d.h" + +/* Scheduler includes. */ +#include "FreeRTOS.h" + + +static unsigned portSHORT sState[ ledNUMBER_OF_LEDS ] = { pdFALSE }; +static unsigned portSHORT sState1[ ledNUMBER_OF_LEDS ] = { pdFALSE }; + +/*-----------------------------------------------------------*/ +static void vPartestInitialise( void ) +{ + DDR16=0xFF; + DDR25=0xFF; +} +/*-----------------------------------------------------------*/ + +void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) +{ + if (uxLED < ledNUMBER_OF_LEDS) + { + vTaskSuspendAll(); + + /* Toggle the state of the single genuine on board LED. */ + if( sState[uxLED]) + { + PDR25 |= (1 << uxLED); + } + else + { + PDR25 &= ~(1 << 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(); + } +} +/*-----------------------------------------------------------*/ + +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 ) + { + PDR25 |= (1 << uxLED); + sState[uxLED] = 1; + } + else + { + 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(); + } +} +/*-----------------------------------------------------------*/ + -- 2.39.5