merose / AnalogScanner

Interrupt-driven analog input scanner class for Arduino.
Apache License 2.0
12 stars 9 forks source link

Compiling in DUE #1

Open Leamucho opened 10 years ago

Leamucho commented 10 years ago

Hello, I know you haven´t tested on Due, but well, I'am, so I got the following results, although on 1.5.6r2 didnt... It seems to me it is plainly a matter of names not being adressed but I'm really not familiar with the avr stuff... Not sure if I can be of any help, good day:

In file included from G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/Arduino.h:31:0, from G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:36: G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp: In member function 'void AnalogScanner::beginScanning()': G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:229:7: error: 'ADCSRA' was not declared in this scope sbi(ADCSRA, ADEN); // Enable the ADC. ^ G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/avr/pgmspace.h:10:23: note: in definition of macro '_SFR_BYTE'

define _SFR_BYTE(n) (n)

                   ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:229:3: note: in expansion of macro 'sbi' sbi(ADCSRA, ADEN); // Enable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:229:15: error: 'ADEN' was not declared in this scope sbi(ADCSRA, ADEN); // Enable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:46: note: in definition of macro 'sbi'

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

                                          ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:49: error: '_BV' was not declared in this scope

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

                                             ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:229:3: note: in expansion of macro 'sbi' sbi(ADCSRA, ADEN); // Enable the ADC. ^ In file included from G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/Arduino.h:31:0, from G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:36: G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:231:7: error: 'ADMUX' was not declared in this scope cbi(ADMUX, ADLAR); // Make sure the ADC value it right-jusitified. ^ G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/avr/pgmspace.h:10:23: note: in definition of macro '_SFR_BYTE'

define _SFR_BYTE(n) (n)

                   ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:231:3: note: in expansion of macro 'cbi' cbi(ADMUX, ADLAR); // Make sure the ADC value it right-jusitified. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:231:14: error: 'ADLAR' was not declared in this scope cbi(ADMUX, ADLAR); // Make sure the ADC value it right-jusitified. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:42:47: note: in definition of macro 'cbi'

define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

                                           ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:232:15: error: 'ADIE' was not declared in this scope sbi(ADCSRA, ADIE); // Enable ADC complete interrupts. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:46: note: in definition of macro 'sbi'

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

                                          ^

In file included from G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/Arduino.h:31:0, from G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:36: G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp: In member function 'void AnalogScanner::endScanning()': G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:240:7: error: 'ADCSRA' was not declared in this scope cbi(ADCSRA, ADEN); // Disable the ADC. ^ G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/avr/pgmspace.h:10:23: note: in definition of macro '_SFR_BYTE'

define _SFR_BYTE(n) (n)

                   ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:240:3: note: in expansion of macro 'cbi' cbi(ADCSRA, ADEN); // Disable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:240:15: error: 'ADEN' was not declared in this scope cbi(ADCSRA, ADEN); // Disable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:42:47: note: in definition of macro 'cbi'

define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

                                           ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:42:50: error: '_BV' was not declared in this scope

define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

                                              ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:240:3: note: in expansion of macro 'cbi' cbi(ADCSRA, ADEN); // Disable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:241:15: error: 'ADIE' was not declared in this scope cbi(ADCSRA, ADIE); // Disable ADC complete interrupts. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:42:47: note: in definition of macro 'cbi'

define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

                                           ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp: In member function 'void AnalogScanner::startNextScan()': G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:255:5: error: 'ADMUX' was not declared in this scope ADMUX = (analogRef << 6) | (index & 7); ^ In file included from G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/Arduino.h:31:0, from G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:36: G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:256:9: error: 'ADCSRA' was not declared in this scope sbi(ADCSRA, ADSC); // Start the ADC conversion. ^ G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/avr/pgmspace.h:10:23: note: in definition of macro '_SFR_BYTE'

define _SFR_BYTE(n) (n)

                   ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:256:5: note: in expansion of macro 'sbi' sbi(ADCSRA, ADSC); // Start the ADC conversion. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:256:17: error: 'ADSC' was not declared in this scope sbi(ADCSRA, ADSC); // Start the ADC conversion. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:46: note: in definition of macro 'sbi'

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

                                          ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:49: error: '_BV' was not declared in this scope

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

                                             ^

G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:256:5: note: in expansion of macro 'sbi' sbi(ADCSRA, ADSC); // Start the ADC conversion. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp: In member function 'void AnalogScanner::processScan()': G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:263:13: error: 'ADCL' was not declared in this scope int low = ADCL; ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:264:14: error: 'ADCH' was not declared in this scope int high = ADCH; ^

merose commented 10 years ago

Thanks very much for the feedback. I'd like to make it work on Due, but don't have one myself. I'll look in to this this week and get back to you.

Mark

