Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call of overloaded #8

Open
robweidner opened this issue Nov 9, 2017 · 1 comment
Open

Call of overloaded #8

robweidner opened this issue Nov 9, 2017 · 1 comment

Comments

@robweidner
Copy link

When I run a verify I get the error:

`Arduino: 1.8.3 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

/var/folders/yh/gqgw80hd30z342sbsgbybh9w0000gn/T/arduino_modified_sketch_378221/BasicStatus.ino: In function 'void printSBUSStatus()':
BasicStatus:80: error: call of overloaded 'println(long long int)' is ambiguous
Serial.println(millis() - sbus.getLastTime());
^
/var/folders/yh/gqgw80hd30z342sbsgbybh9w0000gn/T/arduino_modified_sketch_378221/BasicStatus.ino:80:47: note: candidates are:
In file included from /Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Stream.h:26:0,
from /Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/HardwareSerial.h:29,
from /Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Arduino.h:232,
from sketch/BasicStatus.ino.cpp:1:
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:77:12: note: size_t Print::println(const __FlashStringHelper*)
size_t println(const __FlashStringHelper );
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:77:12: note: no known conversion for argument 1 from 'long long int' to 'const __FlashStringHelper
'
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:78:12: note: size_t Print::println(const String&)
size_t println(const String &s);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:78:12: note: no known conversion for argument 1 from 'long long int' to 'const String&'
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:79:12: note: size_t Print::println(const char*)
size_t println(const char[]);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:79:12: note: no known conversion for argument 1 from 'long long int' to 'const char*'
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:80:12: note: size_t Print::println(char)
size_t println(char);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:81:12: note: size_t Print::println(unsigned char, int)
size_t println(unsigned char, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:82:12: note: size_t Print::println(int, int)
size_t println(int, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:83:12: note: size_t Print::println(unsigned int, int)
size_t println(unsigned int, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:84:12: note: size_t Print::println(long int, int)
size_t println(long, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:85:12: note: size_t Print::println(long unsigned int, int)
size_t println(unsigned long, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:86:12: note: size_t Print::println(double, int)
size_t println(double, int = 2);
^
exit status 1
call of overloaded 'println(long long int)' is ambiguous

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`

@Troynica
Copy link

Troynica commented Jan 21, 2019

The last line in the sketch tries to substract an int64_t (long long integer) from a uint32_t (unsigned long integer. You can make the sketch compile and run by changing the mentioned line into:

Serial.println(millis() - (uint32_t)sbus.getLastTime());

The issue is in the example sketch, not in the library (unless getLastTime wasn't supposed to return an int64_t).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants