Skip to content

Commit a875f4e

Browse files
Merge pull request #17 from maxgerhardt/master
Refactor debug header and macro
2 parents b3d2356 + 9e8e2cd commit a875f4e

File tree

8 files changed

+77
-80
lines changed

8 files changed

+77
-80
lines changed

src/ReciterTabs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#define RECITERTABS_H
33

44
#include <pgmspace.h>
5-
#include "debug.h"
6-
#if debug
5+
#include "esp8266sam_debug.h"
6+
#if DEBUG_ESP8266SAM_LIB
77
#define PROGMEM
88
#endif
99

src/RenderTabs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#define RENDERTABS_H
33

44
#include <pgmspace.h>
5-
#include "debug.h"
6-
#if debug
5+
#include "esp8266sam_debug.h"
6+
#if DEBUG_ESP8266SAM_LIB
77
#define PROGMEM
88
#endif
99

src/SamTabs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#define SAMTABS_H
33

44
#include <pgmspace.h>
5-
#include "debug.h"
6-
#if debug
5+
#include "esp8266sam_debug.h"
6+
#if DEBUG_ESP8266SAM_LIB
77
#define PROGMEM
88
#endif
99

File renamed without changes.

src/debug.h renamed to src/esp8266sam_debug.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef DEBUG_H
2-
#define DEBUG_H
1+
#ifndef ESP8266SAM_DEBUG_H
2+
#define ESP8266SAM_DEBUG_H
33

44
void PrintPhonemes(unsigned char *phonemeindex, unsigned char *phonemeLength, unsigned char *stress);
55
void PrintOutput(
@@ -14,6 +14,6 @@ void PrintOutput(
1414

1515
void PrintRule(int offset);
1616

17-
#define debug 0
17+
#define DEBUG_ESP8266SAM_LIB 0
1818

1919
#endif

src/reciter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <string.h>
33
#include "reciter.h"
44
#include "ReciterTabs.h"
5-
#include "debug.h"
5+
#include "esp8266sam_debug.h"
66
#include "SamData.h"
77

88
unsigned char A, X, Y;
@@ -527,7 +527,7 @@ int TextToPhonemes(char *input) // Code36484
527527
Y = mem64;
528528
mem61 = mem60;
529529

530-
if (debug)
530+
if (DEBUG_ESP8266SAM_LIB)
531531
PrintRule(mem62);
532532

533533
pos37461:

src/render.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
#include "render.h"
66
#include "RenderTabs.h"
77

8-
#include "debug.h"
9-
//extern int debug;
8+
#include "esp8266sam_debug.h"
109
#include <pgmspace.h>
1110
#include "SamData.h"
1211

@@ -445,7 +444,7 @@ do
445444
mem44++;
446445
} while(mem44 != 0);
447446
yield();
448-
if (debug)
447+
if (DEBUG_ESP8266SAM_LIB)
449448
{
450449
PrintOutput(sampledConsonantFlag, frequency1, frequency2, frequency3, amplitude1, amplitude2, amplitude3, pitches);
451450
}
@@ -786,7 +785,7 @@ if (debug)
786785
X = A;
787786
mem38 = A - (A>>2); // 3/4*A ???
788787
yield();
789-
if (debug)
788+
if (DEBUG_ESP8266SAM_LIB)
790789
{
791790
PrintOutput(sampledConsonantFlag, frequency1, frequency2, frequency3, amplitude1, amplitude2, amplitude3, pitches);
792791
}

0 commit comments

Comments
 (0)