Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Firmware/OpenLog_Artemis/OpenLog_Artemis.ino
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ const int FIRMWARE_VERSION_MINOR = 3;

//#define noPowerLossProtection // Uncomment this line to disable the sleep-on-power-loss functionality

#include "Sensors.h"

#include "settings.h"

//Define the pin functions
Expand Down Expand Up @@ -545,7 +547,13 @@ void setup() {
else
SerialPrintln(F("No Qwiic devices detected"));

if (settings.showHelperText == true) printHelperText(false); //printHelperText to terminal and sensor file
// KDB add
// If we are streaming to Serial, start the stream with a Mime Type marker, followed by CR
SerialPrintln(F("Content-Type: text/csv"));
SerialPrintln("");

if (settings.showHelperText == true)
printHelperText(OL_OUTPUT_SERIAL | OL_OUTPUT_SDCARD); //printHelperText to terminal and sensor file

//If we are sleeping between readings then we cannot rely on millis() as it is powered down
//Use RTC instead
Expand Down Expand Up @@ -705,7 +713,7 @@ void loop() {
}
#endif

getData(); //Query all enabled sensors for data
getData(outputData, sizeof(outputData)); //Query all enabled sensors for data

//Print to terminal
if (settings.enableTerminalOutput == true)
Expand Down Expand Up @@ -750,7 +758,8 @@ void loop() {
sensorDataFile.close();
strcpy(sensorDataFileName, findNextAvailableLog(settings.nextDataLogNumber, "dataLog"));
beginDataLogging(); //180ms
if (settings.showHelperText == true) printHelperText(false); //printHelperText to terminal and sensor file
if (settings.showHelperText == true)
printHelperText(OL_OUTPUT_SDCARD); //printHelperText to the sensor file
}
if (online.serialLogging == true)
{
Expand Down
12 changes: 12 additions & 0 deletions Firmware/OpenLog_Artemis/Sensors.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@


#pragma once

// Flags for output destinations

#define OL_OUTPUT_SERIAL 0x1
#define OL_OUTPUT_SDCARD 0x2

void printHelperText(uint8_t);
void getData(char *buffer, size_t lenBuffer);

Loading