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

DigiSpark #10

Open
TVRleigh opened this issue Feb 6, 2017 · 2 comments
Open

DigiSpark #10

TVRleigh opened this issue Feb 6, 2017 · 2 comments

Comments

@TVRleigh
Copy link

TVRleigh commented Feb 6, 2017

Hi,
If I use the example with a UNO it works fine but if I change the board to a DigiSpark, I get the following error.

C:\Users\Leigh\Documents\Arduino\libraries\SevenSegmentTM1637\src/SevenSegmentTM1637.h:134:10: error: conflicting return type specified for 'virtual size_t SevenSegmentTM1637::write(const char*)'

size_t write(const char* str);

@per1234
Copy link
Contributor

per1234 commented Feb 7, 2017

Here's the problem:
https://github.com/digistump/DigistumpArduino/blob/master/digistump-avr/cores/tiny/Print.h#L74

 virtual void write(const char *str);

and also:
https://github.com/digistump/DigistumpArduino/blob/master/digistump-avr/cores/tiny/Print.h#L75

 virtual void write(const uint8_t *buffer, size_t size);

so the problem is the digistump-avr:tiny core's Print API is inconsistent with the arduino:arduino core's Print API in that those two versions of write() return void. I see the digistrump-avr:pro core doesn't have the issue so I guess it's intentional because of the limited memory of the ATtiny85.

It would be possible to fix this by using the preprocessor to change the function signatures:

#if defined(ARDUINO_AVR_DIGISPARK) && defined(__AVR_ATtiny85__)

I'm not sure if you consider it worth adding code to the library only to support a specific core.

@TVRleigh
Copy link
Author

TVRleigh commented Feb 8, 2017

Thank you for your quick response at finding the problem.

I've looked into changing it, but I think its currently above my skill level. but as the code work on the PRO, I think I'll just use this board instead as its not much bigger. esp as I can write all the rest of the code I need and test with a UNO.

Its a shame though esp as the Spark only has 5 I/O so being able to have a display and 2 x IO would make this board a lot more usable.

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