/* Library includes. */\r
#include "string.h"\r
\r
+/* Hardware specifics. */\r
+#include "iodefine.h"\r
+\r
/*-----------------------------------------------------------*/\r
\r
/* Tasks should start with interrupts enabled, therefore PSW is set with U,I,PM \r
PM = 0 Supervisor mode.\r
IPL = 0 All interrupt priorities enabled.\r
*/\r
-#define portINITIAL_PSW ( ( portSTACK_TYPE ) 0x00030000 )\r
-#define portINITIAL_FPSW ( ( portSTACK_TYPE ) 0x00000100 )\r
+#define portINITIAL_PSW ( ( portSTACK_TYPE ) 0x00030000 )\r
+#define portINITIAL_FPSW ( ( portSTACK_TYPE ) 0x00000100 )\r
\r
\r
/*-----------------------------------------------------------*/\r
use. A demo application is provided to show a suitable example. */\r
vApplicationSetupTimerInterrupt();\r
\r
+ /* Enable the software interrupt. */ \r
+ _IEN( _ICU_SWINT ) = 1;\r
+ \r
+ /* Ensure the software interrupt is clear. */\r
+ _IR( _ICU_SWINT ) = 0;\r
+ \r
+ /* Ensure the software interrupt is set to the kernel priority. */\r
+ _IPR( _ICU_SWINT ) = configKERNEL_INTERRUPT_PRIORITY;\r
+ \r
/* Start the first task. */\r
prvStartFirstTask();\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vPortYield( void )\r
-{\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-#pragma interrupt (vTickISR(vect=configTICK_VECTOR,enable))\r
+#pragma interrupt ( vTickISR( vect = _VECT( configTICK_VECTOR ), enable ) )\r
void vTickISR( void )\r
{\r
- /* Restore previous IPL on exit. */\r
- //set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
+static volatile unsigned long ul = 0;\r
+\r
+ ul++;\r
\r
/* Clear the interrupt. */\r
- vTaskIncrementTick();\r
+// vTaskIncrementTick();\r
\r
#if( configUSE_PREEMPTION == 1 )\r
- taskYIELD();\r
+// taskYIELD();\r
#endif\r
}\r
/*-----------------------------------------------------------*/\r
\r
+#pragma interrupt ( vSoftwareInterruptISR( vect = _VECT( _ICU_SWINT ), enable ) )\r
+void vSoftwareInterruptISR( void )\r
+{\r
+static volatile unsigned long ul = 0;\r
+\r
+ ul++;\r
+}\r
+\r
#pragma inline_asm prvStartFirstTask\r
static void prvStartFirstTask( void )\r
{\r
NOP\r
NOP\r
}\r
+\r
+\r
#define portSTART_SCHEDULER_TRAP_NO ( 32 )\r
#define portKERNEL_INTERRUPT_PRIORITY ( 1 )\r
\r
-void vPortYield( void );\r
-#define portYIELD() vPortYield()\r
+/* The location of the software interrupt register. Software interrupts use\r
+vector 27. */\r
+#define portITU_SWINTR ( ( unsigned char * ) 0x000872E0 )\r
+#define portYIELD() *portITU_SWINTR = 0x01; nop(); nop(); nop(); nop(); nop()\r
\r
extern void vTaskSwitchContext( void );\r
#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) vTaskSwitchContext()\r
* and taskEXIT_CRITICAL() macros.\r
*/\r
#define portENABLE_INTERRUPTS() set_ipl( 0 )\r
-#define portDISABLE_INTERRUPTS() set_ipl( configKERNEL_INTERRUPT_PRIORITY )\r
+#define portDISABLE_INTERRUPTS() set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
\r
#define portSET_INTERRUPT_MASK_FROM_ISR() get_ipl(); set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( uxSavedInterruptStatus )\r
#define portENTER_CRITICAL() vTaskEnterCritical();\r
#define portEXIT_CRITICAL() vTaskExitCritical();\r
\r
+\r
/*-----------------------------------------------------------*/\r
\r
/* Task function macros as described on the FreeRTOS.org WEB site. */\r