repetier / Repetier-Firmware

Firmware for Arduino based RepRap 3D printer.
812 stars 734 forks source link

1359993644wpdm_Repetier-Firmware-0_81. compile error #78

Open DavidH137 opened 11 years ago

DavidH137 commented 11 years ago

Using Ardunio 1.0.3 IDE

in file included from Commands.cpp:24: /Eeprom.h: In function 'byte epr_get_byte(uint16_t)': Eeprom.h:116: error: 'eeprom_read_byte' was not declared in this scope /Eeprom.h: In function 'int epr_get_int(uint16_t)': Eeprom.h:119: error: 'eeprom_read_word' was not declared in this scope /Eeprom.h: In function 'long int epr_get_long(uint16_t)': Eeprom.h:122: error: 'eeprom_read_dword' was not declared in this scope /Eeprom.h: In function 'float epr_get_float(uint16_t)': Eeprom.h:126: error: 'eeprom_read_block' was not declared in this scope

DavidH137 commented 11 years ago

FYI, TYPE 33 Mega2560

DavidH137 commented 11 years ago

Compile with EPROM_MODE = 0 is successful

repetier commented 11 years ago

Strange. Tested it with Arduino 1.0.4 on windows and it was no problem. The undeclared commands are definied in #include <avr/eeprom.h> which is included in Eeprom.h. What os are you using that your avr does not have these definitions?

DavidH137 commented 11 years ago

Windows 7 64bit SP1.

I have EEPROM.H in arduino-1.0.3\libraries and arduino-1.0.3\Source\libraries I have Eeprom.h in arduino-1.0.3 (this is in the Repetier directory which I loaded the .pde file from in the IDE I have eeprom.h in arduino-1.0.3\hardware/tools\avr\avr\include and arduino-1.0.3\hardware/tools\avr\include

I renamed all but the one in the Repetier directory (which is included in the Repetier firmware download)

The remaining Eeprom.h that shows up in the Arduino IDE windows does include:

if EEPROM_MODE!=0

extern inline void epr_set_byte(uint pos,byte value); extern inline void epr_set_int(uint pos,int value); extern inline void epr_set_long(uint pos,long value); extern inline void epr_set_float(uint pos,float value); extern void epr_data_to_eeprom(byte corrupted); extern void epr_eeprom_to_data(); extern void epr_eeprom_reset();

inline byte epr_get_byte(uint pos) { return eeprom_readbyte ((unsigned char )(EEPROM_OFFSET+pos)); } inline int epr_get_int(uint pos) { return eeprom_read_word((unsigned int )(EEPROM_OFFSET+pos)); } inline long epr_get_long(uint pos) { return eeprom_readdword((unsigned long)(EEPROM_OFFSET+pos)); } inline float epr_get_float(uint pos) { float v; eeprom_read_block(&v,(void )(EEPROM_OFFSET+pos),4); // newer gcc have eeprom_read_block but not arduino 22 return v; }

endif

Compile gives the same error after the renames as I posted above.

DavidH137 commented 11 years ago

After trying everything below I just copied and pasted the Ardunio eeprom.h into the Eeprom.h files and compiled without errors. The Ardunio IDE sucks!!!

I also moved the file from arduino-1.0.3\hardware\tools\avr\include which I renamed to xeeprom.h and changed the name of the include to xeeprom.h with the same result.

include

This version in avr is from WinAVR-20100110-install.exe.

I then renamed and moved from eeprom.h from arduino-1.0.3-windows.zip into the Repetier folder with same result.

This is weird since I can see the definitions in xeeprom.h. If I try to rename xeeprom.h to eeprom.h Windows tells me Eeprom.h exists, do I want to overwrite...

I also tried with changing the one from Arduino to zeeprom.h, move to Repetier directory and did a Tools/Add file, I was asked if I wanted to replace the existing zeeprom.h and said yes, which resulted in zeeprom.h being deleted from the directory with the following errors:

Could not createInput() for E:\3D\arduino-1.0.3\Repetier\zeeprom.h java.io.FileNotFoundException: E:\3D\arduino-1.0.3\Repetier\zeeprom.h (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:106) at processing.core.PApplet.createInput(Unknown Source) at processing.core.PApplet.loadStrings(Unknown Source) at processing.app.Base.loadFile(Base.java:2191) at processing.app.SketchCode.load(SketchCode.java:253) at processing.app.SketchCode.(SketchCode.java:80) at processing.app.Sketch.addFile(Sketch.java:1100) at processing.app.Sketch.handleAddFile(Sketch.java:993) at processing.app.Editor$16.actionPerformed(Editor.java:646) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at processing.app.SketchCode.load(SketchCode.java:255) at processing.app.SketchCode.(SketchCode.java:80) at processing.app.Sketch.addFile(Sketch.java:1100) at processing.app.Sketch.handleAddFile(Sketch.java:993) at processing.app.Editor$16.actionPerformed(Editor.java:646) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

DavidH137 commented 11 years ago

I got it to compile but when try to run on Leapfrog 3d Creatr the values are incorrect for most of the them (x, y, z direction, steps, extruders...)