Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
c:\program files\winavr\bin\..\lib\gcc\avr\4.1.1\..\..\..\..\avr\bin\ld.exe: region text is full (ERP.elf section .text)make: *** [ERP.elf] Error 1
The reason why Im not using any optimization is because it deletes my delay code for servos.
int i;for(i=0; i<256; i++){}
void _delay_cycles(volatile unsigned int cycles){ while(cycles > 0){ cycles--; };}
x = x + 1;
unsigned millis = 0; // The variable that is incremented under interrupts// Wait until the 'millis' has moved to the next valuefor(unsigned now=millis; now==millis;){}
load register with 0;store register into variable millis;load register from variable millis;store register into variable now;1)load register from variable now;register = register - variable millis;if register equals zero then goto 1)
load registerA with 0;// DONT 'store register into variable millis;' as we have it in registerA// DON'T NEED TO 'load register from variable millis;' AS WE HAVE IT IN registerA// DONT 'store register into variable now;' UNTIL WE NEED TO1)// DONT NEED TO 'load register from variable now;' AS WE HAVE IT IN registerA// AT THIS POINT RegisterA has the value of 'millis' and of 'now'// SO THE FOLLOWING LINE WILL ALWAYS RETURN 0 (ie 'now' = 'millis')// register = register - variable millis;// And is replaced by:goto 1
load registerA with 0;store registerA into variable millis;load registerA from variable millis;' - AS IT MAY HAVE BEEN CHANGED UNDER INTERRUPT// DONT 'store register into variable now;' UNTIL WE NEED TO1)// DONT NEED TO 'load register from variable now;' AS WE HAVE IT IN registerA// AT THIS POINT RegisterA has the value of 'now', but 'millis' may have changed under interruptregisterB = registerA - variable millis;if registerB equals zero then goto 1)
int random(){ if( 1 > 2){ // This will never happen - but lets assume we have loads of code in here }else if( 2 < 1 ){ // This will also never happen }else{ return 1; }}
for(int y = 0; y < 100; y++){ for(int x=0; x < 100; x++){ int pos = y * 100 + x; readBit(pos); }}
int pos = y * 100 + x;
y * 100
x
y
for(int y = 0; y < 100; y++){ int temp = y * 100; for(int x=0; x < 100; x++){ int pos = temp + x; readBit(pos); }}
for(int pos= 0; pos < 10000; pos++){ readBit(pos);}
Started by avinash Software
Started by deldadeh Software
Started by dellagd « 1 2 » Software
Started by jeffrey20021 Electronics