Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
* Therefore it is very small, which saves some PROGMEM bytes!
*/
* Therefore it is very small, which saves some PROGMEM bytes!
*/
+#define HAVE_FLASH_BYTE_READACCESS 1
+/* If HAVE_FLASH_BYTE_READACCESS is defined to 1, byte mode access to FLASH is
+ * compiled in. Byte mode sometimes might be used by some programming softwares
+ * (avrdude in terminal mode). Without this feature the device would return "0"
+ * instead the right content of the flash memory.
+ */
+
//#define SIGNATURE_BYTES 0x1e, 0x93, 0x07, 0 /* ATMega8 */
/* This macro defines the signature bytes returned by the emulated USBasp to
* the programmer software. They should match the actual device at least in
//#define SIGNATURE_BYTES 0x1e, 0x93, 0x07, 0 /* ATMega8 */
/* This macro defines the signature bytes returned by the emulated USBasp to
* the programmer software. They should match the actual device at least in
#warning "HAVE_READ_LOCK_FUSE is activated but MCU unknown -> will not support this feature"
#endif
#endif
#warning "HAVE_READ_LOCK_FUSE is activated but MCU unknown -> will not support this feature"
#endif
#endif
+#if HAVE_FLASH_BYTE_READACCESS
+ }else if(rq->wValue.bytes[0] == 0x20){ /* read FLASH low byte */
+#if ((FLASHEND) > 65535)
+ rval = pgm_read_byte_far((((addr_t)address.word)<<1)+0);
+#else
+ rval = pgm_read_byte((((addr_t)address.word)<<1)+0);
+#endif
+ }else if(rq->wValue.bytes[0] == 0x28){ /* read FLASH high byte */
+#if ((FLASHEND) > 65535)
+ rval = pgm_read_byte_far((((addr_t)address.word)<<1)+1);
+#else
+ rval = pgm_read_byte((((addr_t)address.word)<<1)+1);
+#endif
+#endif
#if HAVE_EEPROM_BYTE_ACCESS
}else if(rq->wValue.bytes[0] == 0xa0){ /* read EEPROM byte */
rval = eeprom_read_byte((void *)address.word);
#if HAVE_EEPROM_BYTE_ACCESS
}else if(rq->wValue.bytes[0] == 0xa0){ /* read EEPROM byte */
rval = eeprom_read_byte((void *)address.word);