aboutsummaryrefslogtreecommitdiffstats
path: root/src/simulator
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-05 21:21:28 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-05 21:21:28 +0200
commit310c2837836d24e1335eafed4fda2701570c1760 (patch)
tree5dec2822850656080ff0dcf89d2772a057e56c8c /src/simulator
parent8618657695b2530f463d1e7e0fca11304d2b897e (diff)
downloadglutte-o-matic-310c2837836d24e1335eafed4fda2701570c1760.tar.gz
glutte-o-matic-310c2837836d24e1335eafed4fda2701570c1760.tar.bz2
glutte-o-matic-310c2837836d24e1335eafed4fda2701570c1760.zip
Create objects for common/ fsm main minmea
Diffstat (limited to 'src/simulator')
-rw-r--r--src/simulator/src/Core/fsm.c40
-rw-r--r--src/simulator/src/Core/main.c12
-rw-r--r--src/simulator/src/GPS/minema.c1
-rw-r--r--src/simulator/src/Gui/gui.c4
4 files changed, 43 insertions, 14 deletions
diff --git a/src/simulator/src/Core/fsm.c b/src/simulator/src/Core/fsm.c
index 4c52525..8c761fd 100644
--- a/src/simulator/src/Core/fsm.c
+++ b/src/simulator/src/Core/fsm.c
@@ -1,11 +1,35 @@
-#include "../../../common/src/Core/fsm.c"
-
-
-extern char * gui_last_fsm_states[];
-extern int * gui_last_fsm_states_timestamps[];
-
-
-void fsm_state_switched(char * new_state) {
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+*/
+
+#include "Core/fsm.h"
+#include "GPIO/usart.h"
+#include <time.h>
+
+extern const char * gui_last_fsm_states[];
+extern int gui_last_fsm_states_timestamps[];
+
+void fsm_state_switched(const char *new_state) {
usart_debug_puts_header("FSM: ", new_state);
for (int i = 8; i >= 0; i--) {
diff --git a/src/simulator/src/Core/main.c b/src/simulator/src/Core/main.c
index 911191b..faf7fd7 100644
--- a/src/simulator/src/Core/main.c
+++ b/src/simulator/src/Core/main.c
@@ -22,10 +22,16 @@
* SOFTWARE.
*/
-#include "../../../common/src/Core/main.c"
-
#include <pthread.h>
-
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Kernel includes. */
+#include "FreeRTOS.h"
+#include "task.h"
+#include "timers.h"
+#include "semphr.h"
static void thread_gui(void *arg) {
main_gui();
diff --git a/src/simulator/src/GPS/minema.c b/src/simulator/src/GPS/minema.c
deleted file mode 100644
index 10df198..0000000
--- a/src/simulator/src/GPS/minema.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../common/src/GPS/minmea.c"
diff --git a/src/simulator/src/Gui/gui.c b/src/simulator/src/Gui/gui.c
index 42376ed..713b18a 100644
--- a/src/simulator/src/Gui/gui.c
+++ b/src/simulator/src/Gui/gui.c
@@ -132,8 +132,8 @@ int in_u = 0;
int in_d = 0;
int in_fax_n = 1;
-char * gui_last_fsm_states[] = {"", "", "", "", "", "", "", "", "", ""};
-int * gui_last_fsm_states_timestamps[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+const char * gui_last_fsm_states[] = {"", "", "", "", "", "", "", "", "", ""};
+int gui_last_fsm_states_timestamps[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int auto_scroll_uart = 1;