Index: comm.c
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/comm.c,v
retrieving revision 1.120
diff -u -r1.120 comm.c
--- comm.c	6 Nov 2004 10:20:16 -0000	1.120
+++ comm.c	3 Jan 2005 05:51:23 -0000
@@ -717,18 +717,18 @@
 	idx = (uint16_t)(cmd_queue[cmd_queue_head].private);
 	P = (PGM_VOID_P)(varstr + idx);
 	i = 0;
-	while((str=(void*)PRG_RDW(P)) == NULL){
+	while((str=(void*)pgm_read_word(P)) == NULL){
 		P -= 2;  // addresses are two-byte
 		i++;
 	}
 #define LAST_ELEMENT (sizeof(struct config_t)-1)
 	if(cnt < 0xF8){
-		c = PRG_RDB(str + cnt);
+		c = pgm_read_byte(str + cnt);
 		if(c) {
 			return c;
 		} else { // end of string
 		// we need the [.]= if i>0 or the next pointer is NULL but not at the very end
-			if(i || (((void*)PRG_RDW(P+2)) == NULL && idx < LAST_ELEMENT)){ // no need for [i]=.. just =..
+			if(i || (((void*)pgm_read_word(P+2)) == NULL && idx < LAST_ELEMENT)){ // no need for [i]=.. just =..
 				cmd_queue[cmd_queue_head].count = 0xF8 - 1 ; // will be incremented!
 				return '[';
 			} else {
@@ -820,7 +820,7 @@
 /* same as above, but private points to PROGMEM (flash), eg. PSTR("...") */
 uint8_t srl_generic_P(uint8_t addr)
 {
-	return PRG_RDB(&(cmd_queue[cmd_queue_head].private[addr])); 
+	return pgm_read_byte(&(cmd_queue[cmd_queue_head].private[addr])); 
 }
 
 // helper funtion used to access flash above the 16 bit address limit
Index: fuelcalc.c
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/fuelcalc.c,v
retrieving revision 1.132
diff -u -r1.132 fuelcalc.c
--- fuelcalc.c	10 Dec 2004 13:30:29 -0000	1.132
+++ fuelcalc.c	3 Jan 2005 05:51:25 -0000
@@ -627,7 +627,7 @@
 // or (1.5 * INJOPENTABLE_SIZE / 4)
 	index = (pw * IOTMULTIPLIER) / maxext_at_vbatt;
 	// no need to check index because of above conditions
-	t = PRG_RDB( &INJOPENTABLE[ index ] );
+	t = pgm_read_byte( &INJOPENTABLE[ index ] );
 	// finally downscale:
 	return ( maxext_at_vbatt * t ) >> 8;
 }
@@ -786,7 +786,7 @@
 		p = (void*)KPAFACTOR4115;
 	}
 
-    engine.kpa250 = 4 * PRG_RDB(p + sensors8(MAP));
+    engine.kpa250 = 4 * pgm_read_byte(p + sensors8(MAP));
 }	// kpafill()
 
 /***************************************************************************/
@@ -798,13 +798,13 @@
 	kpafill();
 
   // Coolant temperature in degrees F + 40
-  engine.coolant = PRG_RDB(&THERMFACTOR[sensors8(CLT)]);
+  engine.coolant = pgm_read_byte(&THERMFACTOR[sensors8(CLT)]);
 
   // Manifold temperature in degrees F + 40
-  engine.mat = PRG_RDB(&MATFACTOR[sensors8(MAT)]);
+  engine.mat = pgm_read_byte(&MATFACTOR[sensors8(MAT)]);
 
   // Air Density Correction Factor
-  t = PRG_RDB(&AIRDENFACTOR[sensors8(MAT)]);
+  t = pgm_read_byte(&AIRDENFACTOR[sensors8(MAT)]);
 
   // This is a hack! When idling for a long time, the intake air temperature usually rises
   // resulting in the intake air to be warm. When it gets too warm, the idling will be rough.
@@ -841,9 +841,9 @@
 		uint8_t val;
 
 		if (config.config11 & _BV(MAP_SENSOR))
-			val = PRG_RDB(&BAROFAC4250[t]);
+			val = pgm_read_byte(&BAROFAC4250[t]);
 		else
-			val = PRG_RDB(&BAROFAC4115[t]);
+			val = pgm_read_byte(&BAROFAC4115[t]);
 
 		// If the mcu resets while the engine is running, we don't believe 
 		// 20 kPa being the atmospheric pressure.
Index: global.h
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/global.h,v
retrieving revision 1.213
diff -u -r1.213 global.h
--- global.h	16 Dec 2004 20:30:23 -0000	1.213
+++ global.h	3 Jan 2005 05:51:25 -0000
@@ -595,7 +595,6 @@
 extern volatile uint8_t ledstate;       // interrupt sets this, not port directly. port is written from userspace 
 
 // should be in <avr/pgmspace.h> but it's missing from older avrlibc:
-#define PRG_RDW(a) ((PRG_RDB((unsigned char*)(a)) & 0x00FF) | ((PRG_RDB((unsigned char*)(a)+1))<<8))
 #ifndef pgm_read_word
 #define pgm_read_word(a) ((PRG_RDB((unsigned char*)(a)) & 0x00FF) | ((PRG_RDB((unsigned char*)(a)+1))<<8))
 #define pgm_read_word_near(a) ((PRG_RDB((unsigned char*)(a)) & 0x00FF) | ((PRG_RDB((unsigned char*)(a)+1))<<8))
Index: handler2k.c
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/handler2k.c,v
retrieving revision 1.31
diff -u -r1.31 handler2k.c
--- handler2k.c	20 Nov 2004 13:07:20 -0000	1.31
+++ handler2k.c	3 Jan 2005 05:51:25 -0000
@@ -107,9 +107,9 @@
 			chr = ign.adv_table[idx];		// no extra config, but conflicts with ign
 			// look up the column from character bitmap in flash
 #if(EMPTY==0)
-			PORTA = PRG_RDB(&charset_r[5*(chr - 'A') + col]);
+			PORTA = pgm_read_byte(&charset_r[5*(chr - 'A') + col]);
 #else	// inverting:
-			PORTA = ~ PRG_RDB(&charset_r[5*(chr - 'A') + col]);
+			PORTA = ~ pgm_read_byte(&charset_r[5*(chr - 'A') + col]);
 #endif
 		}
 	}
