Pages: 1 ... 39 40 [41] 42   Go Down
Author Topic: [MOD] Arduino Enhanced Release 1.0.5 for Windows (installer, drivers, etc) +SRC  (Read 229752 times)
0 Members and 3 Guests are viewing this topic.
Offline Offline
God Member
*****
Karma: 32
Posts: 828
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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":

Code:
 JCheckBox verifyUploadBox;
  JCheckBox dontGenProtosBox;
  JCheckBox externalEditorBox;

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

Code:
   // [ ] 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", ..."

Code:
   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(..."

Code:
   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<String> prototypes(..."

(right at end of file)
    
Replace:

Code:
   // 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:

Code:
   
    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! ;-)

(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.
« Last Edit: April 30, 2014, 11:11:44 am by pico » Logged

WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 https://github.com/eried/Arduino/commits/master following git tutorials but I can't find how to switch the base branch to reset all from a non-master one.

Thanks!
Logged

My website: http://ried.cl

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Code:
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-grin
Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

My website: http://ried.cl

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley 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).
Logged

My website: http://ried.cl

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Sorry for the delay

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

Code:
#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! 
Logged

0
Offline Offline
Newbie
*
Karma: 2
Posts: 48
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 :/ and no fully working arduino ide to try (something is really messed with my jdks, jre8 looks promising smiley-grin) 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-
Logged

My website: http://ried.cl

0
Offline Offline
Newbie
*
Karma: 2
Posts: 48
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are welcome. :-)

The other day I learned something new.

Code:
#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.

Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

My website: http://ried.cl

0
Offline Offline
Newbie
*
Karma: 2
Posts: 48
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

My website: http://ried.cl

0
Offline Offline
Newbie
*
Karma: 2
Posts: 48
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Be more verbose, please.

I use a ST7735 display during "emulation". So I have a #include for "Adafruit_GFX.h" and "Adafruit_ST7735.h".

How do I get rid of it when compiling for tiny85?
Logged

Pages: 1 ... 39 40 [41] 42   Go Up
Jump to: