Skip to content

Commit 90ec29e

Browse files
committed
Configuration in ConfigHelix.h
1 parent 7f85b73 commit 90ec29e

File tree

6 files changed

+60
-32
lines changed

6 files changed

+60
-32
lines changed

src/AACDecoderHelix.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
#include "CommonHelix.h"
44
#include "libhelix-aac/aacdec.h"
55

6-
#define AAC_MAX_OUTPUT_SIZE 1024 * 4 * 2
7-
#define AAC_MAX_FRAME_SIZE 2100
8-
#define AAC_MIN_FRAME_SIZE 1024
9-
106
namespace libhelix {
117

128
typedef void (*AACInfoCallback)(_AACFrameInfo &info, void *ref);

src/CommonHelix.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
#include "utils/Buffers.h"
2121
#include "utils/Vector.h"
2222
#include "utils/helix_log.h"
23-
24-
#define SYNCH_WORD_LEN 4
25-
#define HELIX_PCM_CORRECTED
26-
#define HELIX_CHUNK_SIZE 1024
23+
#include "ConfigHelix.h"
2724

2825
namespace libhelix {
2926

src/ConfigHelix.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#pragma once
2+
3+
// Common
4+
#ifndef SYNCH_WORD_LEN
5+
# define SYNCH_WORD_LEN 4
6+
#endif
7+
8+
#ifndef HELIX_CHUNK_SIZE
9+
# define HELIX_CHUNK_SIZE 1024
10+
#endif
11+
12+
// mp3
13+
#ifndef MP3_MAX_OUTPUT_SIZE
14+
# define MP3_MAX_OUTPUT_SIZE 1024 * 5
15+
#endif
16+
#ifndef MP3_MAX_FRAME_SIZE
17+
# define MP3_MAX_FRAME_SIZE 1024 * 2
18+
#endif
19+
#ifndef MP3_MIN_FRAME_SIZE
20+
# define MP3_MIN_FRAME_SIZE 1024
21+
#endif
22+
23+
// aac
24+
#ifndef AAC_MAX_OUTPUT_SIZE
25+
# define AAC_MAX_OUTPUT_SIZE 1024 * 4 * 2
26+
#endif
27+
#ifndef AAC_MAX_FRAME_SIZE
28+
# define AAC_MAX_FRAME_SIZE 2100
29+
#endif
30+
#ifndef AAC_MIN_FRAME_SIZE
31+
# define AAC_MIN_FRAME_SIZE 1024
32+
#endif
33+
34+
// Allocation:
35+
#define ALLOCATOR libhelix::AllocatorExt
36+
37+
// Logging: Activate/Deactivate logging
38+
#if ! defined(HELIX_LOGGING_ACTIVE) && defined(ARDUINO)
39+
# define HELIX_LOGGING_ACTIVE true
40+
#endif
41+
42+
#ifndef HELIX_LOG_LEVEL
43+
# define HELIX_LOG_LEVEL LogLevelHelix::Warning
44+
#endif
45+
46+
#ifndef LOG_METHOD
47+
# define LOG_METHOD __PRETTY_FUNCTION__
48+
#endif
49+
50+
#ifndef HELIX_LOGGING_OUT
51+
# define HELIX_LOGGING_OUT Serial
52+
#endif
53+
54+
#ifndef HELIX_LOG_SIZE
55+
# define HELIX_LOG_SIZE 256
56+
#endif

src/MP3DecoderHelix.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#include "libhelix-mp3/mp3common.h"
55
#include "libhelix-mp3/mp3dec.h"
66

7-
#define MP3_MAX_OUTPUT_SIZE 1024 * 5
8-
#define MP3_MAX_FRAME_SIZE 1024 * 2
9-
#define MP3_MIN_FRAME_SIZE 1024
107

118
namespace libhelix {
129

src/utils/helix_log.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
11
#pragma once
22
#include "stdio.h" // for snprintf
3+
#include "../ConfigHelix.h"
34

4-
// User Settings: Activate/Deactivate logging
5-
#if ! defined(HELIX_LOGGING_ACTIVE) && defined(ARDUINO)
6-
# define HELIX_LOGGING_ACTIVE true
7-
#endif
8-
9-
#ifndef HELIX_LOG_LEVEL
10-
# define HELIX_LOG_LEVEL LogLevelHelix::Warning
11-
#endif
12-
13-
#ifndef LOG_METHOD
14-
# define LOG_METHOD __PRETTY_FUNCTION__
15-
#endif
16-
17-
#ifndef HELIX_LOGGING_OUT
18-
# define HELIX_LOGGING_OUT Serial
19-
#endif
20-
21-
#ifndef HELIX_LOG_SIZE
22-
# define HELIX_LOG_SIZE 256
23-
#endif
245

256
#if defined(ARDUINO) && HELIX_LOGGING_ACTIVE
267
# include "Arduino.h" // for Serial; include Serial.h does not work

src/utils/helix_memory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#include "Allocator.h"
22
#include "helix_log.h"
3+
#include "ConfigHelix.h"
34

45
char log_buffer_helix[HELIX_LOG_SIZE];
5-
libhelix::AllocatorExt alloc;
6+
ALLOCATOR alloc;
67

78
#ifdef __cplusplus
89
extern "C" {

0 commit comments

Comments
 (0)