got it working, just a small bug left
This commit is contained in:
parent
4ade3a5f00
commit
f3a619decc
7 changed files with 356 additions and 178 deletions
|
@ -1,15 +1,25 @@
|
|||
#ifndef _AUDIOC_HPP
|
||||
#define _AUDIOC_HPP
|
||||
|
||||
#include "daisy_seed.h"
|
||||
|
||||
#define AUDIOC_LOG (daisy_hw.PrintLine)
|
||||
extern daisy::DaisySeed daisy_hw;
|
||||
|
||||
#define AUDIOC_DEBUG
|
||||
|
||||
#ifdef AUDIOC_DEBUG
|
||||
|
||||
#define AUDIOC_DBG_IND() (daisy_hw.SetLed(true))
|
||||
#define AUDIOC_DBG_BRK() __asm("BKPT 234")
|
||||
|
||||
#define AUDIOC_PRECOND(cond) \
|
||||
do { \
|
||||
if (! (cond)) { \
|
||||
AUDIOC_LOG("AC_PRECOND(" #cond ") @ %s: line %u failed\n", \
|
||||
__FILE__, __LINE__); \
|
||||
AUDIOC_DBG_IND(); \
|
||||
AUDIOC_DBG_BRK(); \
|
||||
} \
|
||||
} while (0)
|
||||
#define AUDIOC_POSTCOND(cond) \
|
||||
|
@ -17,6 +27,8 @@
|
|||
if (! (cond)) { \
|
||||
AUDIOC_LOG("AC_POSTCOND(" #cond ") @ %s: line %u failed\n", \
|
||||
__FILE__, __LINE__); \
|
||||
AUDIOC_DBG_IND(); \
|
||||
AUDIOC_DBG_BRK(); \
|
||||
} \
|
||||
} while (0)
|
||||
#define AUDIOC_ASSERT(cond) \
|
||||
|
@ -24,6 +36,8 @@
|
|||
if (! (cond)) { \
|
||||
AUDIOC_LOG("AC_ASSERT(" #cond ") @ %s: line %u failed\n", \
|
||||
__FILE__, __LINE__); \
|
||||
AUDIOC_DBG_IND(); \
|
||||
AUDIOC_DBG_BRK(); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue