Skip to content

Commit

Permalink
Try to fix issues with (debug) oscilloscope header file
Browse files Browse the repository at this point in the history
Don't think it works very well, though
  • Loading branch information
h4yn0nnym0u5e committed Apr 2, 2023
1 parent 029b2c1 commit 3c560c9
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions teensy4/AudioStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
// Debugging capabilities:
#define noDYNAMIC_AUDIO_DEBUG
#define SCOPE_PIN 25
#define noSCOPE_SERIAL Serial1

#ifndef __ASSEMBLER__
#if !defined(__ASSEMBLER__)
#include <stdio.h> // for NULL
#include <string.h> // for memcpy
#endif


#if defined(DYNAMIC_AUDIO_DEBUG)
Expand All @@ -63,6 +63,7 @@
#endif // DYNAMIC_AUDIO_DEBUG

#if defined(SCOPE_PIN)
extern bool scope_pin_value;
#define SCOPE_ENABLE() pinMode(SCOPE_PIN,OUTPUT)
#define SCOPE_HIGH() digitalWrite(SCOPE_PIN,scope_pin_value = 1)
#define SCOPE_LOW() digitalWrite(SCOPE_PIN,scope_pin_value = 0)
Expand All @@ -74,6 +75,19 @@
#define SCOPE_TOGGLE(...)
#endif // defined(SCOPE_PIN)

#if defined(SCOPE_SERIAL)
#if !defined(SCOPESER_SPEED)
#define SCOPESER_SPEED
#endif // !defined(SCOPESER_SPEED)
#define SCOPESER_ENABLE() SCOPE_SERIAL.begin(SCOPESER_SPEED)
#define SCOPESER_TX(x) SCOPE_SERIAL.write(x)
#else
#define SCOPESER_ENABLE(...)
#define SCOPESER_TX(...)
#endif // defined(SCOPE_SERIAL)

#endif // !defined(__ASSEMBLER__)


// AUDIO_BLOCK_SAMPLES determines how many samples the audio library processes
// per update. It may be reduced to achieve lower latency response to events,
Expand Down Expand Up @@ -111,7 +125,6 @@
#define OFFSET_OF(t,m) ((int)(&(((t*)0)->m)))

#if defined(__cplusplus)
#include <CrashReport.h> // for reporting crashes during audio class construction
class AudioStream;
class AudioConnection;
class AudioDebug;
Expand Down

0 comments on commit 3c560c9

Please sign in to comment.