]> git.sur5r.net Git - freertos/commitdiff
Update interrupt priorities for Fujitsu port.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 11 Feb 2008 21:01:22 +0000 (21:01 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 11 Feb 2008 21:01:22 +0000 (21:01 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@162 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/MB91460_Softune/91467d_FreeRTOS.prj
Demo/MB91460_Softune/91467d_FreeRTOS.wsp
Demo/MB91460_Softune/SRC/FreeRTOSConfig.h
Demo/MB91460_Softune/SRC/serial/serial.c
Demo/MB91460_Softune/SRC/utility/taskutility.c
Demo/MB91460_Softune/SRC/vectors.c
Demo/MB91460_Softune/STANDALONE/Mondeb_57K6_com1.sup

index 2f8885e16dfc760c73eabeaccb054b9323ea2ca4..e05a92c98dcff1bb08ba72c35a342d25fd61fbaa 100644 (file)
@@ -362,17 +362,19 @@ F27-7=- ..\..\Source\include\task.h
 F27-8=- ..\..\Source\include\list.h\r
 F27-9=- SRC\watchdog\watchdog.h\r
 F27-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h\r
-F28=10 c 1 SRC\utility\taskutility.c\r
+F28=12 c 1 SRC\utility\taskutility.c\r
 F28-1=- SRC\mb91467d.h\r
 F28-2=- SRC\vectors.h\r
 F28-3=- ..\..\Source\include\FreeRTOS.h\r
-F28-4=- ..\..\Source\include\projdefs.h\r
-F28-5=- SRC\FreeRTOSConfig.h\r
-F28-6=- ..\..\Source\include\portable.h\r
-F28-7=- ..\..\Source\portable\Softune\MB91460\portmacro.h\r
-F28-8=- ..\..\Source\include\task.h\r
-F28-9=- ..\..\Source\include\list.h\r
-F28-10=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h\r
+F28-4=- ..\..\..\..\..\..\devtools\Softune6\LIB\911\INCLUDE\stddef.h\r
+F28-5=- ..\..\Source\include\projdefs.h\r
+F28-6=- SRC\FreeRTOSConfig.h\r
+F28-7=- ..\..\Source\include\portable.h\r
+F28-8=- ..\..\Source\portable\Softune\MB91460\portmacro.h\r
+F28-9=- ..\..\Source\include\task.h\r
+F28-10=- ..\..\Source\include\list.h\r
+F28-11=- ..\..\Source\include\semphr.h\r
+F28-12=- ..\..\Source\include\queue.h\r
 F29=25 c 1 SRC\main.c\r
 F29-1=- SRC\mb91467d.h\r
 F29-2=- SRC\vectors.h\r
index a9e6f67722c7b91cf73fe8c27b456422930d6826..512ab5b47fc0c45231580847f504434f26ee5e66 100644 (file)
@@ -18,6 +18,8 @@ AutoLoad=1
 WSP=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\MB91460_Softune\\r
 \r
 [EditState]\r
-STATE-1=SRC\main.c:1\r
-Count=1\r
+STATE-1=SRC\main.c:18\r
+STATE-2=..\..\Source\queue.c:988\r
+STATE-3=..\..\Source\tasks.c:1342\r
+Count=3\r
 \r
index f5dfe2f5f8cfe60a649e4f0754ea624456ab0bd2..af11cda283a65b3886493f1570dbcad2c86c88fa 100644 (file)
@@ -53,7 +53,7 @@
 #define configCPU_CLOCK_HZ                     ( ( unsigned portLONG ) 64000000 )  /* Clock setup from start91460.asm in the demo application. */\r
 #define configPER_CLOCK_HZ                     ( ( unsigned portLONG ) 16000000 )  /* Clock setup from start91460.asm in the demo application. */\r
 #define configMAX_PRIORITIES           ( ( unsigned portBASE_TYPE ) 6 )\r
-#define configMINIMAL_STACK_SIZE       ( ( unsigned portSHORT ) 70 )\r
+#define configMINIMAL_STACK_SIZE       ( ( unsigned portSHORT ) 100 )\r
 #define configTOTAL_HEAP_SIZE          ( ( size_t ) ( 32768 - 4192 ) )\r
 #define configMAX_TASK_NAME_LEN                ( 20 )\r
 #define configUSE_TRACE_FACILITY       1\r
index 4aaf1915986e97edb67b371f30548aebc86c55b8..090d7993571af036ade6d4ceadd26113493bb012 100644 (file)
@@ -174,7 +174,7 @@ signed portBASE_TYPE xReturn;
                /*If the post causes a task to wake force a context switch \r
                as the woken task may have a higher priority than the task we have \r
                interrupted. */\r
-               portYIELDFromISR();\r
+               portYIELD_FROM_ISR();\r
        }\r
 }\r
 \r
index e381aee674f70070c5b20593b2eaf5dc2b36bbbf..b23f633f270729dcc70e590b663e67cb678a7e66 100644 (file)
 /* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */\r
 /* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */\r
 /* ELIGIBILITY FOR ANY PURPOSES.                                                                                        */\r
-/*                              (C) Fujitsu Microelectronics Europe GmbH                                 */\r
+/*                              (C) Fujitsu Microelectronics Europe GmbH                                        */\r
 /*------------------------------------------------------------------------\r
   taskutility.C\r
   - \r
 -------------------------------------------------------------------------*/\r
-\r
\r
-/*************************@INCLUDE_START************************/\r
 #include "mb91467d.h"\r
 #include "vectors.h"\r
 #include "FreeRTOS.h"\r
 #include "task.h"\r
-\r
+#include "semphr.h"\r
 \r
 static void vUART5Task( void *pvParameters );\r
 \r
-/**************************@INCLUDE_END*************************/\r
-/*********************@GLOBAL_VARIABLES_START*******************/\r
-const char ASCII[] = "0123456789ABCDEF";\r
+const char                     ASCII[] = "0123456789ABCDEF";\r
+\r
+void                           vInitUart5( void );\r
 \r
-xTaskHandle UART_TaskHandle;\r
+xSemaphoreHandle       xSemaphore;\r
 \r
-void InitUart5(void)\r
+void vInitUart5( void )\r
 {\r
        //Initialize UART asynchronous mode\r
-       BGR05 = 1666; //  9600 Baud @ 16MHz\r
-       \r
+       BGR05 = 1666;   //  9600 Baud @ 16MHz\r
        SCR05 = 0x17;   // 7N2\r
        SMR05 = 0x0d;   // enable SOT3, Reset, normal mode\r
        SSR05 = 0x00;   // LSB first\r
-       \r
        PFR19_D4 = 1;   // enable UART\r
        PFR19_D5 = 1;   // enable UART\r
 \r
        //EPFR19 = 0x00;   // enable UART\r
-       \r
        SSR05_RIE = 1;\r
 }\r
 \r
-void Putch5(char ch)            /* sends a char */\r
+void Putch5( char ch ) /* sends a char */\r
 {\r
-  while (SSR05_TDRE == 0);     /* wait for transmit buffer empty       */\r
-  TDR05 = ch;                           /* put ch into buffer                  */\r
+       while( SSR05_TDRE == 0 );\r
+\r
+       /* wait for transmit buffer empty */\r
+       TDR05 = ch; /* put ch into buffer */\r
 }\r
 \r
-char Getch5(void)                      /* waits for and returns incomming char         */\r
+char Getch5( void ) /* waits for and returns incomming char */\r
 {\r
-  volatile unsigned ch;\r
-  \r
-  while(SSR05_RDRF == 0);       /* wait for data received      */\r
-  if (SSR05_ORE)                         /* overrun error              */\r
-  {\r
-       ch = RDR05;                       /* reset error flags          */\r
-       return (char)(-1);\r
-  }\r
-  else\r
-  return (RDR05);                      /* return char                  */\r
+       volatile unsigned       ch;\r
+\r
+       while( SSR05_RDRF == 0 );\r
+\r
+       /* wait for data received */\r
+       if( SSR05_ORE )                 /* overrun error */\r
+       {\r
+               ch = RDR05;                     /* reset error flags */\r
+               return ( char ) ( -1 );\r
+       }\r
+       else\r
+       {\r
+               return( RDR05 );        /* return char */\r
+       }\r
 }\r
 \r