Index: iac.c
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/iac.c,v
retrieving revision 1.64
diff -u -r1.64 iac.c
--- iac.c	10 Dec 2004 13:30:30 -0000	1.64
+++ iac.c	3 Jan 2005 05:51:26 -0000
@@ -617,7 +617,7 @@
   default: idx = 0; break;
   }
   
-  val = PRG_RDB(&STEP_PINS[idx]);
+  val = pgm_read_byte(&STEP_PINS[idx]);
   return val;
 }
 
Index: kb.c
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/kb.c,v
retrieving revision 1.23
diff -u -r1.23 kb.c
--- kb.c	16 Sep 2004 22:40:45 -0000	1.23
+++ kb.c	3 Jan 2005 05:51:26 -0000
@@ -246,9 +246,9 @@
 
 				if(kbflags & (_BV(rshift) |_BV(lshift))) // If left or right shift pressed,
 				{                            // do a table look-up                
-					return(PRG_RDB(shifted + sc));             
+					return(pgm_read_byte(shifted + sc));             
 				} else {                    // no shift pressed
-					return(PRG_RDB(unshifted + sc));
+					return(pgm_read_byte(unshifted + sc));
 				}
 			}	// not after e0
 			break;
Index: lcd.c
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/lcd.c,v
retrieving revision 1.80
diff -u -r1.80 lcd.c
--- lcd.c	10 Dec 2004 09:51:24 -0000	1.80
+++ lcd.c	3 Jan 2005 05:51:27 -0000
@@ -32,12 +32,12 @@
 
 __inline__ uint8_t hex_hi(uint8_t i)
 {
-	return PRG_RDB(&hex[i>>4]);
+	return pgm_read_byte(&hex[i>>4]);
 }
 
 __inline__ uint8_t hex_lo(uint8_t i)
 {
-	return PRG_RDB(&hex[i & 0x0F]);
+	return pgm_read_byte(&hex[i & 0x0F]);
 }
 
 #ifdef LCD
@@ -604,7 +604,7 @@
 {
   char c;
   // it might be necessary to use __elpm_inline()
-  while( (c = PRG_RDB(data++)) ) {
+  while( (c = pgm_read_byte(data++)) ) {
     lcd_putch(c);
   }
 }
@@ -613,7 +613,7 @@
 void lcd_putstr_P_max(const char *data, uint8_t max)
 {
   char c;
-  while( (c = PRG_RDB(data++)) && max--) {
+  while( (c = pgm_read_byte(data++)) && max--) {
     lcd_putch(c);
   }
 }
Index: lcd_display.c
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/lcd_display.c,v
retrieving revision 1.136
diff -u -r1.136 lcd_display.c
--- lcd_display.c	24 Nov 2004 21:57:00 -0000	1.136
+++ lcd_display.c	3 Jan 2005 05:51:28 -0000
@@ -1265,7 +1265,7 @@
 	// P = magicstr[ m->posl ];
 	
 	i = 0;
-	while((str=(void*)PRG_RDW(P)) == NULL){
+	while((str=(void*)pgm_read_word(P)) == NULL){
 	  P -= 2;  // addresses are two-byte
 		i++;
 	}
Index: phasesignal.c
===================================================================
RCS file: /cvsroot/megasquirtavr/firmware/phasesignal.c,v
retrieving revision 1.5
diff -u -r1.5 phasesignal.c
--- phasesignal.c	27 Apr 2004 06:16:23 -0000	1.5
+++ phasesignal.c	3 Jan 2005 05:51:29 -0000
@@ -90,7 +90,7 @@
 		t >>= 1;
 		
 		/* casting signed does not work right ???? */
-		a = PRG_RDB(&increment_array[ BAold | t]);
+		a = pgm_read_byte(&increment_array[ BAold | t]);
 		if(a == 1){
 			phasedegree ++;
 			if(phasedegree >= PHASE_RES) phasedegree -= PHASE_RES;
