mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-30 23:18:37 -04:00
Minor updates to demo projects to ensure correct building with V8 rc1.
This commit is contained in:
parent
f9072e7bac
commit
e95b482f56
18 changed files with 206 additions and 142 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
All rights reserved
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
|
||||
|
@ -57,19 +57,19 @@
|
|||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
|
@ -200,11 +200,11 @@ static xTimerHandle xDemoTimer = NULL;
|
|||
/* This variable is incremented each time the demo timer expires. */
|
||||
static volatile unsigned long ulDemoSoftwareTimerCounter = 0UL;
|
||||
|
||||
/* RL78/G13 Option Byte Definition. Watchdog disabled, LVI enabled, OCD interface
|
||||
/* RL78 Option Byte Definition. Watchdog disabled, LVI enabled, OCD interface
|
||||
enabled. */
|
||||
__root __far const unsigned char OptionByte[] @ 0x00C0 =
|
||||
{
|
||||
WATCHDOG_DISABLED, LVI_ENABLED, RESERVED_FF, OCD_ENABLED
|
||||
0x6eU, 0xffU, 0xe8U, 0x85U
|
||||
};
|
||||
|
||||
/* Security byte definition */
|
||||
|
@ -228,7 +228,7 @@ short main( void )
|
|||
|
||||
/* Create the RegTest tasks as described at the top of this file. */
|
||||
xTaskCreate( vRegTest1, "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
|
||||
xTaskCreate( vRegTest2, "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
|
||||
xTaskCreate( vRegTest2, "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
|
||||
|
||||
/* Create the software timer that performs the 'check' functionality,
|
||||
as described at the top of this file. */
|
||||
|
@ -238,7 +238,7 @@ short main( void )
|
|||
( void * ) 0, /* The ID is not used, so can be set to anything. */
|
||||
prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */
|
||||
);
|
||||
|
||||
|
||||
/* Create the software timer that just increments a variable for demo
|
||||
purposes. */
|
||||
xDemoTimer = xTimerCreate( "DemoTimer",/* A text name, purely to help debugging. */
|
||||
|
@ -247,12 +247,12 @@ short main( void )
|
|||
( void * ) 0, /* The ID is not used, so can be set to anything. */
|
||||
prvDemoTimerCallback /* The callback function that inspects the status of all the other tasks. */
|
||||
);
|
||||
|
||||
|
||||
/* Start both the check timer and the demo timer. The timers won't actually
|
||||
start until the scheduler is started. */
|
||||
xTimerStart( xCheckTimer, mainDONT_BLOCK );
|
||||
xTimerStart( xDemoTimer, mainDONT_BLOCK );
|
||||
|
||||
|
||||
/* Finally start the scheduler running. */
|
||||
vTaskStartScheduler();
|
||||
|
||||
|
@ -281,12 +281,12 @@ static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS
|
|||
{
|
||||
xErrorStatus = pdFAIL;
|
||||
}
|
||||
|
||||
|
||||
if( xArePollingQueuesStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorStatus = pdFAIL;
|
||||
}
|
||||
|
||||
|
||||
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
xErrorStatus = pdFAIL;
|
||||
|
@ -297,7 +297,7 @@ static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS
|
|||
{
|
||||
xErrorStatus = pdFAIL;
|
||||
}
|
||||
|
||||
|
||||
/* Ensure that the demo software timer has expired
|
||||
mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT times in between
|
||||
each call of this function. A critical section is not required to access
|
||||
|
@ -314,7 +314,7 @@ static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS
|
|||
{
|
||||
ulDemoSoftwareTimerCounter = 0UL;
|
||||
}
|
||||
|
||||
|
||||
if( ( xErrorStatus == pdFAIL ) && ( xChangedTimerPeriodAlready == pdFALSE ) )
|
||||
{
|
||||
/* An error has occurred, but the timer's period has not yet been changed,
|
||||
|
@ -322,13 +322,13 @@ static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS
|
|||
timer's period means the LED will toggle at a faster rate, giving a
|
||||
visible indication that something has gone wrong. */
|
||||
xChangedTimerPeriodAlready = pdTRUE;
|
||||
|
||||
|
||||
/* This call to xTimerChangePeriod() uses a zero block time. Functions
|
||||
called from inside of a timer callback function must *never* attempt to
|
||||
block. */
|
||||
xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );
|
||||
}
|
||||
|
||||
|
||||
/* Toggle the LED. The toggle rate will depend on whether or not an error
|
||||
has been found in any tasks. */
|
||||
mainLED_0 = !mainLED_0;
|
||||
|
@ -350,58 +350,58 @@ unsigned char ucResetFlag = RESF;
|
|||
/* Set fMX */
|
||||
CMC = 0x00;
|
||||
MSTOP = 1U;
|
||||
|
||||
|
||||
/* Set fMAIN */
|
||||
MCM0 = 0U;
|
||||
|
||||
|
||||
/* Set fSUB */
|
||||
XTSTOP = 1U;
|
||||
OSMC = 0x10;
|
||||
|
||||
|
||||
/* Set fCLK */
|
||||
CSS = 0U;
|
||||
|
||||
|
||||
/* Set fIH */
|
||||
HIOSTOP = 0U;
|
||||
}
|
||||
#else
|
||||
{
|
||||
unsigned char ucTempStabset, ucTempStabWait;
|
||||
unsigned char ucTempStabset, ucTempStabWait;
|
||||
|
||||
/* Set fMX */
|
||||
CMC = 0x41;
|
||||
OSTS = 0x07;
|
||||
MSTOP = 0U;
|
||||
ucTempStabset = 0xFF;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
ucTempStabWait = OSTC;
|
||||
ucTempStabWait &= ucTempStabset;
|
||||
}
|
||||
while( ucTempStabWait != ucTempStabset );
|
||||
|
||||
|
||||
/* Set fMAIN */
|
||||
MCM0 = 1U;
|
||||
|
||||
|
||||
/* Set fSUB */
|
||||
XTSTOP = 1U;
|
||||
OSMC = 0x10;
|
||||
|
||||
|
||||
/* Set fCLK */
|
||||
CSS = 0U;
|
||||
|
||||
|
||||
/* Set fIH */
|
||||
HIOSTOP = 0U;
|
||||
}
|
||||
#endif /* configCLOCK_SOURCE == 1 */
|
||||
|
||||
|
||||
/* LED port initialization - set port register. */
|
||||
P7 &= 0x7F;
|
||||
|
||||
|
||||
/* Set port mode register. */
|
||||
PM7 &= 0x7F;
|
||||
|
||||
|
||||
/* Switch pin initialization - enable pull-up resistor. */
|
||||
PU12_bit.no0 = 1;
|
||||
|
||||
|
@ -457,6 +457,6 @@ volatile size_t xFreeHeapSpace;
|
|||
management options. If there is a lot of heap memory free then the
|
||||
configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up
|
||||
RAM. */
|
||||
xFreeHeapSpace = xPortGetFreeHeapSize();
|
||||
xFreeHeapSpace = xPortGetFreeHeapSize();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue