Continue work on RX600 port - work in progress.

This commit is contained in:
Richard Barry 2010-08-18 13:29:12 +00:00
parent 49c5f327fc
commit df410c7e27
2 changed files with 36 additions and 15 deletions

View file

@ -62,6 +62,9 @@
/* Library includes. */
#include "string.h"
/* Hardware specifics. */
#include "iodefine.h"
/*-----------------------------------------------------------*/
/* Tasks should start with interrupts enabled, therefore PSW is set with U,I,PM
@ -163,6 +166,15 @@ extern void vApplicationSetupTimerInterrupt( void );
use. A demo application is provided to show a suitable example. */
vApplicationSetupTimerInterrupt();
/* Enable the software interrupt. */
_IEN( _ICU_SWINT ) = 1;
/* Ensure the software interrupt is clear. */
_IR( _ICU_SWINT ) = 0;
/* Ensure the software interrupt is set to the kernel priority. */
_IPR( _ICU_SWINT ) = configKERNEL_INTERRUPT_PRIORITY;
/* Start the first task. */
prvStartFirstTask();
}
@ -178,26 +190,30 @@ void vPortEndScheduler( void )
}
/*-----------------------------------------------------------*/
void vPortYield( void )
{
}
/*-----------------------------------------------------------*/
#pragma interrupt (vTickISR(vect=configTICK_VECTOR,enable))
#pragma interrupt ( vTickISR( vect = _VECT( configTICK_VECTOR ), enable ) )
void vTickISR( void )
{
/* Restore previous IPL on exit. */
//set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );
static volatile unsigned long ul = 0;
ul++;
/* Clear the interrupt. */
vTaskIncrementTick();
// vTaskIncrementTick();
#if( configUSE_PREEMPTION == 1 )
taskYIELD();
// taskYIELD();
#endif
}
/*-----------------------------------------------------------*/
#pragma interrupt ( vSoftwareInterruptISR( vect = _VECT( _ICU_SWINT ), enable ) )
void vSoftwareInterruptISR( void )
{
static volatile unsigned long ul = 0;
ul++;
}
#pragma inline_asm prvStartFirstTask
static void prvStartFirstTask( void )
{
@ -225,3 +241,5 @@ static void prvStartFirstTask( void )
NOP
NOP
}

View file

@ -99,8 +99,10 @@ portSTACK_TYPE and portBASE_TYPE. */
#define portSTART_SCHEDULER_TRAP_NO ( 32 )
#define portKERNEL_INTERRUPT_PRIORITY ( 1 )
void vPortYield( void );
#define portYIELD() vPortYield()
/* The location of the software interrupt register. Software interrupts use
vector 27. */
#define portITU_SWINTR ( ( unsigned char * ) 0x000872E0 )
#define portYIELD() *portITU_SWINTR = 0x01; nop(); nop(); nop(); nop(); nop()
extern void vTaskSwitchContext( void );
#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) vTaskSwitchContext()
@ -110,7 +112,7 @@ extern void vTaskSwitchContext( void );
* and taskEXIT_CRITICAL() macros.
*/
#define portENABLE_INTERRUPTS() set_ipl( 0 )
#define portDISABLE_INTERRUPTS() set_ipl( configKERNEL_INTERRUPT_PRIORITY )
#define portDISABLE_INTERRUPTS() set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY )
#define portSET_INTERRUPT_MASK_FROM_ISR() get_ipl(); set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY )
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( uxSavedInterruptStatus )
@ -124,6 +126,7 @@ extern void vTaskExitCritical( void );
#define portENTER_CRITICAL() vTaskEnterCritical();
#define portEXIT_CRITICAL() vTaskExitCritical();
/*-----------------------------------------------------------*/
/* Task function macros as described on the FreeRTOS.org WEB site. */