Skip to content

Commit 9a00846

Browse files
author
Owen L - SFE
committed
remove debug guards in example
Since Arduino has no easy way to specify a macro across all compilation units we are just going to perform debug by default
1 parent 19f316f commit 9a00846

File tree

1 file changed

+16
-48
lines changed
  • libraries/Examples/examples/Example8_BLE_LED

1 file changed

+16
-48
lines changed

libraries/Examples/examples/Example8_BLE_LED/nus_main.c

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,7 @@ static void tagSetup(dmEvt_t *pMsg);
347347
/*************************************************************************************************/
348348
static void tagDmCback(dmEvt_t *pDmEvt)
349349
{
350-
#ifdef DEBUG
351-
debug_print(__func__, __FILE__, __LINE__);
352-
#endif
350+
debug_print(__func__, __FILE__, __LINE__);
353351
dmEvt_t *pMsg;
354352
uint16_t len;
355353

@@ -383,9 +381,7 @@ static void tagDmCback(dmEvt_t *pDmEvt)
383381
/*************************************************************************************************/
384382
static void tagAttCback(attEvt_t *pEvt)
385383
{
386-
#ifdef DEBUG
387-
debug_print(__func__, __FILE__, __LINE__);
388-
#endif
384+
debug_print(__func__, __FILE__, __LINE__);
389385
attEvt_t *pMsg;
390386

391387
if ((pMsg = WsfMsgAlloc(sizeof(attEvt_t) + pEvt->valueLen)) != NULL)
@@ -412,9 +408,7 @@ static void tagAttCback(attEvt_t *pEvt)
412408
/*************************************************************************************************/
413409
static void tagCccCback(attsCccEvt_t *pEvt)
414410
{
415-
#ifdef DEBUG
416-
debug_print(__func__, __FILE__, __LINE__);
417-
#endif
411+
debug_print(__func__, __FILE__, __LINE__);
418412
attsCccEvt_t *pMsg;
419413
appDbHdl_t dbHdl;
420414

@@ -446,9 +440,7 @@ static uint8_t tagIasWriteCback(dmConnId_t connId, uint16_t handle, uint8_t oper
446440
uint16_t offset, uint16_t len, uint8_t *pValue,
447441
attsAttr_t *pAttr)
448442
{
449-
#ifdef DEBUG
450-
debug_print(__func__, __FILE__, __LINE__);
451-
#endif
443+
debug_print(__func__, __FILE__, __LINE__);
452444
ATT_TRACE_INFO3("tagIasWriteCback connId:%d handle:0x%04x op:0x%02x",
453445
connId, handle, operation);
454446
ATT_TRACE_INFO2(" offset:0x%04x len:0x%04x", offset, len);
@@ -471,9 +463,7 @@ static uint8_t tagIasWriteCback(dmConnId_t connId, uint16_t handle, uint8_t oper
471463
/*************************************************************************************************/
472464
static void tagOpen(dmEvt_t *pMsg)
473465
{
474-
#ifdef DEBUG
475-
debug_print(__func__, __FILE__, __LINE__);
476-
#endif
466+
debug_print(__func__, __FILE__, __LINE__);
477467
/* Update peer address info */
478468
tagCb.addrType = pMsg->connOpen.addrType;
479469
BdaCpy(tagCb.peerAddr, pMsg->connOpen.peerAddr);
@@ -492,9 +482,7 @@ static void tagOpen(dmEvt_t *pMsg)
492482
/*************************************************************************************************/
493483
static void tagClose(dmEvt_t *pMsg)
494484
{
495-
#ifdef DEBUG
496-
debug_print(__func__, __FILE__, __LINE__);
497-
#endif
485+
debug_print(__func__, __FILE__, __LINE__);
498486
uint8_t *pVal;
499487
uint16_t len;
500488

@@ -530,9 +518,7 @@ static void tagClose(dmEvt_t *pMsg)
530518
/*************************************************************************************************/
531519
static void tagSecPairCmpl(dmEvt_t *pMsg)
532520
{
533-
#ifdef DEBUG
534-
debug_print(__func__, __FILE__, __LINE__);
535-
#endif
521+
debug_print(__func__, __FILE__, __LINE__);
536522
appConnCb_t *pCb;
537523
dmSecKey_t *pPeerKey;
538524

@@ -566,9 +552,7 @@ static void tagSecPairCmpl(dmEvt_t *pMsg)
566552
/*************************************************************************************************/
567553
static void tagSetup(dmEvt_t *pMsg)
568554
{
569-
#ifdef DEBUG
570-
debug_print(__func__, __FILE__, __LINE__);
571-
#endif
555+
debug_print(__func__, __FILE__, __LINE__);
572556
/* set advertising and scan response data for discoverable mode */
573557
AppAdvSetData(APP_ADV_DATA_DISCOVERABLE, sizeof(tagAdvDataDisc), (uint8_t *) tagAdvDataDisc);
574558
AppAdvSetData(APP_SCAN_DATA_DISCOVERABLE, sizeof(tagScanData), (uint8_t *) tagScanData);
@@ -594,9 +578,7 @@ static void tagSetup(dmEvt_t *pMsg)
594578
/*************************************************************************************************/
595579
static void tagValueUpdate(attEvt_t *pMsg)
596580
{
597-
#ifdef DEBUG
598-
debug_print(__func__, __FILE__, __LINE__);
599-
#endif
581+
debug_print(__func__, __FILE__, __LINE__);
600582
if (pMsg->hdr.status == ATT_SUCCESS)
601583
{
602584
// todo: add debugging statement here to see what's happening!
@@ -630,9 +612,7 @@ static void tagValueUpdate(attEvt_t *pMsg)
630612
/*************************************************************************************************/
631613
static void tagDiscGapCmpl(dmConnId_t connId)
632614
{
633-
#ifdef DEBUG
634-
debug_print(__func__, __FILE__, __LINE__);
635-
#endif
615+
debug_print(__func__, __FILE__, __LINE__);
636616
appDbHdl_t dbHdl;
637617

638618
/* if RPA Only attribute found on peer device */
@@ -657,9 +637,7 @@ static void tagDiscGapCmpl(dmConnId_t connId)
657637
/*************************************************************************************************/
658638
static void tagProcRssiTimer(dmEvt_t *pMsg)
659639
{
660-
#ifdef DEBUG
661-
debug_print(__func__, __FILE__, __LINE__);
662-
#endif
640+
debug_print(__func__, __FILE__, __LINE__);
663641
dmConnId_t connId;
664642

665643
/* if still connected */
@@ -686,9 +664,7 @@ static void tagProcRssiTimer(dmEvt_t *pMsg)
686664
/*************************************************************************************************/
687665
static void tagBtnCback(uint8_t btn)
688666
{
689-
#ifdef DEBUG
690-
debug_print(__func__, __FILE__, __LINE__);
691-
#endif
667+
debug_print(__func__, __FILE__, __LINE__);
692668
dmConnId_t connId;
693669

694670
/* button actions when connected */
@@ -838,9 +814,7 @@ static void tagBtnCback(uint8_t btn)
838814
/*************************************************************************************************/
839815
static void tagDiscCback(dmConnId_t connId, uint8_t status)
840816
{
841-
#ifdef DEBUG
842-
debug_print(__func__, __FILE__, __LINE__);
843-
#endif
817+
debug_print(__func__, __FILE__, __LINE__);
844818
switch(status)
845819
{
846820
case APP_DISC_INIT:
@@ -1069,9 +1043,7 @@ static void tagProcMsg(dmEvt_t *pMsg)
10691043
/*************************************************************************************************/
10701044
void NusHandlerInit(wsfHandlerId_t handlerId)
10711045
{
1072-
#ifdef DEBUG
1073-
debug_print(__func__, __FILE__, __LINE__);
1074-
#endif
1046+
debug_print(__func__, __FILE__, __LINE__);
10751047
APP_TRACE_INFO0("NusHandlerInit");
10761048

10771049
/* store handler ID */
@@ -1115,9 +1087,7 @@ void NusHandlerInit(wsfHandlerId_t handlerId)
11151087
/*************************************************************************************************/
11161088
void NusHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg)
11171089
{
1118-
#ifdef DEBUG
1119-
debug_print(__func__, __FILE__, __LINE__);
1120-
#endif
1090+
debug_print(__func__, __FILE__, __LINE__);
11211091
if (pMsg != NULL)
11221092
{
11231093
APP_TRACE_INFO1("Tag got evt %d", pMsg->event);
@@ -1157,9 +1127,7 @@ void NusHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg)
11571127
/*************************************************************************************************/
11581128
void NusStart(void)
11591129
{
1160-
#ifdef DEBUG
1161-
debug_print(__func__, __FILE__, __LINE__);
1162-
#endif
1130+
debug_print(__func__, __FILE__, __LINE__);
11631131
/* Register for stack callbacks */
11641132
DmRegister(tagDmCback);
11651133
DmConnRegister(DM_CLIENT_ID_APP, tagDmCback);

0 commit comments

Comments
 (0)