Skip to content

Commit 20b8cc8

Browse files
committed
Documented no support of SAMD51
1 parent ff0703b commit 20b8cc8

File tree

5 files changed

+51
-11
lines changed

5 files changed

+51
-11
lines changed

.github/workflows/LibraryBuild.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
- arduino:avr:uno|USE_NO_SEND_PWM
5252
- arduino:avr:uno|SEND_PWM_BY_TIMER
5353
- arduino:avr:uno|USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN
54+
- arduino:avr:mega:cpu=atmega2560
5455
- arduino:avr:leonardo
5556
- arduino:megaavr:nona4809:mode=off
5657
- arduino:samd:arduino_zero_native
@@ -105,6 +106,11 @@ jobs:
105106
IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=100 -DIR_SEND_PIN=3 -DUSE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN
106107
All: -DUSE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN
107108

109+
- arduino-boards-fqbn: arduino:avr:mega:cpu=atmega2560
110+
sketches-exclude: IR2Keyboard
111+
build-properties: # the flags were put in compiler.cpp.extra_flags
112+
IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=700
113+
108114
- arduino-boards-fqbn: arduino:avr:leonardo
109115
build-properties: # the flags were put in compiler.cpp.extra_flags
110116
IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=100

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ ATtiny and Digispark boards are only tested with the recommended [ATTinyCore](ht
436436
- ATmega4809 (Nano every)
437437
- ATtiny3217 (Tiny Core 32 Dev Board)
438438
- ATtiny84, 85, 167 (Digispark + Digispark Pro)
439-
- SAMD (Zero, MKR*, **but not DUE, which is SAM architecture**)
439+
- SAMD21 (Zero, MKR*, **but not SAMD51 and not DUE, the latter is SAM architecture**)
440440
- ESP32 (ESP32 C3 since board package 2.0.2 from Espressif)
441441
- ESP8266 [This fork](https://github.com/crankyoldgit/IRremoteESP8266) supports an [impressive set of protocols and a lot of air conditioners](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md)
442442
- Sparkfun Pro Micro

src/IRReceive.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,10 @@ void CheckForRecordGapsMicros(Print *aSerial, IRData *aIRDataPtr) {
869869
* Print functions
870870
* Since a library should not allocate the "Serial" object, all functions require a pointer to a Print object.
871871
**********************************************************************************************************************/
872+
void IRrecv::printActiveIRProtocols(Print *aSerial) {
873+
// call no class function with same name
874+
::printActiveIRProtocols(aSerial);
875+
}
872876
void printActiveIRProtocols(Print *aSerial) {
873877
#if defined(DECODE_NEC)
874878
aSerial->print(F("NEC, "));
@@ -934,6 +938,7 @@ void printActiveIRProtocols(Print *aSerial) {
934938
* @param aSerial The Print object on which to write, for Arduino you can use &Serial.
935939
*/
936940
void IRrecv::printIRResultShort(Print *aSerial) {
941+
// call no class function with same name
937942
::printIRResultShort(aSerial, &decodedIRData, true);
938943
}
939944

@@ -1030,6 +1035,7 @@ void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintGap) {
10301035
* @param aSerial The Print object on which to write, for Arduino you can use &Serial.
10311036
*/
10321037
void IRrecv::printIRSendUsage(Print *aSerial) {
1038+
// call no class function with same name
10331039
::printIRSendUsage(aSerial, &decodedIRData);
10341040
}
10351041

@@ -1339,6 +1345,11 @@ void IRrecv::printIRResultAsCVariables(Print *aSerial) {
13391345
}
13401346
}
13411347

1348+
const __FlashStringHelper* IRrecv::getProtocolString() {
1349+
// call no class function with same name
1350+
return ::getProtocolString(decodedIRData.protocol);
1351+
}
1352+
13421353
const __FlashStringHelper* getProtocolString(decode_type_t aProtocol) {
13431354
switch (aProtocol) {
13441355
default:

src/IRremoteInt.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,13 @@ class IRrecv {
218218
void printIRResultMinimal(Print *aSerial);
219219
void printIRResultRawFormatted(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks = true);
220220
void printIRResultAsCVariables(Print *aSerial);
221+
222+
/*
223+
* Next 3 functions are also available as non member functions
224+
*/
221225
void printIRSendUsage(Print *aSerial);
226+
void printActiveIRProtocols(Print *aSerial);
227+
const __FlashStringHelper* getProtocolString();
222228

223229
void compensateAndPrintIRResultAsCArray(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks = true);
224230
void compensateAndPrintIRResultAsPronto(Print *aSerial, unsigned int frequency = 38000U);
@@ -322,6 +328,9 @@ bool MATCH_MARK(unsigned int measured_ticks, unsigned int desired_us);
322328
bool MATCH_SPACE(unsigned int measured_ticks, unsigned int desired_us);
323329

324330
int getMarkExcessMicros();
331+
/*
332+
* Next 3 functions are also available as member functions
333+
*/
325334
void printActiveIRProtocols(Print *aSerial);
326335
void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintGap);
327336
void printIRSendUsage(Print *aSerial, IRData *aIRDataPtr);

src/TinyIRReceiver.hpp

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,17 @@
5656
* @{
5757
*/
5858

59-
//#define DEBUG // to see if attachInterrupt used
60-
//#define TRACE // to see the state of the ISR state machine
59+
#if defined(DEBUG)
60+
#define LOCAL_DEBUG_ATTACH_INTERRUPT
61+
#else
62+
//#define LOCAL_DEBUG_ATTACH_INTERRUPT // to see if attachInterrupt() or static interrupt (by register tweaking) is used
63+
#endif
64+
#if defined(TRACE)
65+
#define LOCAL_TRACE_STATE_MACHINE
66+
#else
67+
//#define LOCAL_TRACE_STATE_MACHINE // to see the state of the ISR state machine
68+
#endif
69+
6170
//#define _IR_MEASURE_TIMING // Activate this if you want to enable internal hardware timing measurement.
6271
//#define _IR_TIMING_TEST_PIN 7
6372
TinyIRReceiverStruct TinyIRReceiverControl;
@@ -136,14 +145,13 @@ void IRPinChangeInterruptHandler(void)
136145

137146
uint8_t tState = TinyIRReceiverControl.IRReceiverState;
138147

139-
#if defined(TRACE)
148+
#if defined(LOCAL_TRACE_STATE_MACHINE)
140149
Serial.print(tState);
141-
Serial.print(' ');
150+
Serial.print(F(" D="));
151+
Serial.print(tMicrosOfMarkOrSpace);
142152
// Serial.print(F(" I="));
143153
// Serial.print(tIRLevel);
144-
// Serial.print(F(" D="));
145-
// Serial.print(tDeltaMicros);
146-
// Serial.println();
154+
Serial.print('|');
147155
#endif
148156

149157
if (tIRLevel == LOW) {
@@ -294,7 +302,7 @@ void initPCIInterruptForTinyReceiver() {
294302
enablePCIInterruptForTinyReceiver();
295303
}
296304

297-
#if defined (DEBUG) && !defined(STR)
305+
#if defined (LOCAL_DEBUG_ATTACH_INTERRUPT) && !defined(STR)
298306
// Helper macro for getting a macro definition as string
299307
#define STR_HELPER(x) #x
300308
#define STR(x) STR_HELPER(x)
@@ -313,11 +321,11 @@ void enablePCIInterruptForTinyReceiver() {
313321
#elif !defined(__AVR__) || defined(TINY_RECEIVER_USE_ARDUINO_ATTACH_INTERRUPT)
314322
// costs 112 bytes program memory + 4 bytes RAM
315323
attachInterrupt(digitalPinToInterrupt(IR_INPUT_PIN), IRPinChangeInterruptHandler, CHANGE);
316-
# if defined(DEBUG)
324+
# if defined(LOCAL_DEBUG_ATTACH_INTERRUPT)
317325
Serial.println(F("Use attachInterrupt for pin=" STR(IR_INPUT_PIN)));
318326
# endif
319327
#else
320-
# if defined(DEBUG)
328+
# if defined(LOCAL_DEBUG_ATTACH_INTERRUPT)
321329
Serial.println(F("Use static interrupt for pin=" STR(IR_INPUT_PIN)));
322330
# endif
323331
# if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
@@ -527,4 +535,10 @@ ISR(PCINT1_vect)
527535

528536
/** @}*/
529537

538+
#if defined(LOCAL_DEBUG_ATTACH_INTERRUPT)
539+
#undef LOCAL_DEBUG_ATTACH_INTERRUPT
540+
#endif
541+
#if defined(LOCAL_TRACE_STATE_MACHINE)
542+
#undef LOCAL_TRACE_STATE_MACHINE
543+
#endif
530544
#endif // _TINY_IR_RECEIVER_HPP

0 commit comments

Comments
 (0)