mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-22 14:31:59 -04:00
Continue work on RX600 port - work in progress.
This commit is contained in:
parent
49c5f327fc
commit
df410c7e27
|
@ -62,6 +62,9 @@
|
||||||
/* Library includes. */
|
/* Library includes. */
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|
||||||
|
/* Hardware specifics. */
|
||||||
|
#include "iodefine.h"
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Tasks should start with interrupts enabled, therefore PSW is set with U,I,PM
|
/* Tasks should start with interrupts enabled, therefore PSW is set with U,I,PM
|
||||||
|
@ -72,8 +75,8 @@ flags set and IPL clear. */
|
||||||
PM = 0 Supervisor mode.
|
PM = 0 Supervisor mode.
|
||||||
IPL = 0 All interrupt priorities enabled.
|
IPL = 0 All interrupt priorities enabled.
|
||||||
*/
|
*/
|
||||||
#define portINITIAL_PSW ( ( portSTACK_TYPE ) 0x00030000 )
|
#define portINITIAL_PSW ( ( portSTACK_TYPE ) 0x00030000 )
|
||||||
#define portINITIAL_FPSW ( ( portSTACK_TYPE ) 0x00000100 )
|
#define portINITIAL_FPSW ( ( portSTACK_TYPE ) 0x00000100 )
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -163,6 +166,15 @@ extern void vApplicationSetupTimerInterrupt( void );
|
||||||
use. A demo application is provided to show a suitable example. */
|
use. A demo application is provided to show a suitable example. */
|
||||||
vApplicationSetupTimerInterrupt();
|
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. */
|
/* Start the first task. */
|
||||||
prvStartFirstTask();
|
prvStartFirstTask();
|
||||||
}
|
}
|
||||||
|
@ -178,26 +190,30 @@ void vPortEndScheduler( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vPortYield( void )
|
#pragma interrupt ( vTickISR( vect = _VECT( configTICK_VECTOR ), enable ) )
|
||||||
{
|
|
||||||
}
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#pragma interrupt (vTickISR(vect=configTICK_VECTOR,enable))
|
|
||||||
void vTickISR( void )
|
void vTickISR( void )
|
||||||
{
|
{
|
||||||
/* Restore previous IPL on exit. */
|
static volatile unsigned long ul = 0;
|
||||||
//set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );
|
|
||||||
|
ul++;
|
||||||
|
|
||||||
/* Clear the interrupt. */
|
/* Clear the interrupt. */
|
||||||
vTaskIncrementTick();
|
// vTaskIncrementTick();
|
||||||
|
|
||||||
#if( configUSE_PREEMPTION == 1 )
|
#if( configUSE_PREEMPTION == 1 )
|
||||||
taskYIELD();
|
// taskYIELD();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#pragma interrupt ( vSoftwareInterruptISR( vect = _VECT( _ICU_SWINT ), enable ) )
|
||||||
|
void vSoftwareInterruptISR( void )
|
||||||
|
{
|
||||||
|
static volatile unsigned long ul = 0;
|
||||||
|
|
||||||
|
ul++;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma inline_asm prvStartFirstTask
|
#pragma inline_asm prvStartFirstTask
|
||||||
static void prvStartFirstTask( void )
|
static void prvStartFirstTask( void )
|
||||||
{
|
{
|
||||||
|
@ -225,3 +241,5 @@ static void prvStartFirstTask( void )
|
||||||
NOP
|
NOP
|
||||||
NOP
|
NOP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,8 +99,10 @@ portSTACK_TYPE and portBASE_TYPE. */
|
||||||
#define portSTART_SCHEDULER_TRAP_NO ( 32 )
|
#define portSTART_SCHEDULER_TRAP_NO ( 32 )
|
||||||
#define portKERNEL_INTERRUPT_PRIORITY ( 1 )
|
#define portKERNEL_INTERRUPT_PRIORITY ( 1 )
|
||||||
|
|
||||||
void vPortYield( void );
|
/* The location of the software interrupt register. Software interrupts use
|
||||||
#define portYIELD() vPortYield()
|
vector 27. */
|
||||||
|
#define portITU_SWINTR ( ( unsigned char * ) 0x000872E0 )
|
||||||
|
#define portYIELD() *portITU_SWINTR = 0x01; nop(); nop(); nop(); nop(); nop()
|
||||||
|
|
||||||
extern void vTaskSwitchContext( void );
|
extern void vTaskSwitchContext( void );
|
||||||
#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) vTaskSwitchContext()
|
#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) vTaskSwitchContext()
|
||||||
|
@ -110,7 +112,7 @@ extern void vTaskSwitchContext( void );
|
||||||
* and taskEXIT_CRITICAL() macros.
|
* and taskEXIT_CRITICAL() macros.
|
||||||
*/
|
*/
|
||||||
#define portENABLE_INTERRUPTS() set_ipl( 0 )
|
#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 portSET_INTERRUPT_MASK_FROM_ISR() get_ipl(); set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY )
|
||||||
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( uxSavedInterruptStatus )
|
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( uxSavedInterruptStatus )
|
||||||
|
@ -124,6 +126,7 @@ extern void vTaskExitCritical( void );
|
||||||
#define portENTER_CRITICAL() vTaskEnterCritical();
|
#define portENTER_CRITICAL() vTaskEnterCritical();
|
||||||
#define portEXIT_CRITICAL() vTaskExitCritical();
|
#define portEXIT_CRITICAL() vTaskExitCritical();
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Task function macros as described on the FreeRTOS.org WEB site. */
|
/* Task function macros as described on the FreeRTOS.org WEB site. */
|
||||||
|
|
Loading…
Reference in a new issue