Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9587a97

Browse files
fix spiffs
1 parent f6df91f commit 9587a97

File tree

10 files changed

+41
-134
lines changed

10 files changed

+41
-134
lines changed

‎.idea/workspace.xml‎

Lines changed: 13 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/_src/EloquentBME280.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <Adafruit_BME280.h>
55
#include "EloquentSensor.h"
66
#include "EloquentReadsMultipleNumericValues.h"
7-
#include "../dev/serial_logging.h"
7+
#include "../dev/logging.h"
88

99
namespace Eloquent {
1010

‎src/data_structures/Array.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "../dev/serial_logging.h"
3+
#include "../dev/logging.h"
44

55
namespace Eloquent {
66

‎src/data_structures/Counter.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "../dev/serial_logging.h"
3+
#include "../dev/logging.h"
44

55

66
namespace Eloquent {

‎src/dev/deepSleep/attiny13.h‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎src/dev/serial_logging.h‎ renamed to ‎src/dev/logging.h‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616
#define LOG_SEVERITY_INFO 7
1717
#define LOG_SEVERITY_DEBUG 8
1818

19-
#ifndef LOG_OUTPUT
20-
#define LOG_OUTPUT Serial
21-
#endif
22-
2319
#ifndef LOG_SEVERITY
2420
#define LOG_SEVERITY LOG_SEVERITY_DEBUG
2521
#endif
2622

2723
#if defined(LOG_DISABLED)
2824
#define __log(severity, severity_string, msg)
2925
#else
26+
// if log is on, but no output set => default to Serial
27+
#ifndef LOG_OUTPUT
28+
#define LOG_OUTPUT Serial
29+
#endif
30+
3031
#define __log(severity, severity_string, msg) \
3132
if (severity <= LOG_SEVERITY) { \
3233
LOG_OUTPUT.print('('); \
@@ -37,7 +38,8 @@
3738
LOG_OUTPUT.print('['); \
3839
LOG_OUTPUT.print(severity_string); \
3940
LOG_OUTPUT.print("] "); \
40-
LOG_OUTPUT.println(msg); \
41+
LOG_OUTPUT.print(msg); \
42+
LOG_OUTPUT.print('\n'); \
4143
}
4244
#endif
4345

‎src/dev/print_utils.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#if defined(Stream_h)
44

5-
#include "black_magic.h"
5+
//#include "black_magic.h"
66

77
//#define serialprint(...) EVAL(MAP(Serial.print, __VA_ARGS__))
88

‎src/eDev.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
#include "dev/voltage.h"
22
#include "dev/print_utils.h"
3-
#include "dev/serial_logging.h"
4-
5-
//#include "dev/deepSleep/attiny13.h"
3+
#include "dev/logging.h"

‎src/io/Spiffs/Dir.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ namespace Eloquent {
99
*/
1010
class Dir {
1111
public:
12+
/**
13+
* Constructor
14+
* @param dirname
15+
*/
1216
Dir(String dirname) :
1317
_dirname(dirname) {
1418

‎src/io/Spiffs/File.h‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ namespace Eloquent {
1010
*/
1111
class SpiffsFile {
1212
public:
13+
/**
14+
* Constructor
15+
* @param filename
16+
*/
1317
SpiffsFile(String filename) :
1418
_filename(filename),
1519
_opened(false) {
@@ -25,7 +29,7 @@ namespace Eloquent {
2529
}
2630

2731
/**
28-
*
32+
* Open file
2933
* @param mode
3034
* @return
3135
*/
@@ -35,17 +39,18 @@ namespace Eloquent {
3539
}
3640

3741
/**
38-
*
42+
* Close file
3943
*/
4044
void close() {
41-
_opened = false;
42-
4345
if (_opened)
4446
_file.close();
47+
48+
_opened = false;
4549
}
4650

4751
/**
48-
* Dump content to stream
52+
* Dump content to stream.
53+
* Will close the file at the end
4954
* @param stream
5055
*/
5156
void cat(Stream *stream) {
@@ -59,7 +64,7 @@ namespace Eloquent {
5964
}
6065

6166
/**
62-
*
67+
* Delete file contents
6368
*/
6469
void wipe() {
6570
open("w");
@@ -108,14 +113,13 @@ namespace Eloquent {
108113
File _file;
109114

110115
/**
111-
*
116+
* Actual print
112117
* @tparam T
113118
*/
114119
template<typename T>
115120
SpiffsFile& print(T t) {
116121
if (_opened) {
117122
_file.print(t);
118-
_file.flush();
119123
}
120124

121125
return *this;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /