File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#pragma once
22
33#ifdef SerialMon
4- namespace {
5- static void AM_DBG_SETUP (unsigned long baud) {
4+ static inline void AM_DBG_SETUP (unsigned long baud) {
65 SerialMon.begin (baud);
7- while (!SerialMon);
6+ const unsigned long timeout_ms = 2000 ;
7+ const unsigned long start_ms = millis ();
8+ while (!SerialMon && (millis () - start_ms) < timeout_ms) {
9+ // Avoid hard lock on boards without native USB or no host.
10+ }
811}
912
1013template <typename T>
11- static void AM_DBG_PLAIN (T last) {
14+ static inline void AM_DBG_PLAIN (T last) {
1215 SerialMon.println (last);
1316}
1417
1518template <typename T, typename ... Args>
16- static void AM_DBG_PLAIN (T head, Args... tail) {
19+ static inline void AM_DBG_PLAIN (T head, Args... tail) {
1720 SerialMon.print (head);
1821 SerialMon.print (' ' );
1922 AM_DBG_PLAIN (tail...);
2023}
2124
2225template <typename ... Args>
23- static void AM_DBG (Args... args) {
26+ static inline void AM_DBG (Args... args) {
2427 AM_DBG_PLAIN (args...);
2528}
26- } // namespace
2729#else
2830#define AM_DBG_SETUP (...)
2931#define AM_DBG_PLAIN (...)
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ BEGIN_APPLEMIDI_NAMESPACE
1515// first octet
1616#define RTP_P_FIELD 0x20
1717#define RTP_X_FIELD 0x10
18- #define RTP_CC_FIELD 0xF
18+ #define RTP_CC_FIELD 0x0F
1919
2020// second octet
2121#define RTP_M_FIELD 0x80
@@ -25,7 +25,7 @@ BEGIN_APPLEMIDI_NAMESPACE
2525#define PAYLOADTYPE_RTPMIDI 97
2626
2727/* Version is the first 2 bits of the first octet*/
28- #define RTP_VERSION (octet ) ((octet) >> 6)
28+ #define RTP_VERSION (octet ) ((( octet) >> 6) & 0x03 )
2929
3030/* Padding is the third bit; No need to shift, because true is any value
3131other than 0! */
You can’t perform that action at this time.
0 commit comments