From 153f078ec20cc442dd4dbe802dbd5fcb1748fcca Mon Sep 17 00:00:00 2001 From: XaviDCR92 Date: Thu, 27 Jul 2017 07:41:25 +0200 Subject: * Added comments on System. * Files needed for Game are now only loaded once, except from LEVEL1.PLT. * Added DevMenu to get debug info. * ISR_LoadMenuVBlank() does not stop when accessing SIO. * On fopen() and SERIAL_INTERFACE defined, "#" is prepended and "@" is appended to filename string. --- Source/Serial.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Source/Serial.c') diff --git a/Source/Serial.c b/Source/Serial.c index 714581d..c7b085a 100644 --- a/Source/Serial.c +++ b/Source/Serial.c @@ -30,6 +30,7 @@ typedef enum * *************************************/ static volatile SERIAL_STATE SerialState; +static volatile bool serial_busy; /* ************************************* * Local Prototypes @@ -62,6 +63,7 @@ bool SerialRead(uint8_t* ptrArray, size_t nBytes) bool SerialWrite(void* ptrArray, size_t nBytes) { + serial_busy = true; if(nBytes == 0) { @@ -79,9 +81,16 @@ bool SerialWrite(void* ptrArray, size_t nBytes) }while(--nBytes); + serial_busy = false; + return true; } +volatile bool SerialIsBusy(void) +{ + return serial_busy; +} + #ifdef SERIAL_INTERFACE void Serial_printf(const char* str, ...) { -- cgit v1.2.3