/* 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
\r
extern void *pxCurrentTCB;\r
\r
-unsigned char ucIPLToRestore = 0;\r
-\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
-void vPortSetInterruptMask( void )\r
+#pragma interrupt ( vSoftwareInterruptISR( vect = _VECT( _ICU_SWINT ), enable ) )\r
+void vSoftwareInterruptISR( void )\r
{\r
-unsigned char ucPreviousIPL;\r
+static volatile unsigned long ul = 0;\r
\r
- /* Store the current IPL to ensure it is restored correctly later if it is\r
- not currently 0. This is a stack variable, so there should not be a race\r
- condition even if there is an interrupt or context switch before the new\r
- IPL value gets set. */\r
- ucPreviousIPL = get_ipl();\r
- \r
- /* Set the mask up to the max syscall priority. */\r
- set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
- \r
- /* Now the mask is set there will not be a context switch, so the previous\r
- and current IPL values can be compared. This ensures against the IPL being\r
- set back to zero too early when critical sections nest. */\r
- if( ucPreviousIPL < configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
- {\r
- ucIPLToRestore = ucPreviousIPL;\r
- }\r
+ ul++;\r
}\r
-/*-----------------------------------------------------------*/\r
\r
#pragma inline_asm prvStartFirstTask\r
static void prvStartFirstTask( void )\r
NOP\r
NOP\r
}\r
+\r
+\r