[MOD] Arduino Enhanced Release 1.0.5 for Windows (installer, drivers, etc) +SRC

You need to ask the MiiCraft guys for the original source code to reupload it again in the same way you uploaded the empty code.

BTW, how much is that printer?

@eried, thank you for quick reply.
3000 euro, but it is from reseller from Italy.
Sorry for offtopic, have a nice day!

eried:
Yeah, this might be related with Missing chars on Serial Monitor · Issue #13 · eried/Arduino · GitHub

But, I have an Leonardo now to test now :slight_smile:

That's good. While I was in there, I've fixed another nasty and long standing bug that has bothered me for ages (added option immediately after "Verify code after upload"):

pico:
While I was in there, I've fixed another nasty and long standing bug that has bothered me for ages (added option immediately after "Verify code after upload"):

eried asked me to clarify this comment regarding the added "Do not attempt to generate prototypes" option in "preferences", and in hindsight, I agree this was probably a bit obscure.

Basically, I think the IDE preprocessor's occasionally disastrous attempt to generate prototypes makes a dubious feature that deserves, and badly needs, a way to be disabled. It leads to the unsuspecting user dealing with a particularly nasty sort of bug, where the compiler is complaining about broken code that has nothing to do with what the user has written in their sketch, but rather what the (buggy) IDE preprocessor has added, mostly invisible to the user (unless they know where and why to look).

I also happen think that the benefits of automatically generating prototypes are marginal at best, even if the IDE preprocessor could do it reliably and accurately. It doesn't save the user much work, as declaring prototypes for your functions is hardly onerous or difficult to understand (really just as complicated as the idea of having to declare a variable before you use it, and we don't have users complaining about that).

