All related to RL78 GCC demos (which are still a work in progress):

- Abstract out the IO port handling for the LED output so the same code can be used on multiple eval boards.
- Add in the RESTORE_CONTEXT macros.
- Swap to use heap_1.c instead of heap_4.c.
- Add data model macros to FreeRTOSConfig.h (may be removed if only one data model is supported by the compiler).
- Install interrupt handlers.
This commit is contained in:
Richard Barry
2013-03-04 13:23:48 +00:00
parent 37d302b8ee
commit fba04057ec
16 changed files with 1852 additions and 842 deletions
+6 -3
View File
@@ -55,12 +55,17 @@
<option id="com.renesas.cdt.core.Compiler.option.warning11.1438339511" name="Issue Warning if an uninitialised automatic variable is used(-Wuninitialized)" superClass="com.renesas.cdt.core.Compiler.option.warning11" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.core.Compiler.option.warning12.62902878" name="Issue Warning of member intialisation mismatch(-Wreorder)" superClass="com.renesas.cdt.core.Compiler.option.warning12" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.core.Compiler.option.warning13.1346187712" name="Issue Warning of bad sign comparisions(-Wsign-compare)" superClass="com.renesas.cdt.core.Compiler.option.warning13" value="true" valueType="boolean"/>
<option id="com.renesas.cdt.rl78.HardwareDebug.Compiler.option.debugFormat.2111907264" name="Debug format" superClass="com.renesas.cdt.rl78.HardwareDebug.Compiler.option.debugFormat" value="com.renesas.cdt.rl78.HardwareDebug.Compiler.option.debugFormat.dwarf" valueType="enumerated"/>
<option id="com.renesas.cdt.rl78.HardwareDebug.Compiler.option.optimizationLevel.474691448" name="Optimization level" superClass="com.renesas.cdt.rl78.HardwareDebug.Compiler.option.optimizationLevel" value="com.renesas.cdt.rl78.HardwareDebug.Compiler.option.optimizationLevel.none" valueType="enumerated"/>
<option id="com.renesas.cdt.rl78.HardwareDebug.Compiler.option.macroDefines.1975812623" name="Macro Defines" superClass="com.renesas.cdt.rl78.HardwareDebug.Compiler.option.macroDefines" valueType="stringList"/>
<option id="com.renesas.cdt.core.Compiler.option.includeSymbolTable.1341454572" name="Include Symbol Table(s)" superClass="com.renesas.cdt.core.Compiler.option.includeSymbolTable" value="true" valueType="boolean"/>
<inputType id="%Base.Compiler.C.InputType.Id.304532987" name="C Input" superClass="%Base.Compiler.C.InputType.Id"/>
</tool>
<tool id="com.renesas.cdt.rl78.hardwaredebug.win32.tool.assembler.Id.1483562315" name="Assembler" superClass="com.renesas.cdt.rl78.hardwaredebug.win32.tool.assembler.Id">
<option id="com.renesas.cdt.core.Assembler.option.includeFileDirectories.1195749866" name="Include file directories" superClass="com.renesas.cdt.core.Assembler.option.includeFileDirectories" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}\src&quot;"/>
</option>
<option id="com.renesas.cdt.core.Assembler.option.includeSymbolTable.139641641" name="Include Symbol Table(-as)" superClass="com.renesas.cdt.core.Assembler.option.includeSymbolTable" value="true" valueType="boolean"/>
<inputType id="%Base.Assembler.inputType.Id.1124641218" name="Assembler InputType" superClass="%Base.Assembler.inputType.Id"/>
</tool>
<tool command="rl78-elf-ld" commandLinePattern="${COMMAND} ${OUTPUT_FLAG}${OUTPUT_PREFIX} ${OUTPUT}${INPUTS} ${FLAGS}" id="com.renesas.cdt.rl78.hardwaredebug.win32.tool.linker.Id.148124689" name="Linker" superClass="com.renesas.cdt.rl78.hardwaredebug.win32.tool.linker.Id">
@@ -75,13 +80,11 @@
<option id="com.renesas.cdt.core.Linker.option.userDefinedOptions.1480388571" name="User defined options" superClass="com.renesas.cdt.core.Linker.option.userDefinedOptions" valueType="stringList">
<listOptionValue builtIn="false" value="-e_PowerON_Reset"/>
</option>
<option command="-stats" id="com.renesas.cdt.core.Linker.option.misc8.1524197031" name="Compute and display statistics about the operation of the linker(-stats)" superClass="com.renesas.cdt.core.Linker.option.misc8" value="true" valueType="boolean"/>
</tool>
<tool id="com.renesas.cdt.rl78.hardwaredebug.win32.tool.objcopy.Id.1332327082" name="Objcopy" superClass="com.renesas.cdt.rl78.hardwaredebug.win32.tool.objcopy.Id"/>
</toolChain>
</folderInfo>
<fileInfo id="com.renesas.cdt.RL78.configuration.hardwaredebug.1462655394.1069911675" name="RegTest.S" rcbsApplicability="disable" resourcePath="src/RegTest.S" toolsToInvoke="com.renesas.cdt.rl78.hardwaredebug.win32.tool.compiler.Id.323331132.901443813">
<tool id="com.renesas.cdt.rl78.hardwaredebug.win32.tool.compiler.Id.323331132.901443813" name="Compiler" superClass="com.renesas.cdt.rl78.hardwaredebug.win32.tool.compiler.Id.323331132"/>
</fileInfo>
<sourceEntries>
<entry excluding="src/RegTest.S" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
@@ -8,21 +8,36 @@
<stringAttribute key="com.renesas.cdt.core.optionInitCommands" value=""/>
<intAttribute key="com.renesas.cdt.core.portNumber" value="61234"/>
<stringAttribute key="com.renesas.cdt.core.runCommands" value=""/>
<stringAttribute key="com.renesas.cdt.core.serverParam" value="-g E1 -l 0 -t R5F10JBC -p 61234 -d 61236 -umFreq= 0 -usFreq= 0 -umClock= 1 -w 1 -usupplyVoltage= 0 -ucommMethod= 0 -usecurityID= 00000000000000000000 -upermitFlash= 1 -uuseWideVoltageMode= 1 -ueraseRom= 1 -uuseOnChipDebug= 0 -uuseUserOptionByte= 0 -ustopTimerEmu= 0 -ustopSerialEmu= 0 -umaskInternalResetSignal= 0 -umaskTargetResetSignal= 0 -n 0 -uverifyOnWritingMemory= 1"/>
<stringAttribute key="com.renesas.cdt.core.serverParam" value="-g E1 -l 0 -t R5F104PJ -p 61234 -d 61236 -umFreq= 0 -usFreq= 0 -umClock= 1 -w 1 -usupplyVoltage= 1 -ucommMethod= 0 -usecurityID= 00000000000000000000 -upermitFlash= 1 -uuseWideVoltageMode= 1 -ueraseRom= 1 -uuseOnChipDebug= 0 -uuseUserOptionByte= 0 -ustopTimerEmu= 0 -ustopSerialEmu= 0 -umaskInternalResetSignal= 0 -umaskTargetResetSignal= 0 -n 0 -uverifyOnWritingMemory= 1"/>
<booleanAttribute key="com.renesas.cdt.core.setResume" value="true"/>
<booleanAttribute key="com.renesas.cdt.core.setStopAt" value="true"/>
<booleanAttribute key="com.renesas.cdt.core.startServer" value="true"/>
<stringAttribute key="com.renesas.cdt.core.stopAt" value="main"/>
<stringAttribute key="com.renesas.cdt.core.targetDevice" value="R5F10JBC"/>
<stringAttribute key="com.renesas.cdt.core.targetDevice" value="R5F104PJ"/>
<booleanAttribute key="com.renesas.cdt.core.useRemoteTarget" value="true"/>
<stringAttribute key="com.renesas.cdt.launch.dsf.IO_MAP" value="${eclipse_home}..\internal\IoFiles\RL78\R5F10JBC.sfrx"/>
<booleanAttribute key="com.renesas.cdt.core.verboseMode" value="false"/>
<stringAttribute key="com.renesas.cdt.launch.dsf.IO_MAP" value="${eclipse_home}..\internal\IoFiles\RL78\R5F104PJ.sfrx"/>
<booleanAttribute key="com.renesas.cdt.launch.dsf.USE_DEFAULT_IO_MAP" value="true"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1.le" value="true"/>
<stringAttribute key="com.renesas.hardwaredebug.e1rl78.communication.method" value="0"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.e1_pwr" value="true"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.eraseFlash" value="true"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.hw_break" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.le" value="true"/>
<stringAttribute key="com.renesas.hardwaredebug.e1rl78.main.clock.freq" value="0"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.mask.internal.reset.signal" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.mask.target.reset.signal" value="false"/>
<stringAttribute key="com.renesas.hardwaredebug.e1rl78.monitor.clock" value="1"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.permit.flash.programming" value="true"/>
<stringAttribute key="com.renesas.hardwaredebug.e1rl78.security.id" value="00000000000000000000"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.stopSerialEmu" value="false"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.stopTimerEmu" value="false"/>
<stringAttribute key="com.renesas.hardwaredebug.e1rl78.sub.clock.freq" value="0"/>
<stringAttribute key="com.renesas.hardwaredebug.e1rl78.supply.voltage" value="1"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.use.wide.voltage.mode" value="true"/>
<booleanAttribute key="com.renesas.hardwaredebug.e1rl78.verify.on.writing.to.memory" value="true"/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="3"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
@@ -43,8 +58,12 @@
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${eclipse_home}../DebugComp/rl78-elf-gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="true"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="HardwareDebug\RTOSDemo.x"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RTOSDemo"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/RTOSDemo"/>
</listAttribute>
@@ -52,4 +71,5 @@
<listEntry value="4"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#13;&#10;"/>
</launchConfiguration>
@@ -56,19 +56,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.
*/
@@ -87,23 +87,9 @@
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
/* This #ifdef prevents the enclosed code being included from within an
asm file. It is valid in a C file, but not valid in an asm file. */
#ifdef __IAR_SYSTEMS_ICC__
#pragma language=extended
#pragma system_include
#include <intrinsics.h>
/* Device specific includes. */
#include <ior5f100le.h>
#include <ior5f100le_ext.h>
#endif /* __IAR_SYSTEMS_ICC__ */
#define configUSE_PREEMPTION 1
#define configTICK_RATE_HZ ( ( unsigned short ) 1000 )
#define configCPU_CLOCK_HZ ( ( unsigned long ) 32000000 ) /* Using the internal high speed clock */
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 80 )
#define configMAX_TASK_NAME_LEN ( 10 )
@@ -141,26 +127,11 @@ to exclude the API function. */
#define INCLUDE_xTaskGetIdleTaskHandle 0
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
/******************************************************************************
* PORT SPECIFIC CONFIGURATION OPTIONS
******************************************************************************/
/*
* RL78/G13 Clock Source Configuration
* 1 = use internal High Speed Clock Source (typically 32Mhz on the RL78/G13)
* 0 = use external Clock Source
*/
#define configCLOCK_SOURCE 1
#if configCLOCK_SOURCE == 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) /* using the external clock source */
#else
#define configCPU_CLOCK_HZ ( ( unsigned long ) 32000000 ) /* using the internal high speed clock */
#endif /* configCLOCK_SOURCE */
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
#define __DATA_MODEL_FAR__ 0
#define __DATA_MODEL_NEAR__ 1
#define __DATA_MODEL__ __DATA_MODEL_FAR__
#endif /* FREERTOS_CONFIG_H */
@@ -72,6 +72,7 @@
mission critical applications that require provable dependability.
*/
#include "FreeRTOSConfig.h"
#include "ISR_Support.h"
#define CS 0xFFFFC
@@ -93,40 +94,34 @@ _vPortYield:
portSAVE_CONTEXT
/* Call the scheduler to select the next task. */
call !!_vTaskSwitchContext
/*portRESTORE_CONTEXT ; Restore the context of the next task to run.*/
/* Restore the context of the next task to run. */
portRESTORE_CONTEXT
retb
/* Starts the scheduler by restoring the context of the task that will execute
first. */
_vPortStartFirstTask:
/* portRESTORE_CONTEXT ; Restore the context of whichever task the ... */
reti /*An interrupt stack frame is used so the task */
/* is started using a RETI instruction. */
/* Restore the context of whichever task will execute first. */
portRESTORE_CONTEXT
/* An interrupt stack frame is used so the task is started using RETI. */
reti
/* FreeRTOS tick handler. This is installed as the interval timer interrupt
handler. */
_vPortTickISR:
/* portSAVE_CONTEXT ; Save the context of the current task. */
call !!_vTaskIncrementTick /* Call the timer tick function. */
/* Save the context of the currently executing task. */
portSAVE_CONTEXT
/* Call the RTOS tick function. */
call !!_vTaskIncrementTick
#if configUSE_PREEMPTION == 1
call !!_vTaskSwitchContext /* Call the scheduler to select the next task. */
/* Select the next task to run. */
call !!_vTaskSwitchContext
#endif
/* portRESTORE_CONTEXT ; Restore the context of the next task to run. */
/* Retore the context of whichever task will run next. */
portRESTORE_CONTEXT
reti
/* Install the interrupt handlers
COMMON INTVEC:CODE:ROOT(1)
ORG 56
DW vPortTickISR
COMMON INTVEC:CODE:ROOT(1)
ORG 126
DW vPortYield */
.end
@@ -0,0 +1,177 @@
/*
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel.
FreeRTOS 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
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
viewed here: http://www.freertos.org/a00114.html and also obtained by
writing to Real Time Engineers Ltd., contact details for whom are available
on the FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
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,
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
mission critical applications that require provable dependability.
*/
/*
* The simplest possible implementation of pvPortMalloc(). Note that this
* implementation does NOT allow allocated memory to be freed again.
*
* See heap_2.c, heap_3.c and heap_4.c for alternative implementations, and the
* memory management pages of http://www.FreeRTOS.org for more information.
*/
#include <stdlib.h>
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h"
#include "task.h"
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* A few bytes might be lost to byte aligning the heap start address. */
#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
/* Allocate the memory for the heap. */
static unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];
static size_t xNextFreeByte = ( size_t ) 0;
/*-----------------------------------------------------------*/
void *pvPortMalloc( size_t xWantedSize )
{
void *pvReturn = NULL;
static unsigned char *pucAlignedHeap = NULL;
/* Ensure that blocks are always aligned to the required number of bytes. */
#if portBYTE_ALIGNMENT != 1
if( xWantedSize & portBYTE_ALIGNMENT_MASK )
{
/* Byte alignment required. */
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
}
#endif
vTaskSuspendAll();
{
if( pucAlignedHeap == NULL )
{
/* Ensure the heap starts on a correctly aligned boundary. */
pucAlignedHeap = ( unsigned char * ) ( ( ( portPOINTER_SIZE_TYPE ) &ucHeap[ portBYTE_ALIGNMENT ] ) & ( ( portPOINTER_SIZE_TYPE ) ~portBYTE_ALIGNMENT_MASK ) );
}
/* Check there is enough room left for the allocation. */
if( ( ( xNextFreeByte + xWantedSize ) < configADJUSTED_HEAP_SIZE ) &&
( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) )/* Check for overflow. */
{
/* Return the next free byte then increment the index past this
block. */
pvReturn = pucAlignedHeap + xNextFreeByte;
xNextFreeByte += xWantedSize;
}
}
xTaskResumeAll();
#if( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
extern void vApplicationMallocFailedHook( void );
vApplicationMallocFailedHook();
}
}
#endif
return pvReturn;
}
/*-----------------------------------------------------------*/
void vPortFree( void *pv )
{
/* Memory cannot be freed using this scheme. See heap_2.c, heap_3.c and
heap_4.c for alternative implementations, and the memory management pages of
http://www.FreeRTOS.org for more information. */
( void ) pv;
/* Force an assert as it is invalid to call this function. */
configASSERT( pv == NULL );
}
/*-----------------------------------------------------------*/
void vPortInitialiseBlocks( void )
{
/* Only required when static memory is not cleared. */
xNextFreeByte = ( size_t ) 0;
}
/*-----------------------------------------------------------*/
size_t xPortGetFreeHeapSize( void )
{
return ( configADJUSTED_HEAP_SIZE - xNextFreeByte );
}
File diff suppressed because it is too large Load Diff
+102
View File
@@ -0,0 +1,102 @@
/*
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel.
FreeRTOS 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
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
viewed here: http://www.freertos.org/a00114.html and also obtained by
writing to Real Time Engineers Ltd., contact details for whom are available
on the FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
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,
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
mission critical applications that require provable dependability.
*/
/*
* Board specific macros to initialise and toggle an LED.
*/
#ifndef LED_IO_H
#define LED_IO_H
#ifdef YRPBRL78G13
#define LED_BIT ( P7_bit.no7 )
#define LED_INIT() P7 &= 0x7F; PM7 &= 0x7F
#endif /* YRPBRL78G13 */
#ifdef YRDKRL78G14
#define LED_BIT ( P1_bit.no0 )
#define LED_INIT() P1 &= 0xFE; PM1 &= 0xFE
#endif /* YRDKRL78G14 */
#ifdef RSKRL78G1C
#define LED_BIT ( P0_bit.no1 )
#define LED_INIT() P0 &= 0xFD; PM0 &= 0xFD
#endif /* RSKRL78G1C */
#ifndef LED_BIT
#error The hardware platform is not defined
#endif
#endif /* LED_IO_H */
@@ -9,18 +9,36 @@
/* This file is generated by e2studio. */
/* */
/***********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
extern void HardwareSetup(void);
#ifdef __cplusplus
}
#endif
/* Scheduler include files. */
#include "FreeRTOS.h"
/* Hardware includes. */
#include "port_iodefine.h"
void HardwareSetup(void)
{
}
unsigned char ucResetFlag = RESF;
portDISABLE_INTERRUPTS();
/* Set fMX */
CMC = 0x00;
MSTOP = 1U;
/* Set fMAIN */
MCM0 = 0U;
/* Set fSUB */
XTSTOP = 1U;
OSMC = 0x10;
/* Set fCLK */
CSS = 0U;
/* Set fIH */
HIOSTOP = 0U;
/* LED port initialization. */
LED_INIT();
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+9 -64
View File
@@ -135,6 +135,8 @@
/* Hardware includes. */
#include "port_iodefine.h"
#include "port_iodefine_ext.h"
#include "LED.h"
/* The period at which the check timer will expire, in ms, provided no errors
have been reported by any of the standard demo tasks. ms are converted to the
@@ -154,9 +156,6 @@ its own executions. */
#define mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT ( 100UL )
#define mainDEMO_TIMER_PERIOD_MS ( mainCHECK_TIMER_PERIOD_MS / mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT )
/* The LED toggled by the check timer. */
#define mainLED_0 P1_bit.no0
/* A block time of zero simple means "don't block". */
#define mainDONT_BLOCK ( 0U )
@@ -172,12 +171,6 @@ static void prvCheckTimerCallback( xTimerHandle xTimer );
*/
static void prvDemoTimerCallback( xTimerHandle xTimer );
/*
* This function is called from the C startup routine to setup the processor -
* in particular the clock source.
*/
int __low_level_init(void);
/*
* Functions that define the RegTest tasks, as described at the top of this file.
*/
@@ -201,25 +194,14 @@ 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
enabled. */
#if 0
__root __far const unsigned char OptionByte[] @ 0x00C0 =
{
0x00U, 0xFFU, 0xF8U, 0x81U
};
/* Security byte definition */
__root __far const unsigned char ucSecurityCode[] @ 0x00C4 =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
#endif
/*-----------------------------------------------------------*/
volatile unsigned char ucTemp;
short main( void )
{
ucTemp = RESF;
ucTemp = sizeof( char* );
ucTemp = sizeof( pdTASK_CODE );
/* Creates all the tasks and timers, then starts the scheduler. */
/* First create the 'standard demo' tasks. These are used to demonstrate
@@ -349,45 +331,7 @@ static unsigned short usLastRegTest1Counter = 0, usLastRegTest2Counter = 0;
/* Toggle the LED. The toggle rate will depend on whether or not an error
has been found in any tasks. */
mainLED_0 = !mainLED_0;
}
/*-----------------------------------------------------------*/
int __low_level_init(void)
{
unsigned portCHAR ucResetFlag = RESF;
portDISABLE_INTERRUPTS();
/* Set fMX */
CMC = 0x00;
MSTOP = 1U;
/* Set fMAIN */
MCM0 = 0U;
/* Set fSUB */
XTSTOP = 1U;
OSMC = 0x10;
/* Set fCLK */
CSS = 0U;
/* Set fIH */
HIOSTOP = 0U;
/* LED port initialization - set port register. */
// P7 &= 0x7F;
P1 &= 0xFE;
/* Set port mode register. */
// PM7 &= 0x7F;
PM1 &= 0xFE;
/* Switch pin initialization - enable pull-up resistor. */
// PU12_bit.no0 = 1;
return pdTRUE;
LED_BIT = !LED_BIT;
}
/*-----------------------------------------------------------*/
@@ -438,4 +382,5 @@ volatile size_t xFreeHeapSpace;
RAM. */
xFreeHeapSpace = xPortGetFreeHeapSize();
}
/*-----------------------------------------------------------*/
@@ -3,8 +3,8 @@
/* PROJECT NAME : RTOSDemo */
/* FILE : reset_program.asm */
/* DESCRIPTION : Reset Program */
/* CPU SERIES : RL78 - G1C */
/* CPU TYPE : R5F10JBC */
/* CPU SERIES : RL78 - G14 */
/* CPU TYPE : R5F104PJ */
/* */
/* This file is generated by e2studio. */
/* */
@@ -3,8 +3,8 @@
/* PROJECT NAME : RTOSDemo */
/* FILE : typedefine.h */
/* DESCRIPTION : Aliases of Integer Type */
/* CPU SERIES : RL78 - G1C */
/* CPU TYPE : R5F10JBC */
/* CPU SERIES : RL78 - G14 */
/* CPU TYPE : R5F104PJ */
/* */
/* This file is generated by e2studio. */
/* */
@@ -1,21 +1,24 @@
/***********************************************************************/
/* */
/* PROJECT NAME : RTOSDemo */
/* PROJECT NAME : test */
/* FILE : vector_table.c */
/* DESCRIPTION : Vector Table */
/* CPU SERIES : RL78 - G1C */
/* CPU TYPE : R5F10JBC */
/* CPU SERIES : RL78 - G14 */
/* CPU TYPE : R5F104PJ */
/* */
/* This file is generated by e2studio. */
/* */
/***********************************************************************/
#include "interrupt_handlers.h"
extern void PowerON_Reset (void);
extern void PowerON_Reset( void );
extern void vPortTickISR( void );
extern void vPortYield( void );
#warning Check the options bytes.
const unsigned char Option_Bytes[] __attribute__ ((section (".option_bytes"))) = {
0xef, 0xff, 0xe8, 0x85
0x6e, 0xff, 0xe8, 0x85 /* 0x00U, 0xFFU, 0xF8U, 0x81U */
};
const unsigned char Security_Id[] __attribute__ ((section (".security_id"))) = {
@@ -46,32 +49,32 @@ const void *Vectors[] VECT_SECT = {
INT_P4,
//INT_P5 (0x12)
INT_P5,
//INT_CSI20/INT_IIC20/INT_ST2 (0x14)
INT_ST2,
//INT_CSI21/INT_IIC21/INT_SR2 (0x16)
INT_SR2,
//INT_SRE2/INT_TM11H (0x18)
INT_TM11H,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
//INT_DMA0 (0x1A)
INT_DMA0,
//INT_DMA1 (0x1C)
INT_DMA1,
//INT_CSI00/INT_IIC00/INT_ST0 (0x1E)
INT_ST0,
//INT_TM00 (0x20)
INT_TM00,
//INT_CSI01/INT_IIC01/INT_SR0 (0x22)
//INT_CSI01/INT_IIC01/INT_SR0 (0x20)
INT_SR0,
//INT_SRE0/INT_TM01H (0x24)
//INT_SRE0/INT_TM01H (0x22)
INT_TM01H,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
//INT_TM03H (0x2A)
//INT_CSI10/INT_IIC10/INT_ST1 (0x24)
INT_ST1,
//INT_CSI11/INT_IIC11/INT_SR1 (0x26)
INT_SR1,
//INT_SRE1/INT_TM03H (0x28)
INT_TM03H,
//INT_IICA0 (0x2C)
//INT_IICA0 (0x2A)
INT_IICA0,
//INT_TM00 (0x2C)
INT_TM00,
//INT_TM01 (0x2E)
INT_TM01,
//INT_TM02 (0x30)
@@ -83,47 +86,47 @@ const void *Vectors[] VECT_SECT = {
//INT_RTC (0x36)
INT_RTC,
//INT_IT (0x38)
INT_IT,
// Padding
(void*)0xFFFF,
//INT_USB (0x3C)
INT_USB,
//INT_RSUM (0x3E)
INT_RSUM,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
vPortTickISR,
//INT_KR (0x3A)
INT_KR,
//INT_CSI30/INT_IIC30/INT_ST3 (0x3C)
INT_ST3,
//INT_CSI31/INT_IIC31/INT_SR3 (0x3E)
INT_SR3,
//INT_TRJ0 (0x40)
INT_TRJ0,
//INT_TM10 (0x42)
INT_TM10,
//INT_TM11 (0x44)
INT_TM11,
//INT_TM12 (0x46)
INT_TM12,
//INT_TM13 (0x48)
INT_TM13,
//INT_P6 (0x4A)
INT_P6,
//INT_P7 (0x4C)
INT_P7,
//INT_P8 (0x4E)
INT_P8,
//INT_P9 (0x50)
INT_P9,
//INT_CMP0/INT_P10 (0x52)
INT_P10,
//INT_CMP1/INT_P11 (0x54)
INT_P11,
//INT_TRD0 (0x56)
INT_TRD0,
//INT_TRD1 (0x58)
INT_TRD1,
//INT_TRG (0x5A)
INT_TRG,
//INT_SRE3/INT_TM13H (0x5C)
INT_TM13H,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
// Padding
(void*)0xFFFF,
//INT_MD (0x5E)
INT_MD,
// Padding
(void*)0xFFFF,
//INT_IICA1 (0x60)
INT_IICA1,
//INT_FL (0x62)
INT_FL,
// Padding
@@ -153,6 +156,6 @@ const void *Vectors[] VECT_SECT = {
// Padding
(void*)0xFFFF,
//INT_BRK_I (0x7E)
INT_BRK_I,
vPortYield,
};