Correct some of the LED usage in the RX demos - where apparently two wrongs did make a right.

This commit is contained in:
Richard Barry 2010-08-31 18:14:37 +00:00
parent a47ead46e8
commit 0363b47c66
17 changed files with 84 additions and 449 deletions

View file

@ -75,14 +75,6 @@ void vParTestInitialise( void )
{
/* Port pin configuration is done by the low level set up prior to this
function being called. */
/* Start with all LEDs off. */
LED0 = LED_OFF;
LED0 = LED_OFF;
LED0 = LED_OFF;
LED0 = LED_OFF;
LED0 = LED_OFF;
LED0 = LED_OFF;
}
/*-----------------------------------------------------------*/
@ -149,11 +141,11 @@ void vParTestToggleLED( unsigned long ulLED )
{
if( lParTestGetLEDState( ulLED ) != 0x00 )
{
vParTestSetLED( ulLED, 1 );
vParTestSetLED( ulLED, 0 );
}
else
{
vParTestSetLED( ulLED, 0 );
vParTestSetLED( ulLED, 1 );
}
}
taskEXIT_CRITICAL();
@ -163,7 +155,7 @@ void vParTestToggleLED( unsigned long ulLED )
long lParTestGetLEDState( unsigned long ulLED )
{
long lReturn = pdFALSE;
long lReturn = pdTRUE;
if( ulLED < partestNUM_LEDS )
{
@ -171,32 +163,32 @@ long lReturn = pdFALSE;
{
case 0 : if( LED0 != 0 )
{
lReturn = pdTRUE;
lReturn = pdFALSE;
}
break;
case 1 : if( LED1 != 0 )
{
lReturn = pdTRUE;
lReturn = pdFALSE;
}
break;
case 2 : if( LED2 != 0 )
{
lReturn = pdTRUE;
lReturn = pdFALSE;
}
break;
case 3 : if( LED3 != 0 )
{
lReturn = pdTRUE;
lReturn = pdFALSE;
}
break;
case 4 : if( LED4 != 0 )
{
lReturn = pdTRUE;
lReturn = pdFALSE;
}
break;
case 5 : if( LED5 != 0 )
{
lReturn = pdTRUE;
lReturn = pdFALSE;
}
break;
}

View file

@ -103,10 +103,7 @@ extern void HardwareSetup( void );
/* Renesas provided CPU configuration routine. The clocks are configured in
here. */
HardwareSetup();
/* Turn all LEDs off. */
vParTestInitialise();
/* Create the queue. */
xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );
@ -119,7 +116,7 @@ extern void HardwareSetup( void );
/* Start the tasks running. */
vTaskStartScheduler();
}
/* If all is well we will never reach here as the scheduler will now be
running. If we do reach here then it is likely that there was insufficient
heap available for the idle task to be created. */
@ -175,22 +172,22 @@ void vApplicationSetupTimerInterrupt( void )
{
/* Enable compare match timer 0. */
MSTP( CMT0 ) = 0;
/* Interrupt on compare match. */
CMT0.CMCR.BIT.CMIE = 1;
/* Set the compare match value. */
CMT0.CMCOR = ( unsigned short ) ( ( ( configPERIPHERAL_CLOCK_HZ / configTICK_RATE_HZ ) -1 ) / 8 );
/* Divide the PCLK by 8. */
CMT0.CMCR.BIT.CKS = 0;
/* Enable the interrupt... */
_IEN( _CMT0_CMI0 ) = 1;
/* ...and set its priority to the application defined kernel priority. */
_IPR( _CMT0_CMI0 ) = configKERNEL_INTERRUPT_PRIORITY;
/* Start the timer. */
CMT.CMSTR0.BIT.STR0 = 1;
}

View file

@ -235,9 +235,6 @@ extern void HardwareSetup( void );
here. */
HardwareSetup();
/* Turn all LEDs off. */
vParTestInitialise();
/* Start the reg test tasks which test the context switching mechanism. */
xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );
xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );
@ -265,7 +262,7 @@ extern void HardwareSetup( void );
/* Start the tasks running. */
vTaskStartScheduler();
/* If all is well we will never reach here as the scheduler will now be
running. If we do reach here then it is likely that there was insufficient
heap available for the idle task to be created. */
@ -322,31 +319,31 @@ static char cErrorText[ 100 ];
xCycleFrequency = mainERROR_CYCLE_TIME;
strcpy( cErrorText, "Error: BlockTime" );
}
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
strcpy( cErrorText, "Error: SemTest" );
}
else if( xArePollingQueuesStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
}
else if( xArePollingQueuesStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
strcpy( cErrorText, "Error: PollQueue" );
}
else if( xIsCreateTaskStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
}
else if( xIsCreateTaskStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
strcpy( cErrorText, "Error: Death" );
}
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
}
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
strcpy( cErrorText, "Error: IntMath" );
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
strcpy( cErrorText, "Error: RecMutex" );
}
}
else if( xAreIntQueueTasksStillRunning() != pdPASS )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
@ -371,21 +368,21 @@ static char cErrorText[ 100 ];
xCycleFrequency = mainERROR_CYCLE_TIME;
strcpy( cErrorText, "Error: RegTest2" );
}
ulLastRegTest1CycleCount = ulRegTest1CycleCount;
ulLastRegTest2CycleCount = ulRegTest2CycleCount;
/* Toggle the check LED to give an indication of the system status. If
the LED toggles every 5 seconds then everything is ok. A faster toggle
indicates an error. */
vParTestToggleLED( mainCHECK_LED );
/* Calculate the maximum jitter experienced by the high frequency timer
test and print it out. It is ok to use printf without worrying about
mutual exclusion as it is not used anywhere else in this demo. */
//sprintf( cTempBuf, "%s [%fns]\n", "Max Jitter = ", ( ( float ) usMaxJitter ) * mainNS_PER_CLOCK );
//ulActualJitter = ( ( unsigned long ) usMaxJitter ) * mainNS_PER_CLOCK;
if( xCycleFrequency == mainERROR_CYCLE_TIME )
{
/* Just for break point. */
@ -401,22 +398,22 @@ void vApplicationSetupTimerInterrupt( void )
{
/* Enable compare match timer 0. */
MSTP( CMT0 ) = 0;
/* Interrupt on compare match. */
CMT0.CMCR.BIT.CMIE = 1;
/* Set the compare match value. */
CMT0.CMCOR = ( unsigned short ) ( ( ( configPERIPHERAL_CLOCK_HZ / configTICK_RATE_HZ ) -1 ) / 8 );
/* Divide the PCLK by 8. */
CMT0.CMCR.BIT.CKS = 0;
/* Enable the interrupt... */
_IEN( _CMT0_CMI0 ) = 1;
/* ...and set its priority to the application defined kernel priority. */
_IPR( _CMT0_CMI0 ) = configKERNEL_INTERRUPT_PRIORITY;
/* Start the timer. */
CMT.CMSTR0.BIT.STR0 = 1;
}
@ -460,9 +457,9 @@ static void prvRegTest1Task( void *pvParameters )
taskDISABLE_INTERRUPTS();
}
}
/* This is an asm function that never returns. */
prvRegTest1Implementation();
prvRegTest1Implementation();
}
/*-----------------------------------------------------------*/

View file

@ -31,7 +31,7 @@
<Wnd1>
<Wnd0>
<Tabs>
<Tab>
<Identity>TabID-9252-3823</Identity>
@ -47,7 +47,7 @@
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd1><Wnd4>
<SelectedTab>0</SelectedTab></Wnd0><Wnd2>
<Tabs>
<Tab>
<Identity>TabID-20000-3827</Identity>
@ -59,20 +59,20 @@
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd4></Windows>
<SelectedTab>0</SelectedTab></Wnd2></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main-full.c</Filename><XPos>0</XPos><YPos>227</YPos><SelStart>11147</SelStart><SelEnd>11147</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\Renesas-Files\hwsetup.c</Filename><XPos>0</XPos><YPos>57</YPos><SelStart>3583</SelStart><SelEnd>3596</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main-blinky.c</Filename><XPos>0</XPos><YPos>78</YPos><SelStart>4754</SelStart><SelEnd>4754</SelEnd></Tab><ActiveTab>2</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main-full.c</Filename><XPos>0</XPos><YPos>213</YPos><SelStart>11242</SelStart><SelEnd>11242</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-00a2ab38><key>iaridepm.enu1</key></Toolbar-00a2ab38><Toolbar-037bab48><key>debuggergui.enu1</key></Toolbar-037bab48></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>756</Bottom><Right>238</Right><x>-2</x><y>-2</y><xscreen>121</xscreen><yscreen>141</yscreen><sizeHorzCX>72024</sizeHorzCX><sizeHorzCY>143585</sizeHorzCY><sizeVertCX>142857</sizeVertCX><sizeVertCY>771894</sizeVertCY></Rect></Wnd4></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>182</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>184</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>187373</sizeHorzCY><sizeVertCX>72024</sizeVertCX><sizeVertCY>143585</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
<Top><Row0><Sizes><Toolbar-00a2ab38><key>iaridepm.enu1</key></Toolbar-00a2ab38><Toolbar-041373d0><key>debuggergui.enu1</key></Toolbar-041373d0></Sizes></Row0></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>756</Bottom><Right>238</Right><x>-2</x><y>-2</y><xscreen>121</xscreen><yscreen>141</yscreen><sizeHorzCX>72024</sizeHorzCX><sizeHorzCY>143585</sizeHorzCY><sizeVertCX>142857</sizeVertCX><sizeVertCY>771894</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>182</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>184</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>187373</sizeHorzCY><sizeVertCX>72024</sizeVertCX><sizeVertCY>143585</sizeVertCY></Rect></Wnd0></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Project>

View file

@ -1,7 +1,7 @@
[E20]
TimeConnected=1283101444
ComuniDllSave=92864512
FfwnsdDllSave=303235072
TimeConnected=1283271959
ComuniDllSave=76087296
FfwnsdDllSave=82116608
ChipName=R5F562N8
CpuMode=0
InputClock=12.500000
@ -11,7 +11,7 @@ DebugFlags=0,0
EmulatorMode=0
NeedInit=1
[DebugChecksum]
Checksum=693528937
Checksum=-1379247853
[DisAssemblyWindow]
NumStates=_ 1
State 1=_ 1

View file

@ -25,7 +25,7 @@
<Windows>
<Wnd2>
<Wnd0>
<Tabs>
<Tab>
<Identity>TabID-10758-3386</Identity>
@ -33,11 +33,11 @@
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>RTOSDemo</ExpandedNode></NodeDict></Session>
<NodeDict><ExpandedNode>RTOSDemo</ExpandedNode><ExpandedNode>RTOSDemo/FreeRTOS Source</ExpandedNode><ExpandedNode>RTOSDemo/FreeRTOS Source/Portable Layer</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd2><Wnd3>
<SelectedTab>0</SelectedTab></Wnd0><Wnd1>
<Tabs>
<Tab>
<Identity>TabID-16801-3477</Identity>
@ -47,20 +47,20 @@
</Tab>
<Tab><Identity>TabID-414-15843</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory></Tab><Tab><Identity>TabID-3320-15993</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs>
<SelectedTab>0</SelectedTab></Wnd3></Windows>
<SelectedTab>0</SelectedTab></Wnd1></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main-full.c</Filename><XPos>0</XPos><YPos>227</YPos><SelStart>11147</SelStart><SelEnd>11147</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main-full.c</Filename><XPos>0</XPos><YPos>53</YPos><SelStart>11242</SelStart><SelEnd>11242</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-00a2ab38><key>iaridepm.enu1</key></Toolbar-00a2ab38></Sizes></Row0></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>706</Bottom><Right>351</Right><x>-2</x><y>-2</y><xscreen>331</xscreen><yscreen>284</yscreen><sizeHorzCX>197024</sizeHorzCX><sizeHorzCY>289206</sizeHorzCY><sizeVertCX>210119</sizeVertCX><sizeVertCY>720978</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>232</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>234</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>238289</sizeHorzCY><sizeVertCX>197024</sizeVertCX><sizeVertCY>289206</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
<Top><Row0><Sizes><Toolbar-00a2ab38><key>iaridepm.enu1</key></Toolbar-00a2ab38></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>706</Bottom><Right>351</Right><x>-2</x><y>-2</y><xscreen>331</xscreen><yscreen>284</yscreen><sizeHorzCX>197024</sizeHorzCX><sizeHorzCY>289206</sizeHorzCY><sizeVertCX>210119</sizeVertCX><sizeVertCY>720978</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>232</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>234</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>238289</sizeHorzCY><sizeVertCX>197024</sizeVertCX><sizeVertCY>289206</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>