Jamie Satchell
/
SOFT253_Weather_Sensor_JSatchell
MAIN
Fork of SOFT253_Template_Weather_OS_54 by
Diff: log.cpp
- Revision:
- 37:13f74964a045
- Parent:
- 36:af6abc6f7590
--- a/log.cpp Mon May 15 08:58:08 2017 +0000 +++ b/log.cpp Mon May 15 11:38:07 2017 +0000 @@ -1,5 +1,5 @@ #include "Data.hpp" - +/* log holds all functions for storing records in circular buffer*/ Data queue_array[120]; int rear = 0; int front = 0; @@ -11,6 +11,7 @@ } +/*pushes new record on front of queue*/ void log_push(Data data) { rear = (rear + 1) % 120; @@ -22,6 +23,7 @@ queue_array[rear] = data; } +/*deletes a record*/ Data log_pop() { Data record; @@ -33,6 +35,7 @@ } +/*gets length of array*/ int log_length() { @@ -43,6 +46,7 @@ } +/*gets a specific record*/ Data log_get(int index) {