Skip to content

Commit ef7da4c

Browse files
committed
Replace template with functions for ESP support.
1 parent 470c70a commit ef7da4c

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

Firmware/LoRaSerial_Firmware/System.ino

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//Helper functions to print to all available ports
2-
template <typename T>
3-
T systemPrint(T value)
2+
void systemPrint(const char* value)
43
{
54
Serial.print(value);
65

@@ -9,8 +8,45 @@ T systemPrint(T value)
98
#endif
109
}
1110

12-
template <typename T>
13-
T systemPrintln(T value)
11+
void systemPrintln(const char* value)
12+
{
13+
systemPrint(value);
14+
15+
Serial.println();
16+
#if defined(ARDUINO_ARCH_SAMD)
17+
Serial1.println();
18+
#endif
19+
}
20+
21+
void systemPrint(const __FlashStringHelper* value)
22+
{
23+
Serial.print(value);
24+
25+
#if defined(ARDUINO_ARCH_SAMD)
26+
Serial1.print(value);
27+
#endif
28+
}
29+
30+
void systemPrintln(const __FlashStringHelper* value)
31+
{
32+
systemPrint(value);
33+
34+
Serial.println();
35+
#if defined(ARDUINO_ARCH_SAMD)
36+
Serial1.println();
37+
#endif
38+
}
39+
40+
void systemPrint(int value)
41+
{
42+
Serial.print(value);
43+
44+
#if defined(ARDUINO_ARCH_SAMD)
45+
Serial1.print(value);
46+
#endif
47+
}
48+
49+
void systemPrintln(int value)
1450
{
1551
systemPrint(value);
1652

@@ -77,6 +113,7 @@ uint8_t systemRead()
77113
#else
78114
incoming = Serial.read();
79115
#endif
116+
return(incoming);
80117
}
81118

82119
//Check the train button and change state accordingly

0 commit comments

Comments
 (0)