And for all the reasons that "forcing" users to declare variables before they use them is a good idea, so is "forcing" them to declare functions explicitly a good idea. And they be will learning about a bit more about "real" C/C++ along the way. So even if implemented properly (which it isn't), I would still argue this "feature" is simply a Bad Idea.

In any case, whether you think the IDE attempting to automatically generate prototypes is a blessing or a curse, I suggest the option to disable the behaviour is a useful and beneficial thing. Writing your own prototypes is good programming practice, leading to better documented and more robust programs. And the only way to have the compiler reliably pick you up on the situation where you have failed to declare your prototypes properly and consistently is to disable the IDE preprocessor's attempt to generate them for you.

End of rant. For now.

Anyway, it was an easy modification to make to the IDE. If eried is interested in the code changes to put into the next Enhanced Release, he need only ask. :slight_smile:

Thanks for the info pico, I would like to have the modified code.

I will start working on 1.5.x clean version for the upcoming "enhanced" version. I am thinking on sending the changes to the official repository (at least the ones non-windows only).

eried:
Thanks for the info pico, I would like to have the modified code.

Your wish is my command. I will send you the changes presently.

pico:

eried:
Thanks for the info pico, I would like to have the modified code.

Your wish is my command. I will send you the changes presently.

OK, first we put a new JCheckBox in "Preferences".

In Preferences.java, at line 184, insert declaration for new JCheckBox "dontGenProtosBox":

  JCheckBox verifyUploadBox;
  JCheckBox dontGenProtosBox;
  JCheckBox externalEditorBox;

In Preferences.java, at line 429, insert code to display new JCheckBox "dontGenProtosBox" (between "Verify..." and "Use external...":

    // [ ] Verify code after upload
    
    verifyUploadBox = new JCheckBox(_("Verify code after upload"));
    pain.add(verifyUploadBox);
    d = verifyUploadBox.getPreferredSize();
    verifyUploadBox.setBounds(left, top, d.width + 10, d.height);
    right = Math.max(right, left + d.width);
    top += d.height + GUI_BETWEEN;
    
    // [ ] Do not attempt to generate prototypes

    dontGenProtosBox = new JCheckBox(_("Do not attempt to generate prototypes"));
    pain.add(dontGenProtosBox);
    d = dontGenProtosBox.getPreferredSize();
    dontGenProtosBox.setBounds(left, top, d.width + 10, d.height);
    right = Math.max(right, left + d.width);
    top += d.height + GUI_BETWEEN;

    // [ ] Use external editor

In Preferences.java, at line 672, insert line "setBoolean("preproc.dontGenProtos",..." before "setBoolean("editor.external", ..."

    setBoolean("preproc.dontGenProtos", dontGenProtosBox.isSelected());
    setBoolean("editor.external", externalEditorBox.isSelected());
    setBoolean("update.check", checkUpdatesBox.isSelected());

Finally, in Preferences.java, at line 736, insert line "dontGenProtosBox.setSelected(..." before "externalEditorBox.setSelected(..."

    sketchbookLocationField.
      setText(get("sketchbook.path"));
    dontGenProtosBox.
      setSelected(getBoolean("preproc.dontGenProtos"));
    externalEditorBox.
      setSelected(getBoolean("editor.external"));

and that's the changes to Preferences.java.

For PdeProcessor.java, in function "public ArrayList prototypes(..."

(right at end of file)

Replace:

    // Remove generated prototypes that exactly match ones found in the source file
    for (int functionIndex=functionMatches.size() - 1; functionIndex >= 0; functionIndex--) {
      for (int prototypeIndex=0; prototypeIndex < prototypeMatches.size(); prototypeIndex++) {
        if (functionMatches.get(functionIndex)).equals(prototypeMatches.get(prototypeIndex)) {
          functionMatches.remove(functionIndex);
          break;
        }
      }
    }

with:

    boolean dontGenProtos =  Preferences.getBoolean("preproc.dontGenProtos");

    // Remove generated prototypes that exactly match ones found in the source file
    for (int functionIndex=functionMatches.size() - 1; functionIndex >= 0; functionIndex--) {
      for (int prototypeIndex=0; prototypeIndex < prototypeMatches.size(); prototypeIndex++) {
        if (dontGenProtos || (functionMatches.get(functionIndex)).equals(prototypeMatches.get(prototypeIndex))) {
          functionMatches.remove(functionIndex);
          break;
        }
      }
    }

And that's it (famous last words! :wink:

(Obviously the last bit where I rip out all the generated prototypes after going to trouble of building the list could be accomplished more efficiently, but it works fine, and was a minimal disturbance of the original code.)

Let me know if anything is unclear or there are any issues.

Thanks once again, eried, for all your great work, BTW.

Thanks pico, will be added soon to my mod.


This is a bit off topic but can somebody help me to reset the (forked) repository to the branch 1.5.x of the official?

I don't know advanced/obscure git management so it will be very handy to be able to start development from 0 using 1.5.x as the new base for the new enhanced release, plus making a new branch per improvement to pull the changes to the official one.

I have tried couple of things Commits · eried/Arduino · GitHub following git tutorials but I can't find how to switch the base branch to reset all from a non-master one.

Thanks!

I have been having horrible issues with Atmel Studio and never could get the fonts fixed on the original IDE. Your updates make a whole world of difference for someone with bad sight like myself. Thanks so much - this is awesome!!

So I am absolutely loving the font change and extras with this mod but I am running into one problem. I compile my code (that compiles with no errors on a normal Arduino IDE and did before Atmel Studio stopped working on me) and I get these two errors which seem to have something to do with accessing the EEPROM memory maybe? I am an amateur programmer so I don't know how to go about solving this issue and need this code to work. If you guys have a fix for it let me know, I would love to use this modified IDE for all my programming!

fb.cpp.o: In function `eeprom_write_block':
c:/program files (x86)/arduino/arduino erw 1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:403: undefined reference to `__eewr_block'
fb.cpp.o: In function `eeprom_read_block':
c:/program files (x86)/arduino/arduino erw 1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:285: undefined reference to `__eerd_block'

Thanks ahead of time, and I hope theres a fix :smiley:

Hi jengil, in which version your sketch compiled properly? 1.5.x? or 1.0.5?

Because for the moment the current version is based on 1.0.5 so the solution would be wait a little extra until I port all the changes to the newer code. I am just a bit stuck in some dumb issues with the repository.

I am currently using 1.0.5 r2, let me know if there's any way I can help or just when you finish the script. I have spent 3 days searching for exactly what u have done so I am very happy that you actually took the time to do it. It means a lot! Thanks again and keep up the work I look forward to using the IDE when its done!

jengil:
I am currently using 1.0.5 r2, let me know if there's any way I can help or just when you finish the script. I have spent 3 days searching for exactly what u have done so I am very happy that you actually took the time to do it. It means a lot! Thanks again and keep up the work I look forward to using the IDE when its done!

Cool :slight_smile: Can you send me the sketch is giving you problems? it seems related with the avrdude version (I updated the sdk and avrdude from the legacy version so that can cause issues).

Hey Sorry for the delay

Here is a simplified sketch that gives me the same set of errors

#include <avr/eeprom.h>

volatile int tTemp;


struct settings_t{
 int Temp;
 int TempC;
 int Hu;
};

const void * const settingsAddress = ( void* ) 0x00;

settings_t settings;

void setup(){
  
  pinMode( A5, INPUT );
  pinMode( A0, INPUT );
  pinMode( 5, OUTPUT );
  
  eeprom_read_block((void*)&settings, settingsAddress, sizeof(settings));
  Serial.begin(9600);
  digitalWrite(5, HIGH);
  tTemp = settings.Temp;
}

void loop()
{
  Serial.print(tTemp);
  float byteness = analogRead(A0);
  float brightness = ((byteness*5)/1024);
  Serial.print("brightness");
  Serial.println(brightness);
  Serial.print("Temp: ");
  Serial.println(settings.Temp);
  //Here the temps will be set and saved on the touch of a button something like this
  if(brightness <= 0.7)
  {
    settings.Temp = 87;
    settings.TempC = (((settings.Temp -32)*5)/9);
    settings.Hu = 67.3; //Hu is an int.
	Serial.println("Temp Settings set");	
  }
  
float button = analogRead(A5);
  float buttonV = ((button*5)/1024);
  Serial.print("button V: ");
  Serial.println(buttonV);
  // if they push the "Save" button, save their configuration
  if (buttonV >= 4.0)
  {
      eeprom_write_block((const void*)&settings, (void*)0, sizeof(settings));
      Serial.print("Settings Saved");
  }
  delay(500);
}

Thanks so much!

Jengil,

code compiles fine here using latest ERW.

I suspect path problems... easiest fix most of the time is: delete the arduino folder and reinstall.

hole:
Jengil,

code compiles fine here using latest ERW.

I suspect path problems... easiest fix most of the time is: delete the arduino folder and reinstall.

Thanks for checking that issue hole! I have all messed up due millions of arduino versions :confused: and no fully working arduino ide to try (something is really messed with my jdks, jre8 looks promising :D) last arduino official arduino installer throws all to c:\program files\arduino\ so I don't know how they will handle any eventual multiple version (if any, or if the installer was just a temporal thing due people bitching)... so new default path will have to be \program files\arduino erw\ instead of \program file\arduino-per version folder-

You are welcome. :slight_smile:

The other day I learned something new.

#define foo

#if defined foo
#include "fish.h"
#else
#include "fowl.h"
#endif.

So the big question is: which includes are included (mind any typos...)? Fish, fowl, both, nothing?

Surprisingly (really?) both. IDE-magic searches for include by pattern search... Those are the moments, when I start drinking more coffee.

You are absolutely right. They are parsing all the includes. It is pretty hard to fix the way this works is making the cpp from the sketch:

Is the preprocessor #if and #define the only sentences that can affect these #includes or can you think on another bizarre situation? I was playing in another project doing something really similar ( http://f.cl.ly/items/1y3S0W0z0n3V440D2U2s/Image%202014-04-06%20at%206.24.04%20PM.png ) trying to "preprocess" the code to format it, so in that same "pass" I can make the pattern invalid for these cases but C has so many tricks, so I am not sure if something really obscure may affect the includes (like something accepted by ansi c rules)

Problem is very annoying when developing for different plattforms. I often emulate a ATtiny85 with some wires to the socket on a UNO-Board. Just for better debugging, attaching a display or such...

#if defined(AVR_ATtiny85) || defined(AVR_ATtiny84)
#else
#include <wire.h>
#endif

would be so nice.

As far as I see, there is really no easy solution. Simple text search doesn't work because the preprocessor has variables (define, undef) and branches (if).

Ok, easy would by to add another preprocessors onto of the ide. something, that knows plattforms and can do something. Baa. Not desirable.

Will 1.5 fix it?

That source is from 1.5 so I don't think they will fix that. Well, in your example, define is a complete expression, not only a direct check so I can say the same: it is not simple to fix.

I also use tiny85 with tinycore, but since they add the tinys to boards.txt then it is quite easy to switch from arduino when prototyping to tiny85, no includes sentences involved.