aboutsummaryrefslogtreecommitdiff
path: root/Source/System.c
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2017-06-06 06:52:46 +0200
committerXaviDCR92 <xavi.dcr@gmail.com>2017-06-06 06:52:46 +0200
commit1244505327009142c80140e44c86138f4fd6ae07 (patch)
treed11878572385583e5e2fd3d05ae3349dd46d45e6 /Source/System.c
parentc43347edb7d422b902360a44a7bd0b0a20f941f2 (diff)
downloadairport-1244505327009142c80140e44c86138f4fd6ae07.tar.gz
* Implemented aircraft collision. But it would not detect collision in some cases.
* Remove unneeded whitespace character on pointer variables (unary operators should not have any whitespaces). * SelectedAircraft index now increases or decreases automatically on aircraft added/removed. * Started writing Plt generation routines. Still a lot of work TODO.
Diffstat (limited to 'Source/System.c')
-rw-r--r--Source/System.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/Source/System.c b/Source/System.c
index 48533c1..6645682 100644
--- a/Source/System.c
+++ b/Source/System.c
@@ -346,7 +346,7 @@ void SystemCheckTimer(bool* timer, uint64_t* last_timer, uint8_t step)
/* ****************************************************************************************
*
- * @name bool SystemLoadFileToBuffer(char * fname, uint8_t* buffer, uint32_t szBuffer)
+ * @name bool SystemLoadFileToBuffer(char* fname, uint8_t* buffer, uint32_t szBuffer)
*
* @author: Xavier Del Campo
*
@@ -357,7 +357,7 @@ void SystemCheckTimer(bool* timer, uint64_t* last_timer, uint8_t step)
*
* ****************************************************************************************/
-bool SystemLoadFileToBuffer(char * fname, uint8_t* buffer, uint32_t szBuffer)
+bool SystemLoadFileToBuffer(char* fname, uint8_t* buffer, uint32_t szBuffer)
{
FILE *f;
int32_t size;
@@ -414,7 +414,7 @@ bool SystemLoadFileToBuffer(char * fname, uint8_t* buffer, uint32_t szBuffer)
/* ****************************************************************************************
*
- * @name bool SystemLoadFile(char *fname)
+ * @name bool SystemLoadFile(char*fname)
*
* @author: Xavier Del Campo
*
@@ -424,7 +424,7 @@ bool SystemLoadFileToBuffer(char * fname, uint8_t* buffer, uint32_t szBuffer)
*
* ****************************************************************************************/
-bool SystemLoadFile(char *fname)
+bool SystemLoadFile(char*fname)
{
return SystemLoadFileToBuffer(fname,file_buffer,sizeof(file_buffer));
}
@@ -446,6 +446,21 @@ uint8_t* SystemGetBufferAddress(void)
/* ******************************************************************
*
+ * @name void SystemClearBuffer(void)
+ *
+ * @author: Xavier Del Campo
+ *
+ * @return: Fills internal buffer with zeros
+ *
+ * *****************************************************************/
+
+void SystemClearBuffer(void)
+{
+ memset(file_buffer, 0, sizeof(file_buffer));
+}
+
+/* ******************************************************************
+ *
* @name void SystemWaitCycles(uint32_t cycles)
*
* @author: Xavier Del Campo
@@ -788,7 +803,7 @@ void SystemSetStackPattern(void)
*ptrStack = END_STACK_PATTERN;
}
-int32_t SystemIndexOfStringArray(char * str, char ** array)
+int32_t SystemIndexOfStringArray(char* str, char** array)
{
int32_t i;