cyborg5 / IRLib

An Arduino library for encoding and decoding infrared remote signals
Other
213 stars 76 forks source link

Compilation errors on Arduino DUE #8

Closed hassanasad closed 6 years ago

hassanasad commented 10 years ago

Hi,

While the library works great on Arduino Mega and other 8-bit variations, it gives compiler errors on Arduino DUE.

The main reason being the PORT names and defines not available in SAM3X processor. Can you please kindly add its support as well.

These are the errors generated:

In file included from C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:966:0: C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In function 'void do_Blink()': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:345:25: error: 'PORTB' was not declared in this scope

define BLINKLED_ON() (PORTB |= B00100000)

                     ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:996:7: note: in expansion of macro 'BLINKLED_ON' BLINKLED_ON(); // turn pin 13 LED on ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:346:25: error: 'PORTB' was not declared in this scope

define BLINKLED_OFF() (PORTB &= B11011111)

                     ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:999:7: note: in expansion of macro 'BLINKLED_OFF' BLINKLED_OFF(); // turn pin 13 LED off ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRrecv::enableIRIn()': C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1016:7: error: 'cli' was not declared in this scope cli(); ^ In file included from C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:966:0: C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:4: error: 'TCCR2A' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:17: error: 'WGM21' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:22: error: '_BV' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:27: error: 'TCCR2B' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:40: error: 'CS21' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:283:4: error: 'OCR2A' was not declared in this scope OCR2A = IR_RECV_COUNT_TOP / 8; TCNT2 = 0; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:283:37: error: 'TCNT2' was not declared in this scope OCR2A = IR_RECV_COUNT_TOP / 8; TCNT2 = 0; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:272:34: error: 'TIMSK2' was not declared in this scope

define IR_RECV_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

                              ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1018:3: note: in expansion of macro 'IR_RECV_ENABLE_INTR' IR_RECV_ENABLE_INTR; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:272:47: error: 'OCIE2A' was not declared in this scope

define IR_RECV_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

                                           ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1018:3: note: in expansion of macro 'IR_RECV_ENABLE_INTR' IR_RECV_ENABLE_INTR; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:272:53: error: '_BV' was not declared in this scope

define IR_RECV_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

                                                 ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1018:3: note: in expansion of macro 'IR_RECV_ENABLE_INTR' IR_RECV_ENABLE_INTR; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1019:7: error: 'sei' was not declared in this scope sei(); ^ In file included from C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:966:0: C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::enableIROut(unsigned char)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:273:34: error: 'TIMSK2' was not declared in this scope

define IR_RECV_DISABLE_INTR (TIMSK2 = 0)

                              ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1113:2: note: in expansion of macro 'IR_RECV_DISABLE_INTR' IR_RECV_DISABLE_INTR; //Timer2 Overflow Interrupt
^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:3: error: 'TCCR2A' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:16: error: 'WGM20' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:21: error: '_BV' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:25: error: 'TCCR2B' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:38: error: 'WGM22' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:51: error: 'CS20' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:190:3: error: 'OCR2A' was not declared in this scope OCR2A = pwmval; OCR2B = pwmval / 3; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:190:19: error: 'OCR2B' was not declared in this scope OCR2A = pwmval; OCR2B = pwmval / 3; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::mark(unsigned int)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:33: error: 'TCCR2A' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

                             ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:47: error: 'COM2B1' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

                                           ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:53: error: '_BV' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

                                                 ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::space(unsigned int)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:31: error: 'TCCR2A' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

                           ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:47: error: 'COM2B1' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

                                           ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:53: error: '_BV' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

                                                 ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ Error compiling.

cyborg5 commented 10 years ago

I do not have access to that variety of Arduino and it would be a steep learning curve to get that intimate with the hardware. I'm attempting to come up with ways to make the library less hardware dependent. For example the loop version of the receiver library is a step in that direction. I'm also working on a way to create a cheap ATtiny85 IR transmitter that would handle the IR modulation and then the more advanced boards like the DUE would simply send data to the tiny and let it deal with the hardware level stuff. However don't look for this anytime real soon. It's going to be a long process. However it's going to be more important as more advanced boards keep getting released. Also getting pressure from the TEENSY people and I'm sure Galileo isn't far behind :-)

