summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichardBarry <RichardBarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2009-03-14 15:07:06 +0000
committerRichardBarry <RichardBarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2009-03-14 15:07:06 +0000
commit39109af1e74e4df2203e477116c595678c5df2c4 (patch)
treede80222785cd55c3e294734fbce52ef42cbb7ee2
parent453269c2ff1d8dd889eacebd15f9f676926e971f (diff)
downloadfreertos-39109af1e74e4df2203e477116c595678c5df2c4.tar.gz
freertos-39109af1e74e4df2203e477116c595678c5df2c4.tar.bz2
freertos-39109af1e74e4df2203e477116c595678c5df2c4.tar.xz
Changed the use of critical sections to instead use scheduler locking as the BIOS functions exit with interrupts enabled no matter what the state when the BIOS function was called.
git-svn-id: https://freertos.svn.sourceforge.net/svnroot/freertos/trunk@708 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
-rw-r--r--Demo/PC/FileIO/fileIO.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Demo/PC/FileIO/fileIO.c b/Demo/PC/FileIO/fileIO.c
index 62e23d34..b83aaebc 100644
--- a/Demo/PC/FileIO/fileIO.c
+++ b/Demo/PC/FileIO/fileIO.c
@@ -62,10 +62,12 @@
void vDisplayMessage( const portCHAR * const pcMessageToPrint )
{
- taskENTER_CRITICAL();
+ vTaskSuspendAll();
+ {
printf( "%s", pcMessageToPrint );
fflush( stdout );
- taskEXIT_CRITICAL();
+ }
+ xTaskResumeAll();
}
/*-----------------------------------------------------------*/
@@ -75,7 +77,7 @@ const portCHAR * const pcFileName = "a:\\RTOSlog.txt";
const portCHAR * const pcSeparator = "\r\n-----------------------\r\n";
FILE *pf;
- taskENTER_CRITICAL();
+ vTaskSuspendAll();
{
pf = fopen( pcFileName, "a" );
if( pf != NULL )
@@ -85,7 +87,7 @@ FILE *pf;
fclose( pf );
}
}
- taskEXIT_CRITICAL();
+ xTaskResumeAll();
}
/*-----------------------------------------------------------*/
@@ -94,7 +96,7 @@ void vWriteBufferToDisk( const portCHAR * const pcBuffer, unsigned portLONG ulBu
const portCHAR * const pcFileName = "a:\\trace.bin";
FILE *pf;
- taskENTER_CRITICAL();
+ vTaskSuspendAll();
{
pf = fopen( pcFileName, "wb" );
if( pf )
@@ -103,6 +105,6 @@ FILE *pf;
fclose( pf );
}
}
- taskEXIT_CRITICAL();
+ xTaskResumeAll();
}