]> git.sur5r.net Git - freertos/commitdiff
Changed the use of critical sections to instead use scheduler locking as the BIOS...
authorRichardBarry <RichardBarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 14 Mar 2009 15:07:06 +0000 (15:07 +0000)
committerRichardBarry <RichardBarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 14 Mar 2009 15:07:06 +0000 (15:07 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@708 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/PC/FileIO/fileIO.c

index 62e23d346ea55deb665982d7b54b585b03af5de1..b83aaebc487808f434852ac140d1ef472ad2fe7f 100644 (file)
 \r
 void vDisplayMessage( const portCHAR * const pcMessageToPrint )\r
 {\r
-       taskENTER_CRITICAL();\r
+       vTaskSuspendAll();\r
+       {\r
                printf( "%s", pcMessageToPrint );\r
                fflush( stdout );\r
-       taskEXIT_CRITICAL();\r
+       }\r
+       xTaskResumeAll();\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -75,7 +77,7 @@ const portCHAR * const pcFileName = "a:\\RTOSlog.txt";
 const portCHAR * const pcSeparator = "\r\n-----------------------\r\n";\r
 FILE *pf;\r
 \r
-       taskENTER_CRITICAL();\r
+       vTaskSuspendAll();\r
        {       \r
                pf = fopen( pcFileName, "a" );\r
                if( pf != NULL )\r
@@ -85,7 +87,7 @@ FILE *pf;
                        fclose( pf );\r
                }\r
        }\r
-       taskEXIT_CRITICAL();\r
+       xTaskResumeAll();\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -94,7 +96,7 @@ void vWriteBufferToDisk( const portCHAR * const pcBuffer, unsigned portLONG ulBu
 const portCHAR * const pcFileName = "a:\\trace.bin";\r
 FILE *pf;\r
 \r
-       taskENTER_CRITICAL();\r
+       vTaskSuspendAll();\r
        {\r
                pf = fopen( pcFileName, "wb" );\r
                if( pf )\r
@@ -103,6 +105,6 @@ FILE *pf;
                        fclose( pf );\r
                }\r
        }\r
-       taskEXIT_CRITICAL();\r
+       xTaskResumeAll();\r
 }\r
 \r