forked from endurodave/SimpleSocketProtocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssp_common.cpp
More file actions
47 lines (38 loc) · 722 Bytes
/
Copy pathssp_common.cpp
File metadata and controls
47 lines (38 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "ssp_common.h"
#include "ssp_osal.h"
#include <stdio.h>
#include <stdarg.h>
#ifdef ARDUINO
#include <Arduino.h>
#endif
// Trace output used for debugging
void SSP_TraceFormat(const char* format, ...)
{
SSPOSAL_EnterCritical();
va_list vl;
va_start(vl, format);
#ifdef ARDUINO
char buf[128];
vsprintf(buf, format, vl);
Serial.println(buf);
#else
vprintf(format, vl);
#endif
va_end(vl);
#ifndef ARDUINO
printf("\n");
#endif
SSPOSAL_ExitCritical();
}
// Trace output used for debugging
void SSP_Trace(const char* str)
{
SSPOSAL_EnterCritical();
#ifdef ARDUINO
Serial.println(str);
#else
printf(str);
printf("\n");
#endif
SSPOSAL_ExitCritical();
}