From: richardbarry Date: Wed, 13 Feb 2008 13:53:24 +0000 (+0000) Subject: git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@186 1d2547de-c912-0410... X-Git-Tag: V4.7.2~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c497ecce0e3ae13a825841d638f8a14bc8c738a1;p=freertos git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@186 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/MB91460_Softune/SRC/partest/partest.c b/Demo/MB91460_Softune/SRC/partest/partest.c index 6ea629b9f..852e3ff57 100644 --- a/Demo/MB91460_Softune/SRC/partest/partest.c +++ b/Demo/MB91460_Softune/SRC/partest/partest.c @@ -40,8 +40,6 @@ *************************************************************************** */ -/* Hardware specific includes. */ -#include "mb91467d.h" /* Scheduler includes. */ #include "FreeRTOS.h" @@ -49,16 +47,15 @@ #define partstNUM_LEDs 8 -static unsigned portSHORT sState[ partstNUM_LEDs ] = { pdFALSE }; +static unsigned portCHAR sState[ 2 ] = { 0xFF, 0xFF }; /*-----------------------------------------------------------*/ void vParTestInitialise( void ) { - /* Set port for LED outputs. */ - DDR16 = 0xFF; - - /* Start with LEDs off. */ - PDR25 = 0x00; + DDR00 = 0xFF; + PDR00 = 0xFF; + DDR09 = 0xFF; + PDR09 = 0xFF; } /*-----------------------------------------------------------*/ @@ -66,21 +63,40 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { if( uxLED < partstNUM_LEDs ) { - taskENTER_CRITICAL(); - + vTaskSuspendAll(); + /* Toggle the state of the single genuine on board LED. */ - if( sState[ uxLED ]) + if( ( sState[ 0 ] & ( ( unsigned portCHAR ) ( 1 << uxLED ) ) ) == 0 ) { - PDR25 |= ( 1 << uxLED ); + PDR09 |= ( 1 << uxLED ); + sState[ 0 ] |= ( 1 << uxLED ); } else { - PDR25 &= ~( 1 << uxLED ); + PDR09 &= ~( 1 << uxLED ); + sState[ 0 ] &= ~( 1 << uxLED ); } - - sState[ uxLED ] = !( sState[ uxLED ] ); - - taskEXIT_CRITICAL(); + + xTaskResumeAll(); + } + else + { + vTaskSuspendAll(); + + uxLED -= partstNUM_LEDs; + + if( ( sState[ 1 ] & ( ( unsigned portCHAR ) ( 1 << uxLED ) ) ) == 0 ) + { + PDR00 |= ( 1 << uxLED ); + sState[ 1 ] |= ( 1 << uxLED ); + } + else + { + PDR00 &= ~( 1 << uxLED ); + sState[ 1 ] &= ~( 1 << uxLED ); + } + + xTaskResumeAll(); } } /*-----------------------------------------------------------*/ @@ -90,21 +106,39 @@ 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 < partstNUM_LEDs ) { - taskENTER_CRITICAL(); + vTaskSuspendAll(); { if( xValue ) { - PDR25 |= ( 1 << uxLED ); - sState[ uxLED ] = 1; + PDR09 &= ~( 1 << uxLED ); + sState[ 0 ] &= ~( 1 << uxLED ); } else { - PDR25 &= ~( 1 << uxLED ); - sState[ uxLED ] = 0; + PDR09 |= ( 1 << uxLED ); + sState[ 0 ] |= ( 1 << uxLED ); } } - taskEXIT_CRITICAL(); + + xTaskResumeAll(); + } + else + { + vTaskSuspendAll(); + { + if( xValue ) + { + PDR00 &= ~( 1 << uxLED ); + sState[ 1 ] &= ~( 1 << uxLED ); + } + else + { + PDR00 |= ( 1 << uxLED ); + sState[ 1 ] |= ( 1 << uxLED ); + } + } + + xTaskResumeAll(); } } -/*-----------------------------------------------------------*/