-void Puts5(const char *Name5)  /* Puts a String to UART */\r
+void Puts5( const char *Name5 ) /* Puts a String to UART */\r
 {\r
-  volatile portSHORT i,len;\r
-  len = strlen(Name5);\r
-       \r
-  for (i=0; i<strlen(Name5); i++)   /* go through string                                        */\r
-  {\r
-       if (Name5[i] == 10)\r
-         Putch5(13);\r
-       Putch5(Name5[i]);                         /* send it out                                                   */\r
-  }\r
+       volatile portSHORT      i, len;\r
+       len = strlen( Name5 );\r
+\r
+       for( i = 0; i < strlen(Name5); i++ )    /* go through string */\r
+       {\r
+               if( Name5[i] == 10 )\r
+               {\r
+                       Putch5( 13 );\r
+               }\r
+\r
+               Putch5( Name5[i] );                                     /* send it out */\r
+       }\r
 }\r
 \r
-void Puthex5(unsigned long n, unsigned char digits)\r
+void Puthex5( unsigned long n, unsigned char digits )\r
 {\r
-   unsigned portCHAR digit=0,div=0,i;\r
-\r
-   div=(4*(digits-1)); /* init shift divisor */\r
-   for (i=0;i<digits;i++)\r
-   {\r
-        digit = ((n >> div)&0xF); /* get hex-digit value */\r
-        Putch5(digit + ((digit < 0xA) ? '0' : 'A' - 0xA));\r
-        div-=4;                        /* next digit shift */\r
-   }\r
+       unsigned portCHAR       digit = 0, div = 0, i;\r
+\r
+       div = ( 4 * (digits - 1) );                             /* init shift divisor */\r
+       for( i = 0; i < digits; i++ )\r
+       {\r
+               digit = ( (n >> div) & 0xF );           /* get hex-digit value */\r
+               Putch5( digit + ((digit < 0xA) ? '0' : 'A' - 0xA) );\r
+               div -= 4;               /* next digit shift */\r
+       }\r
 }\r
 \r
