cleanup read_fuse_lock()

This commit is contained in:
Olaf Rempel 2006-05-26 19:37:18 +02:00
parent d1f7b638d1
commit 93453d0aaa

11
main.c
View File

@ -226,8 +226,9 @@ static inline uint16_t readEEpromPage(uint16_t address, pagebuf_t size)
return address; return address;
} }
static uint8_t read_fuse_lock(uint16_t addr, uint8_t mode) static uint8_t read_fuse_lock(uint16_t addr)
{ {
uint8_t mode = (1<<BLBSET) | (1<<SPMEN);
uint8_t retval; uint8_t retval;
asm volatile asm volatile
@ -462,19 +463,19 @@ int main(void)
#warning "Extension 'ReadFuseLock' enabled" #warning "Extension 'ReadFuseLock' enabled"
// read "low" fuse bits // read "low" fuse bits
} else if (val == 'F') { } else if (val == 'F') {
sendchar(read_fuse_lock(0x0000, (1<<BLBSET) | (1<<SPMEN))); sendchar(read_fuse_lock(GET_LOW_FUSE_BITS));
// read lock bits // read lock bits
} else if (val == 'r') { } else if (val == 'r') {
sendchar(read_fuse_lock(0x0001, (1<<BLBSET) | (1<<SPMEN))); sendchar(read_fuse_lock(GET_LOCK_BITS));
// read high fuse bits // read high fuse bits
} else if (val == 'N') { } else if (val == 'N') {
sendchar(read_fuse_lock(0x0003, (1<<BLBSET) | (1<<SPMEN))); sendchar(read_fuse_lock(GET_HIGH_FUSE_BITS));
// read extended fuse bits // read extended fuse bits
} else if (val == 'Q') { } else if (val == 'Q') {
sendchar(read_fuse_lock(0x0002, (1<<BLBSET) | (1<<SPMEN))); sendchar(read_fuse_lock(GET_EXTENDED_FUSE_BITS));
#endif #endif
// Return device type // Return device type