aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-05 21:32:07 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-05 21:32:07 +0200
commitce53fa9f958f0160eeb91a9282e66cb2c59827a8 (patch)
treea738353c251c0305633aea96fbdd7b74276a67c5
parent310c2837836d24e1335eafed4fda2701570c1760 (diff)
downloadglutte-o-matic-ce53fa9f958f0160eeb91a9282e66cb2c59827a8.tar.gz
glutte-o-matic-ce53fa9f958f0160eeb91a9282e66cb2c59827a8.tar.bz2
glutte-o-matic-ce53fa9f958f0160eeb91a9282e66cb2c59827a8.zip
Make objects for common/ leds temperature
-rw-r--r--src/common/includes/GPIO/temperature.h8
-rw-r--r--src/common/sourcelist.txt1
-rw-r--r--src/common/src/GPIO/leds.c1
-rw-r--r--src/common/src/GPIO/temperature.c2
-rw-r--r--src/glutt-o-logique/leds.c2
-rw-r--r--src/glutt-o-logique/temperature.c6
-rw-r--r--src/simulator/src/GPIO/leds.c2
-rw-r--r--src/simulator/src/GPIO/temperature.c6
8 files changed, 15 insertions, 13 deletions
diff --git a/src/common/includes/GPIO/temperature.h b/src/common/includes/GPIO/temperature.h
index a054fab..a67d16b 100644
--- a/src/common/includes/GPIO/temperature.h
+++ b/src/common/includes/GPIO/temperature.h
@@ -22,11 +22,11 @@
* SOFTWARE.
*/
+#pragma once
#include <stdint.h>
-#ifndef __TEMPERATURE_H
-#define __TEMPERATURE_H
-
+extern float _temperature_last_value;
+extern int _temperature_valid;
// Setup communication and temperature
void temperature_init();
@@ -37,5 +37,3 @@ int temperature_valid();
// Get current temperature
float temperature_get();
-#endif // __TEMPERATURE_H
-
diff --git a/src/common/sourcelist.txt b/src/common/sourcelist.txt
index 350c037..0abc086 100644
--- a/src/common/sourcelist.txt
+++ b/src/common/sourcelist.txt
@@ -1,4 +1,5 @@
src/GPIO/usart.c
+src/GPIO/temperature.c
src/GPS/gps.c
src/GPS/minmea.c
src/Core/common.c
diff --git a/src/common/src/GPIO/leds.c b/src/common/src/GPIO/leds.c
deleted file mode 100644
index df2adea..0000000
--- a/src/common/src/GPIO/leds.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../common/includes/GPIO/leds.h"
diff --git a/src/common/src/GPIO/temperature.c b/src/common/src/GPIO/temperature.c
index 21cb9f8..f9e43cb 100644
--- a/src/common/src/GPIO/temperature.c
+++ b/src/common/src/GPIO/temperature.c
@@ -33,7 +33,7 @@ float _temperature_last_value;
int _temperature_valid;
-static void temperature_task(void *pvParameters);
+void temperature_task(void *pvParameters);
void temperature_init() {
diff --git a/src/glutt-o-logique/leds.c b/src/glutt-o-logique/leds.c
index 15c175c..0169553 100644
--- a/src/glutt-o-logique/leds.c
+++ b/src/glutt-o-logique/leds.c
@@ -22,7 +22,7 @@
* SOFTWARE.
*/
-#include "../common/src/GPIO/leds.c"
+#include "GPIO/leds.h"
#include "stm32f4xx_conf.h"
diff --git a/src/glutt-o-logique/temperature.c b/src/glutt-o-logique/temperature.c
index db3f46a..b9f7d87 100644
--- a/src/glutt-o-logique/temperature.c
+++ b/src/glutt-o-logique/temperature.c
@@ -33,7 +33,9 @@
#include "Core/delay.h"
-#include "../common/src/GPIO/temperature.c"
+#include "FreeRTOS.h"
+#include "task.h"
+#include "GPIO/temperature.h"
const TickType_t _temperature_delay = 60000 / portTICK_PERIOD_MS; // 60s
@@ -95,7 +97,7 @@ int ds18b20_gettemp(float *temperature) {
return status;
}
-static void temperature_task(void *pvParameters) {
+void temperature_task(void *pvParameters) {
while (1) {
diff --git a/src/simulator/src/GPIO/leds.c b/src/simulator/src/GPIO/leds.c
index 874cc19..0bc5300 100644
--- a/src/simulator/src/GPIO/leds.c
+++ b/src/simulator/src/GPIO/leds.c
@@ -1,4 +1,4 @@
-#include "../../../common/src/GPIO/leds.c"
+#include "GPIO/leds.h"
extern char led_blue;
diff --git a/src/simulator/src/GPIO/temperature.c b/src/simulator/src/GPIO/temperature.c
index 6befb2a..7c343be 100644
--- a/src/simulator/src/GPIO/temperature.c
+++ b/src/simulator/src/GPIO/temperature.c
@@ -1,9 +1,11 @@
-#include "../../../common/src/GPIO/temperature.c"
+#include "GPIO/temperature.h"
+#include "FreeRTOS.h"
+#include "task.h"
extern int gui_temperature_valid;
extern float gui_temperature;
-static void temperature_task(void *pvParameters) {
+void temperature_task(void *pvParameters) {
while (1) {