Skip to content

Commit c1033fe

Browse files
committed
Logger corrections
1 parent f27ec2a commit c1033fe

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ WARN_LOGFILE =
865865
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
866866
# Note: If this tag is empty the current directory is searched.
867867

868-
INPUT = README.md docs/ext src examples
868+
INPUT = README.md src examples docs/ext
869869

870870
# This tag can be used to specify the character encoding of the source files
871871
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

src/AudioConfig.h

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

7373
// Logging Configuration
7474
#define USE_LOGGING
75-
#define LOG_LEVEL AudioLogger::Info
75+
#define LOG_LEVEL AudioLogger::Warning
7676
#define LOG_STREAM Serial
7777

7878
// Logging Implementation

src/AudioMozzi.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
#include "mozzi_analog.h"
66
#include "MozziGuts.h"
77

8-
unsigned long total_tick_count = 0;
9-
10-
unsigned long audioTicks() {
11-
return total_tick_count;
12-
}
8+
extern uint64_t samples_written_to_buffer;
139

1410
namespace audio_tools {
1511

12+
1613
/**
1714
* @brief Support for https://sensorium.github.io/Mozzi/
1815
* Define your updateControl() method.
@@ -49,7 +46,7 @@ class MozziGenerator : public SoundGenerator<int16_t> {
4946
::updateControl();
5047
}
5148
int result = (int) ::updateAudio();
52-
total_tick_count++;
49+
samples_written_to_buffer++;
5350
return result;
5451
}
5552

src/AudioTools/AudioLogger.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,22 @@ class AudioLogger {
8787
char serial_printf_buffer[PRINTF_BUFFER_SIZE] = {0};
8888
int len = 0;
8989
va_list args;
90-
len+=log_stream_ptr->print(file);
91-
len+=log_stream_ptr->print(" ");
92-
len+=log_stream_ptr->print(line);
93-
len+=log_stream_ptr->print(": ");
9490

9591
if (this->active && log_stream_ptr!=nullptr && current_level >= log_level){
92+
93+
len+=log_stream_ptr->print(file);
94+
len+=log_stream_ptr->print(" ");
95+
len+=log_stream_ptr->print(line);
96+
len+=log_stream_ptr->print(": ");
97+
9698
char serial_printf_buffer[PRINTF_BUFFER_SIZE] = {0};
9799
va_start(args,fmt);
98100
len += vsnprintf(serial_printf_buffer,PRINTF_BUFFER_SIZE, fmt, args);
99101
log_stream_ptr->print(serial_printf_buffer);
100102
va_end(args);
103+
104+
len += log_stream_ptr->println();
101105
}
102-
len += log_stream_ptr->println();
103106
return len;
104107
}
105108

0 commit comments

Comments
 (0)