[Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Deluge/Deluge/TOSBoot/msp430
InternalFlashC.nc, 1.1, 1.2
Jonathan Hui
jwhui at users.sourceforge.net
Mon Jun 13 22:43:08 PDT 2005
- Previous message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/delugetools
Rebooter.java, 1.4, 1.5
- Next message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Deluge/Deluge/TOSBoot/build/telosb
app.c, 1.10, 1.11 ident_flags.txt, 1.10, 1.11 main.exe, 1.10,
1.11 main.ihex, 1.10, 1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/TOSBoot/msp430
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28459/msp430
Modified Files:
InternalFlashC.nc
Log Message:
- Fixed critical bug that would cause InternalFlash to misbehave after
128 writes. Wasn't casting a variable to int8_t before testing its
sign.
- Made version -1 be an invalid version number so that an erased but
not yet written flash segment will not be mistaken as a valid segment.
Index: InternalFlashC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/TOSBoot/msp430/InternalFlashC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** InternalFlashC.nc 17 May 2005 20:48:24 -0000 1.1
--- InternalFlashC.nc 14 Jun 2005 05:43:06 -0000 1.2
***************
*** 53,56 ****
--- 53,57 ----
IFLASH_SEG0_VNUM_ADDR = 0x107f,
IFLASH_SEG1_VNUM_ADDR = 0x10ff,
+ IFLASH_INVALID_VNUM = -1,
};
***************
*** 58,73 ****
int8_t vnum0 = *(int8_t*)IFLASH_SEG0_VNUM_ADDR;
int8_t vnum1 = *(int8_t*)IFLASH_SEG1_VNUM_ADDR;
! return !( (vnum0 - vnum1) > 0 );
}
command result_t InternalFlash.write(void* addr, void* buf, uint16_t size) {
! volatile uint8_t *newPtr;
! uint8_t *oldPtr;
! uint8_t *bufPtr = (uint8_t*)buf;
uint16_t i;
addr += IFLASH_OFFSET;
! newPtr = oldPtr = (uint8_t*)IFLASH_OFFSET;
if (chooseSegment()) {
oldPtr += IFLASH_SIZE;
--- 59,79 ----
int8_t vnum0 = *(int8_t*)IFLASH_SEG0_VNUM_ADDR;
int8_t vnum1 = *(int8_t*)IFLASH_SEG1_VNUM_ADDR;
! if (vnum0 == IFLASH_INVALID_VNUM)
! return 1;
! else if (vnum1 == IFLASH_INVALID_VNUM)
! return 0;
! return ( (int8_t)(vnum0 - vnum1) < 0 );
}
command result_t InternalFlash.write(void* addr, void* buf, uint16_t size) {
! volatile int8_t *newPtr;
! int8_t *oldPtr;
! int8_t *bufPtr = (int8_t*)buf;
! int8_t version;
uint16_t i;
addr += IFLASH_OFFSET;
! newPtr = oldPtr = (int8_t*)IFLASH_OFFSET;
if (chooseSegment()) {
oldPtr += IFLASH_SIZE;
***************
*** 90,94 ****
*newPtr = *bufPtr++;
}
! *newPtr = *oldPtr+1;
FCTL1 = FWKEY;
--- 96,103 ----
*newPtr = *bufPtr++;
}
! version = *oldPtr + 1;
! if (version == IFLASH_INVALID_VNUM)
! version++;
! *newPtr = version;
FCTL1 = FWKEY;
- Previous message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/delugetools
Rebooter.java, 1.4, 1.5
- Next message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Deluge/Deluge/TOSBoot/build/telosb
app.c, 1.10, 1.11 ident_flags.txt, 1.10, 1.11 main.exe, 1.10,
1.11 main.ihex, 1.10, 1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-beta-commits
mailing list