software/ampel-firmware/csv_writer.h

35 lines
780 B
C
Raw Normal View History

2021-05-09 18:45:59 +00:00
#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"
#include "util.h"
#include "led_effects.h"
2021-11-15 12:45:36 +00:00
#include "sensor_console.h"
2021-05-09 18:45:59 +00:00
namespace config {
extern uint16_t csv_interval; // [s]
}
namespace csv_writer {
2021-11-15 12:45:36 +00:00
extern char last_successful_write[];
void initialize(const char *sensorId);
void logIfTimeHasCome(const char *timestamp, const int16_t &co2, const float &temperature, const float &humidity);
2021-05-09 18:45:59 +00:00
int getAvailableSpace();
2021-11-15 12:45:36 +00:00
extern char filename[];
void setCSVinterval(int32_t csv_interval);
void showCSVContent();
void formatFilesystem();
2021-05-09 18:45:59 +00:00
}
#endif