It looks like the TinyDebugKnockBang is assuming there isn't a FlashStringHelper already defined, and trying to supply it's own?
TinyDebugKnockBang predates the F-macro / __FlashStringHelper existence in the Arduino core. At one point in time it was necessary to supply a definition.
What is TC_VERSION here?
Tiny Core Version. I believe it will always be 100 or undefined. (200 is unpublished)
It looks like @SpenceKonde stripped it out so it will be undefined. This may work...
It wasn't me that removed it But that wouldn't have made a difference, as it still wouldn't have been 200.
I blame the dude whose core I forked (always a good scapegoat, right?) - He did some very aggressive cleanup and reorganization (to keep pins_arduino sane using variants, rather than stuffing everything into one giant file littered with #ifdefs, since it supports so many different parts), and that's probably when that got removed.
Is there a way to test if a macro is defined? If so, then testing whether there's an F macro should work, and would cover almost any case, since it's unlikely someone would add FlashStringHelper without F()
I know all of this is above my pay grade but....
By putting a fix in the core, isn't that a bit like the tail wagging the dog?
The core is what is essential and used with every ATtiny (yes I know there are many versions) so to my mind that should be a static base.
TinyDebugKnockBang is an optional piece of code - so it should really be adjusted to work with the core and not the other way round - irrespective of the core not previously having contained the FlashStringHelper declaration.
According to DrAzzy, the FlashStringHelper in the ATtiny cores matches the FlashStringHelper in the Arduino cores. This alone should be reason enough to preserve the core's iteration thereof.
My 2 cents contribution for a solution would be along the lines of: TinyDebugKnockBang should contain an "if not defined" condition for FlashStringHelper (since some ATtiny cores may not have it) before enabling its own iteration. Where FlashStringHelper is defined in the core TinyDebugKnockBang should be made compatible with the class defined in the core, based on the class in the official Arduino cores.
There is button on the right towards the bottom labeled "Download ZIP". You can download the source code packaged in a ZIP file by clicking that button. (Or use this link... https://github.com/Coding-Badly/TinyDebugKnockBang/archive/master.zip) Unfortunately, GitHub appends "-master" to the directory name. You will have to remove that. Other than that it is installed just like any other library.
In file included from test.ino:1:0:
D:\gc\attiny\libraries\TinyDebugKnockBang/TinyDebugKnockBang.h:78:20: error: conflicting declaration 'typedef struct fstr_t __FlashStringHelper'
typedef fstr_t __FlashStringHelper;
^
In file included from D:\gc\attiny\hardware\ATTinyCore\avr\cores\tiny/Arduino.h:221:0,
from D:\gc\attiny\libraries\TinyDebugKnockBang/TinyDebugKnockBang.h:28,
from test.ino:1:
D:\gc\attiny\hardware\ATTinyCore\avr\cores\tiny/WString.h:39:7: error: 'class __FlashStringHelper' has a previous declaration as 'class __FlashStringHelper'
class __FlashStringHelper;
^
Any chance for fixing?
I am asking because I need to read on attiny x313 from software serial and debug (TinyDebugKnockBang).
DrAzzy's core seems not to work with TinyDebugKnockBang so I moved to CodingBadly's core - TinyDebugKnockBang is ok but ... SoftwareSerial gives:
D:\gc\attiny\hardware\tiny\avr\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':
D:\gc\attiny\hardware\tiny\avr\libraries\SoftwareSerial\SoftwareSerial.cpp:317:36: error: 'digitalPinToPCICR' was not declared in this scope
if (digitalPinToPCICR(_receivePin)) {
^
In file included from c:\utils\arduino-1.6.5-r2\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\utils\arduino-1.6.5-r2\hardware\tools\avr\avr\include\avr\interrupt.h:38,
from D:\gc\attiny\hardware\tiny\avr\libraries\SoftwareSerial\SoftwareSerial.cpp:41:
D:\gc\attiny\hardware\tiny\avr\libraries\SoftwareSerial\SoftwareSerial.cpp:358:76: error: 'digitalPinToPCICRbit' was not declared in this scope
*digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
^
D:\gc\attiny\hardware\tiny\avr\libraries\SoftwareSerial\SoftwareSerial.cpp:361:51: error: 'digitalPinToPCMSK' was not declared in this scope
_pcint_maskreg = digitalPinToPCMSK(_receivePin);
^
In file included from c:\utils\arduino-1.6.5-r2\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\utils\arduino-1.6.5-r2\hardware\tools\avr\avr\include\avr\interrupt.h:38,
from D:\gc\attiny\hardware\tiny\avr\libraries\SoftwareSerial\SoftwareSerial.cpp:41:
D:\gc\attiny\hardware\tiny\avr\libraries\SoftwareSerial\SoftwareSerial.cpp:362:60: error: 'digitalPinToPCMSKbit' was not declared in this scope
_pcint_maskvalue = _BV(digitalPinToPCMSKbit(_receivePin));
^
I tried also dammelis's core, but that one seems not to work with TinyDebugKnockBang.
Could you advise me any working configuration for x313 with SoftwareSerial (read) and TinyDebugKnockBang?
Opened attached sketch (Attiny2313, 8MHz internal) and ... it compiles
Sorry for bothering you DrAzzy... but:
Connecting arduino, attiny2313 (Arduino as ISP), burning bootloader ... and:
Arduino: 1.6.5 (Windows 8.1), Board: "ATtiny x313 series, ATtiny2313, 8 mhz (internal), B.O.D. Disabled"
avrdude: AVR Part "attiny2313" not found.
Valid parts are:
t1634 = ATtiny1634
t167 = ATtiny167
t24 = ATtiny24
Error while burning bootloader.
t25 = ATtiny25
t261 = ATtiny261
t44 = ATtiny44
t441 = ATtiny441
t45 = ATtiny45
t461 = ATtiny461
t828 = ATtiny828
t84 = ATtiny84
t841 = ATtiny841
t85 = ATtiny85
t861 = ATtiny861
t87 = ATtiny87
t88 = ATtiny88
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Above wouldn't be much important since I can use CodingBadly's bootloader. However I dont think that CodingBadly's core has the option for 20MHz external which I hoped your core will have...
@CodingBadly
I decided to test also the SoftwareSerial on the new installation. So:
... and no errors. So... sorry for bothering you as well...
Unfortunately both (TinyDebugKnockBang+SoftwareSerial) do not fit into 2313 and I cannot confirm that they compile together - but it looks promising. I have no idea which version I used previously then - they fitted... Nevertheless I have to try with 4313. Ordered alredy.
Hope that SoftwareSerial will work good enough with 4313, otherwise I'll be looking for external crystal cores... Guys, any chance for it?
And once again thank you very much for your work,
GC