Mark Rose markrose@acm.org 925.922.7263 From: Leamucho notifications@github.com To: merose/AnalogScanner AnalogScanner@noreply.github.com Sent: Tuesday, October 14, 2014 6:24 AM Subject: [AnalogScanner] Compiling in DUE (#1)

Hello, I know you haven´t tested on Due, but well, I'am, so I got the following results, although on 1.5.6r2 didnt... It seems to me it is plainly a matter of names not being adressed but I'm really not familiar with the avr stuff... Not sure if I can be of any help, good day:In file included from G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/Arduino.h:31:0, from G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:36: G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp: In member function 'void AnalogScanner::beginScanning()': G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:229:7: error: 'ADCSRA' was not declared in this scope sbi(ADCSRA, ADEN); // Enable the ADC. ^ G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/avr/pgmspace.h:10:23: note: in definition of macro '_SFR_BYTE'

define _SFR_BYTE(n) (n)

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:229:3: note: in expansion of macro 'sbi' sbi(ADCSRA, ADEN); // Enable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:229:15: error: 'ADEN' was not declared in this scope sbi(ADCSRA, ADEN); // Enable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:46: note: in definition of macro 'sbi'

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:49: error: '_BV' was not declared in this scope

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:229:3: note: in expansion of macro 'sbi' sbi(ADCSRA, ADEN); // Enable the ADC. ^ In file included from G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/Arduino.h:31:0, from G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:36: G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:231:7: error: 'ADMUX' was not declared in this scope cbi(ADMUX, ADLAR); // Make sure the ADC value it right-jusitified. ^ G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/avr/pgmspace.h:10:23: note: in definition of macro '_SFR_BYTE'

define _SFR_BYTE(n) (n)

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:231:3: note: in expansion of macro 'cbi' cbi(ADMUX, ADLAR); // Make sure the ADC value it right-jusitified. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:231:14: error: 'ADLAR' was not declared in this scope cbi(ADMUX, ADLAR); // Make sure the ADC value it right-jusitified. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:42:47: note: in definition of macro 'cbi'

define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:232:15: error: 'ADIE' was not declared in this scope sbi(ADCSRA, ADIE); // Enable ADC complete interrupts. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:46: note: in definition of macro 'sbi'

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

^ In file included from G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/Arduino.h:31:0, from G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:36: G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp: In member function 'void AnalogScanner::endScanning()': G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:240:7: error: 'ADCSRA' was not declared in this scope cbi(ADCSRA, ADEN); // Disable the ADC. ^ G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/avr/pgmspace.h:10:23: note: in definition of macro '_SFR_BYTE'

define _SFR_BYTE(n) (n)

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:240:3: note: in expansion of macro 'cbi' cbi(ADCSRA, ADEN); // Disable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:240:15: error: 'ADEN' was not declared in this scope cbi(ADCSRA, ADEN); // Disable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:42:47: note: in definition of macro 'cbi'

define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:42:50: error: '_BV' was not declared in this scope

define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:240:3: note: in expansion of macro 'cbi' cbi(ADCSRA, ADEN); // Disable the ADC. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:241:15: error: 'ADIE' was not declared in this scope cbi(ADCSRA, ADIE); // Disable ADC complete interrupts. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:42:47: note: in definition of macro 'cbi'

define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp: In member function 'void AnalogScanner::startNextScan()': G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:255:5: error: 'ADMUX' was not declared in this scope ADMUX = (analogRef << 6) | (index & 7); ^ In file included from G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/Arduino.h:31:0, from G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:36: G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:256:9: error: 'ADCSRA' was not declared in this scope sbi(ADCSRA, ADSC); // Start the ADC conversion. ^ G:\media\arduino\arduino-1.5.7\hardware\arduino\sam\cores\arduino/avr/pgmspace.h:10:23: note: in definition of macro '_SFR_BYTE'

define _SFR_BYTE(n) (n)

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:256:5: note: in expansion of macro 'sbi' sbi(ADCSRA, ADSC); // Start the ADC conversion. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:256:17: error: 'ADSC' was not declared in this scope sbi(ADCSRA, ADSC); // Start the ADC conversion. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:46: note: in definition of macro 'sbi'

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:45:49: error: '_BV' was not declared in this scope

define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:256:5: note: in expansion of macro 'sbi' sbi(ADCSRA, ADSC); // Start the ADC conversion. ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp: In member function 'void AnalogScanner::processScan()': G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:263:13: error: 'ADCL' was not declared in this scope int low = ADCL; ^ G:\Lea\Arduino\libraries\AnalogScanner\AnalogScanner.cpp:264:14: error: 'ADCH' was not declared in this scope int high = ADCH; ^— Reply to this email directly or view it on GitHub.

Leamucho commented 10 years ago

Ok, thanks to you too!!, did you get any thing during the week? greetings

merose commented 10 years ago

I'm running the IDE version 1.0.6, and it compiles successfully on all boards (although, as you note, I can only test on Uno right now). I see that you are running IDE 1.5.7. I will download the 1.5.8 beta and see if it compiles there for Due. Also, I've pushed a minor change and an example program to Github.

Mark

Mark Rose markrose@acm.org 925.922.7263 From: Leamucho notifications@github.com To: merose/AnalogScanner AnalogScanner@noreply.github.com Cc: Mark Rose markrose@acm.org Sent: Friday, October 17, 2014 4:06 PM Subject: Re: [AnalogScanner] Compiling in DUE (#1)

Ok, thanks to you too!!, did you get any thing during the week? greetings

— Reply to this email directly or view it on GitHub.

Leamucho commented 10 years ago

No luck!, 1.5.8 same results... if you could point me out in which file you find definitions for boards, I could watch about ADCSRA, ADEN, etc for due... is it the right approach? greets

Leamucho commented 10 years ago

also found this http://forum.arduino.cc/index.php?PHPSESSID=st5uoq6kcv65o4psc5dhkl6954&topic=253882.0 so I guess the architecture wont let us do what the library does.... :S

merose commented 9 years ago

Still don't have a Due to test against. Hope to come back to this soon. However, have now updated the library to work with the Leonardo, so other AVR chips should work.