-void Putdec5(unsigned long x, int digits)\r
+void Putdec5( unsigned long x, int digits )\r
 {\r
-       portSHORT i;\r
-       portCHAR buf[10],sign=1;\r
-       \r
-       if (digits < 0) {        /* should be print of zero? */\r
-         digits *= (-1);\r
-         sign =1;\r
-       }  \r
-       buf[digits]='\0';                       /* end sign of string */\r
-       \r
-       for (i=digits; i>0; i--) {\r
-               buf[i-1] = ASCII[x % 10];\r
-               x = x/10;\r
+       portSHORT       i;\r
+       portCHAR        buf[10], sign = 1;\r
+\r
+       if( digits < 0 )\r
+       {                                       /* should be print of zero? */\r
+               digits *= ( -1 );\r
+               sign = 1;\r
        }\r
 \r
-       if ( sign )\r
+       buf[digits] = '\0'; /* end sign of string */\r
+\r
+       for( i = digits; i > 0; i-- )\r
        {\r
-         for (i=0; buf[i]=='0'; i++) { /* no print of zero */\r
-               if ( i<digits-1)\r
-                       buf[i] = ' ';\r
-         }             \r
+               buf[i - 1] = ASCII[x % 10];\r
+               x = x / 10;\r
        }\r
-       \r
-       Puts5(buf);                                     /* send string */\r
+\r
+       if( sign )\r
+       {\r
+               for( i = 0; buf[i] == '0'; i++ )\r
+               {                               /* no print of zero */\r
+                       if( i < digits - 1 )\r
+                       {\r
+                               buf[i] = ' ';\r
+                       }\r
+               }\r
+       }\r
+\r
+       Puts5( buf );           /* send string */\r
 }\r
 \r
 void vUtilityStartTraceTask( unsigned portBASE_TYPE uxPriority )\r
 {\r
        portENTER_CRITICAL();\r
-       InitUart5();\r
+       vInitUart5();\r
        portENTER_CRITICAL();\r
-       xTaskCreate( vUART5Task , ( signed portCHAR * ) "UART4",  ( unsigned portSHORT ) 2048, ( void * ) NULL, uxPriority, &UART_TaskHandle );\r
+\r
+       vSemaphoreCreateBinary( xSemaphore );\r
+\r
+       if( xSemaphore != NULL )\r
+       {\r
+               xTaskCreate( vUART5Task, (signed portCHAR *) "UART4", ( unsigned portSHORT ) 2048, ( void * ) NULL, uxPriority, NULL );\r
+       }\r
 }\r
 \r
 static void vUART5Task( void *pvParameters )\r
 {\r
-       portCHAR tasklist_buff[512], trace_buff[512];\r
-       unsigned portLONG trace_len, j;\r
-       \r
-       unsigned portCHAR ch;   \r
-       \r
-       Puts5("\n -------------MB91467D FreeRTOS DEMO Task List and Trace Utility----------- \n");\r
-\r
-       for(;;)\r
+       portCHAR                        tasklist_buff[512], trace_buff[512];\r
+       unsigned portLONG       trace_len, j;\r
+\r
+       unsigned portCHAR       ch;\r
+\r
+       Puts5( "\n -------------MB91467D FreeRTOS DEMO Task List and Trace Utility----------- \n" );\r
+\r
+       for( ;; )\r
        {\r
-               Puts5("\n\rPress any of the following keys for the corresponding functionality: ");\r
+               Puts5( "\n\rPress any of the following keys for the corresponding functionality: " );\r
 \r
-               Puts5("\n\r1: To call vTaskList() and display current task status ");\r
+               Puts5( "\n\r1: To call vTaskList() and display current task status " );\r
 \r
-               Puts5("\n\r2: To call vTaskStartTrace() and to display trace results once the trace ends");\r
+               Puts5( "\n\r2: To call vTaskStartTrace() and to display trace results once the trace ends" );\r
 \r
-               SSR05_RIE=1;\r
+               SSR05_RIE = 1;\r
 \r
-               vTaskSuspend(NULL);\r
+               /* Block on the semaphore.  The UART interrupt will use the semaphore to\r
+               wake this task when required. */\r
+               xSemaphoreTake( xSemaphore, portMAX_DELAY );\r
 \r
-               ch=Getch5();\r
+               ch = Getch5();\r
 \r
-               switch ( ch ) \r
+               switch( ch )\r
                {\r
                        case '1':\r
-                               vTaskList( ( signed char * ) tasklist_buff );\r
-                               Puts5("\n\rThe current task list is as follows....");\r
-                               Puts5("\n\r----------------------------------------------");\r
-                               Puts5("\n\rName           State  Priority  Stack   Number");\r
-                               Puts5("\n\r----------------------------------------------");\r
-                               Puts5(tasklist_buff);\r
-                               Puts5("\r----------------------------------------------");\r
+                               vTaskList( (signed char *) tasklist_buff );\r
+                               Puts5( "\n\rThe current task list is as follows...." );\r
+                               Puts5( "\n\r----------------------------------------------" );\r
+                               Puts5( "\n\rName                  State  Priority  Stack   Number" );\r
+                               Puts5( "\n\r----------------------------------------------" );\r
+                               Puts5( tasklist_buff );\r
+                               Puts5( "\r----------------------------------------------" );\r
                                break;\r
 \r
                        case '2':\r
-                               vTaskStartTrace(( signed char * ) trace_buff, 512);\r
-                               Puts5("\n\rThe trace started!!");\r
-                               vTaskDelay( ( portTickType ) 450);\r
+                               vTaskStartTrace( (signed char *) trace_buff, 512 );\r
+                               Puts5( "\n\rThe trace started!!" );\r
+                               vTaskDelay( (portTickType) 450 );\r
                                trace_len = ulTaskEndTrace();\r
-                               Puts5("\n\rThe trace ended!!");\r
-                               Puts5("\n\rThe trace is as follows....");\r
-                               Puts5("\n\r--------------------------------------------------------");\r
-                               Puts5("\n\r  Tick        | Task Number  |        Tick    | Task Number  |");\r
-                               Puts5("\n\r--------------------------------------------------------\n\r");\r
-                               for( j = 0 ; j < trace_len ; j++ )\r
+                               Puts5( "\n\rThe trace ended!!" );\r
+                               Puts5( "\n\rThe trace is as follows...." );\r
+                               Puts5( "\n\r--------------------------------------------------------" );\r
+                               Puts5( "\n\r  Tick       | Task Number  |        Tick    | Task Number  |" );\r
+                               Puts5( "\n\r--------------------------------------------------------\n\r" );\r
+                               for( j = 0; j < trace_len; j++ )\r
                                {\r
-                                       Puthex5(trace_buff[j],2);\r
-                                       if(j%4==3) Puts5("   |   ");\r
-                                       if(j%16==15) Puts5("\n");\r
+                                       Puthex5( trace_buff[j], 2 );\r
+                                       if( j % 4 == 3 )\r
+                                       {\r
+                                               Puts5( "   |   " );\r
+                                       }\r
+\r
+                                       if( j % 16 == 15 )\r
+                                       {\r
+                                               Puts5( "\n" );\r
+                                       }\r
                                }\r
-                               Puts5("\r--------------------------------------------------------");\r
+\r
+                               Puts5( "\r--------------------------------------------------------" );\r
                                break;\r
-                               \r
+\r
                        default:\r
                                break;\r
                }\r
-               Puts5("\n");\r
+\r
+               Puts5( "\n" );\r
        }\r
 }\r
 \r
-__interrupt void UART5_RxISR ( void )\r
+__interrupt void UART5_RxISR( void )\r
 {\r
-       SSR05_RIE=0;\r
-       vTaskResume( UART_TaskHandle );\r
+       SSR05_RIE = 0;\r
+       xSemaphoreGiveFromISR( xSemaphore, pdFALSE );\r
 }\r
index 21fa3682aa3715992f03ff92d553c6677f67b421..c99e1490b6cd42ff6c09a3db32d0860e5d276c14 100644 (file)
@@ -49,7 +49,7 @@ void InitIrqLevels(void)
                                        /* External Interrupt 13        */\r
        ICR07 = 31;             /* External Interrupt 14        */\r
                                        /* External Interrupt 15        */\r
-       ICR08 = 23;             /* Reload Timer 0                       */\r
+       ICR08 = 30;             /* Reload Timer 0                       */\r
                                        /* Reload Timer 1                       */\r
        ICR09 = 31;             /* Reload Timer 2                       */\r
                                        /* Reload Timer 3                       */\r
@@ -75,17 +75,17 @@ void InitIrqLevels(void)
                                        /* USART (LIN) 0 TX                     */\r
        ICR20 = 31;             /* USART (LIN) 1 RX                     */\r
                                        /* USART (LIN) 1 TX                     */\r
-       ICR21 = 21;             /* USART (LIN) 2 RX                     */\r
+       ICR21 = 30;             /* USART (LIN) 2 RX                     */\r
                                        /* USART (LIN) 2 TX                     */\r
        ICR22 = 31;             /* USART (LIN) 3 RX                     */\r
                                        /* USART (LIN) 3 TX                     */\r
-       ICR23 = 23;             /* System Reserved                      */\r
+       ICR23 = 30;             /* System Reserved                      */\r
                                        /* Delayed Interrupt            */\r
        ICR24 = 31;             /* System Reserved                      */\r
                                        /* System Reserved                      */\r
        ICR25 = 31;             /* USART (LIN, FIFO) 4 RX       */\r
                                        /* USART (LIN, FIFO) 4 TX       */\r
-       ICR26 = 21;             /* USART (LIN, FIFO) 5 RX       */\r
+       ICR26 = 30;             /* USART (LIN, FIFO) 5 RX       */\r
                                        /* USART (LIN, FIFO) 5 TX       */\r
        ICR27 = 31;             /* USART (LIN, FIFO) 6 RX       */\r
                                        /* USART (LIN, FIFO) 6 TX       */\r
index 79c4e50c7122226b788a76d034ebfbfbc5bd9512..9af36c8afbcebd4fff5274cd17e8fcdd335c6f2b 100644 (file)
@@ -30,7 +30,7 @@ AssemblyState=0
 AssemblyFGColor=0 0 255\r
 CommandSize=132 138 958 562\r
 CommandState=0\r
-Assembly Address=H'00044F1C\r
+Assembly Address=H'00042412\r
 Memory Address=H'0002F038\r
 Memory Mode=H'00000003\r
 Memory Ascii=H'00000001\r
@@ -132,7 +132,7 @@ WatchState=0
 Source2Name=SRC\main.c\r
 Source2Size=66 69 1074 448\r
 Source2State=0\r
-Source2Line=7C\r
+Source2Line=124\r
 Source2Mode=2\r
 Source3Name=SRC\watchdog\watchdog.c\r
 Source3Size=44 46 998 421\r
@@ -148,6 +148,12 @@ Source4Size=198 207 1086 679
 Source4State=0\r
 Source4Line=913\r
 Source4Mode=2\r
+Layer11=2000,SRC\vectors.c\r
+Source5Name=SRC\vectors.c\r
+Source5Size=22 23 859 518\r
+Source5State=2\r
+Source5Line=49\r
+Source5Mode=2\r
 [Path Environment]\r
 Flag=Enable\r
 Source=\r