csv_writer.h 642 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef CSV_WRITER_H_
#define CSV_WRITER_H_

#if defined(ESP8266)
#  include <LittleFS.h>
#  define FS_LIB LittleFS
#elif defined(ESP32)
#  include <SPIFFS.h>
#  define FS_LIB SPIFFS
#else
#  error Board should be either ESP8266 or ESP832
#endif

#include "config.h"
Eric Duminil's avatar
Eric Duminil committed
15
16
17
#include "util.h"
#include "led_effects.h"

18
namespace config {
Eric Duminil's avatar
Eric Duminil committed
19
  extern uint16_t csv_interval; // [s]
20
21
22
23
}
namespace csv_writer {
  extern String last_successful_write;
  void initialize();
Eric Duminil's avatar
Eric Duminil committed
24
  void logIfTimeHasCome(const String &timeStamp, const int16_t &co2, const float &temperature, const float &humidity);
25
26
27
28
29
  int getAvailableSpace();
  extern const String filename;
}

#endif