From: Hassan [mailto:notifications@github.com] Sent: Saturday, October 18, 2014 6:06 AM To: cyborg5/IRLib Subject: [IRLib] Compilation errors on Arduino DUE (#8)

Hi,

While the library works great on Arduino Mega and other 8-bit variations, it gives compiler errors on Arduino DUE.

The main reason being the PORT names and defines not available in SAM3X processor. Can you please kindly add its support as well.

These are the errors generated:

In file included from C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:966:0: C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In function 'void do_Blink()': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:345:25: error: 'PORTB' was not declared in this scope

define BLINKLED_ON() (PORTB |= B00100000)

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:996:7: note: in expansion of macro 'BLINKLED_ON' BLINKLED_ON(); // turn pin 13 LED on ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:346:25: error: 'PORTB' was not declared in this scope

define BLINKLED_OFF() (PORTB &= B11011111)

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:999:7: note: in expansion of macro 'BLINKLED_OFF' BLINKLED_OFF(); // turn pin 13 LED off ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRrecv::enableIRIn()': C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1016:7: error: 'cli' was not declared in this scope cli(); ^ In file included from C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:966:0: C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:4: error: 'TCCR2A' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:17: error: 'WGM21' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:22: error: '_BV' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:27: error: 'TCCR2B' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:282:40: error: 'CS21' was not declared in this scope TCCR2A = _BV(WGM21); TCCR2B = _BV(CS21); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:283:4: error: 'OCR2A' was not declared in this scope OCR2A = IR_RECV_COUNT_TOP / 8; TCNT2 = 0; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:283:37: error: 'TCNT2' was not declared in this scope OCR2A = IR_RECV_COUNT_TOP / 8; TCNT2 = 0; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1017:3: note: in expansion of macro 'IR_RECV_CONFIG_TICKS' IR_RECV_CONFIG_TICKS(); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:272:34: error: 'TIMSK2' was not declared in this scope

define IR_RECV_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1018:3: note: in expansion of macro 'IR_RECV_ENABLE_INTR' IR_RECV_ENABLE_INTR; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:272:47: error: 'OCIE2A' was not declared in this scope

define IR_RECV_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1018:3: note: in expansion of macro 'IR_RECV_ENABLE_INTR' IR_RECV_ENABLE_INTR; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:272:53: error: '_BV' was not declared in this scope

define IR_RECV_ENABLE_INTR (TIMSK2 = _BV(OCIE2A))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1018:3: note: in expansion of macro 'IR_RECV_ENABLE_INTR' IR_RECV_ENABLE_INTR; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1019:7: error: 'sei' was not declared in this scope sei(); ^ In file included from C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:966:0: C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::enableIROut(unsigned char)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:273:34: error: 'TIMSK2' was not declared in this scope

define IR_RECV_DISABLE_INTR (TIMSK2 = 0)

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1113:2: note: in expansion of macro 'IR_RECV_DISABLE_INTR' IR_RECV_DISABLE_INTR; //Timer2 Overflow Interrupt

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:3: error: 'TCCR2A' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:16: error: 'WGM20' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:21: error: '_BV' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:25: error: 'TCCR2B' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:38: error: 'WGM22' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:51: error: 'CS20' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:190:3: error: 'OCR2A' was not declared in this scope OCR2A = pwmval; OCR2B = pwmval / 3; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:190:19: error: 'OCR2B' was not declared in this scope OCR2A = pwmval; OCR2B = pwmval / 3; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::mark(unsigned int)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:33: error: 'TCCR2A' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:47: error: 'COM2B1' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:53: error: '_BV' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::space(unsigned int)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:31: error: 'TCCR2A' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:47: error: 'COM2B1' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:53: error: '_BV' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ Error compiling.

— Reply to this email directly or view it on GitHub https://github.com/cyborg5/IRLib/issues/8 . https://github.com/notifications/beacon/3612858__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyOTI0NTk3OCwiZGF0YSI6eyJpZCI6NDYyMDA2ODV9fQ==--2fe887a79ed622cf4275135d86fae3a855784d1f.gif

hassanasad commented 10 years ago

Well you are right sir :)

However i believe the change is needed only in the IRLibTimer file.

There were errors for the function cli() and sei() (in IRLib.c file) as these are not supported in DUE. I replaced them with noInterrupts() and interrupts() and now that portion compiles correctly. However because DUE is ARM based, if this library is fixed for ARM processors, it might work on a new set of ARM variants.

P.S: I too don't have DUE at hand as yet. Will be arriving shortly. I am just trying to compile the software first.

hassanasad commented 10 years ago

Can you please guide how to use the IRrecvLoop method. I cant seem to understand how to use it nor can find an example.

As the timers and interrupts are not DUE compatible, that seems to be a good choice for now :)

cyborg5 commented 10 years ago

You should read the manual.

http://tech.cyborg5.com/irlib/docs/1-irlib-reference/1-1-receiver-classes/1-1-5-irrecvloop-class/

From: Hassan [mailto:notifications@github.com] Sent: Tuesday, October 21, 2014 12:45 AM To: cyborg5/IRLib Cc: Chris Young Subject: Re: [IRLib] Compilation errors on Arduino DUE (#8)

Can you please guide how to use the IRrecvLoop method. I cant seem to understand how to use it nor can find an example.

As the timers and interrupts are not DUE compatible, that seems to be a good choice for now :)

— Reply to this email directly or view it on GitHub https://github.com/cyborg5/IRLib/issues/8#issuecomment-59878327 . https://github.com/notifications/beacon/3612858__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyOTQ4NTkxOCwiZGF0YSI6eyJpZCI6NDYyMDA2ODV9fQ==--4006366ff02e5cd7149f71e36364e007291aa5af.gif

hassanasad commented 10 years ago

The thing is, as soon as i #include "IRLib.h"

I get the errors listed below, is there a way to somehow omit them by compiler definitions? :

In file included from C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:966:0: C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::enableIROut(unsigned char)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:273:34: error: 'TIMSK2' was not declared in this scope

define IR_RECV_DISABLE_INTR (TIMSK2 = 0)

                              ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1113:2: note: in expansion of macro 'IR_RECV_DISABLE_INTR' IR_RECV_DISABLE_INTR; //Timer2 Overflow Interrupt
^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:3: error: 'TCCR2A' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:16: error: 'WGM20' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:21: error: '_BV' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:25: error: 'TCCR2B' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:38: error: 'WGM22' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:189:51: error: 'CS20' was not declared in this scope TCCR2A = _BV(WGM20); TCCR2B = _BV(WGM22) | _BV(CS20); \ ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:190:3: error: 'OCR2A' was not declared in this scope OCR2A = pwmval; OCR2B = pwmval / 3; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:190:19: error: 'OCR2B' was not declared in this scope OCR2A = pwmval; OCR2B = pwmval / 3; }) ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1116:2: note: in expansion of macro 'IR_SEND_CONFIG_KHZ' IR_SEND_CONFIG_KHZ(khz); ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::mark(unsigned int)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:33: error: 'TCCR2A' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

                             ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:47: error: 'COM2B1' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

                                           ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:184:53: error: '_BV' was not declared in this scope

define IR_SEND_PWM_START (TCCR2A |= _BV(COM2B1))

                                                 ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1131:2: note: in expansion of macro 'IR_SEND_PWM_START' IR_SEND_PWM_START; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp: In member function 'void IRsendBase::space(unsigned int)': C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:31: error: 'TCCR2A' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

                           ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:47: error: 'COM2B1' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

                                           ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ C:\Users\Hassan\Documents\Arduino\libraries\IRLib/IRLibTimer.h:186:53: error: '_BV' was not declared in this scope

define IR_SEND_PWM_STOP (TCCR2A &= ~(_BV(COM2B1)))

                                                 ^

C:\Users\Hassan\Documents\Arduino\libraries\IRLib\IRLib.cpp:1137:2: note: in expansion of macro 'IR_SEND_PWM_STOP' IR_SEND_PWM_STOP; ^ Error compiling.

zallesov commented 8 years ago

Is there progress on this issue since than? It seems there is just no way to use IRLib with DUE so far. Here is an alternative or those who googled till here. https://github.com/enternoescape/Arduino-IRremote-Due It works with DUE fine, but fails if you try to use Adafruit_Neopixels parallel with it. So it is no solution for me. IRLibs works almost fine with Neopixels (no Serial output when using both), but does not support DUE.

cyborg5 commented 6 years ago

Support for the original IRLib has been ended. Under IRLib2 we still have no plans to support the DUE

You can find IRLib2 at https://github.com/cyborg5/IRLib2