Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_IKS01A1-f255a2c75ecb mbed-rtos mbed
Diff: sensor.cpp
- Revision:
- 35:34bbca276f99
- Parent:
- 33:2ee6fbdad7b4
diff -r 2ee6fbdad7b4 -r 34bbca276f99 sensor.cpp
--- a/sensor.cpp Wed May 18 02:30:17 2016 +0000
+++ b/sensor.cpp Wed May 18 03:32:21 2016 +0000
@@ -6,49 +6,15 @@
// Queue
-Queue<log_data, QUEUESIZE> ExpansionBoard::queue;
-std::vector<log_data> ExpansionBoard::v;
+
+//std::vector<log_data> ExpansionBoard::v;
int * ExpansionBoard::n;
bool ExpansionBoard::flag;
-//This is the producer
-void ExpansionBoard::sampleData()
-{
- if(flag) printf("\nAbout to alloc\n");
- log_data *log_d;
-
- if (log_d == NULL) {
- queue.get();
- if(flag) printf("Out of memory, last sample deleted\n");
- log_data* log_d;
- if(flag) printf("Allocated after out of memory\n");
- }
-
-
- if(flag) printf("Not null, reading values\n");
- //Store read data in a sample
- float value;
- log_d->date = time(NULL);
- temp_sensor->GetTemperature(&value);
- log_d->tempCelsius = value;
- humidity_sensor->GetHumidity(&value);
- log_d->humidity = value;
- pressure_sensor->GetPressure(&value);
- log_d->pressure = value;
- if(flag) printf("All values STORED\n");
- //Send pointer to sample to the queue
- queue.put(log_d);
-
- //v.push_back(*log_d);
- printf("After vector");
-
-
-}
-
// This is the consumer
void ExpansionBoard::getData(const void*)
-{
+{/*
while(true) {
//Block on queue if no data is available
@@ -65,7 +31,7 @@
printf("GET value stored and freed up mail_box\n");
}
}
- }
+ }*/
}
