diff --git a/bin/myevic.bin b/bin/myevic.bin index 0fb7c426..fd6dd64c 100755 Binary files a/bin/myevic.bin and b/bin/myevic.bin differ diff --git a/bin/myevic_enc.bin b/bin/myevic_enc.bin index 13fc8e40..c99219d8 100755 Binary files a/bin/myevic_enc.bin and b/bin/myevic_enc.bin differ diff --git a/src/dataflash.c b/src/dataflash.c index 2c60cb33..aeecb028 100644 --- a/src/dataflash.c +++ b/src/dataflash.c @@ -117,6 +117,9 @@ __myevic__ void FMCReadCounters() uint32_t pc, v; uint32_t idx; + SYS_UnlockReg(); + FMC_ENABLE_ISP(); + for ( idx = 0 ; idx < FMC_FLASH_PAGE_SIZE ; idx += 4 ) { v = FMC_Read( DATAFLASH_PUFFCNTR_BASE + idx ); @@ -136,6 +139,9 @@ __myevic__ void FMCReadCounters() dfPuffCount = 0; dfTimeCount = 0; } + + FMC_DISABLE_ISP(); + SYS_LockReg(); } @@ -638,11 +644,11 @@ __myevic__ void InitDataFlash() } } - FMCReadCounters(); - FMC_DISABLE_ISP(); SYS_LockReg(); + FMCReadCounters(); + SetProductID(); if ( ISVTWO || ISEVICAIO || ISCUBOMINI || ISEVICBASIC ) diff --git a/src/eh.c b/src/eh.c index 05cb5528..0a8eb02c 100644 --- a/src/eh.c +++ b/src/eh.c @@ -485,16 +485,17 @@ __myevic__ void EventHandler() if ( dfStatus.phpct ) { PreheatPower = dfPower * dfPreheatPwr / 100; - if ( PreheatPower > MaxPower ) - { - PreheatPower = MaxPower; - } } else { PreheatPower = dfPreheatPwr; } + if ( PreheatPower > AtoMaxPower ) + { + PreheatPower = AtoMaxPower; + } + TargetVolts = GetVoltsForPower( PreheatPower ); } else if ( pwr <= 300 )