[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] [patch #4020] Avrdude Safemode upgrade
From: |
Colin O'Flynn |
Subject: |
Re: [avrdude-dev] [patch #4020] Avrdude Safemode upgrade |
Date: |
Sun, 18 Sep 2005 14:45:08 -0400 |
User-agent: |
KMail/1.8.2 |
Hey,
> By making it so that one can
> program their fuses when requested and only engage safemode when fuse
> bytes end up changed which were _not_ requested, then that makes
> safemode truly a safety net that stays out of the way until it is
> needed. Win win.
Done in the latest patch. I did it by adding a simple test to the avr.c file
where byte by byte programming is done:
/*
* write a byte of data at the specified address
*/
int avr_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
unsigned long addr, unsigned char data)
{
unsigned char safemode_lfuse;
unsigned char safemode_hfuse;
unsigned char safemode_efuse;
/* If we write the fuses, then we need to tell safemode that they *should*
change */
safemode_memfuses(0, &safemode_lfuse, &safemode_hfuse, &safemode_efuse);
if (strcmp(mem->desc, "lfuse")==0) {
safemode_lfuse = data;
}
if (strcmp(mem->desc, "hfuse")==0) {
safemode_hfuse = data;
}
if (strcmp(mem->desc, "efuse")==0) {
safemode_efuse = data;
}
safemode_memfuses(1, &safemode_lfuse, &safemode_hfuse, &safemode_efuse);
As you can see it just uses the new value as what too look for. I had support
for this before when I originally wrote the function as I planned on adding
it apparently. So here it is, I just needed to add that code.
Regards,
-Colin
Re: [avrdude-dev] [patch #4020] Avrdude Safemode upgrade, Joerg Wunsch, 2005/09/18
[avrdude-dev] [patch #4020] Avrdude Safemode upgrade, Colin O Flynn, 2005/09/17