X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fynorsim.c;fp=direct%2Fynorsim.c;h=723b72b453b30f0c0d39e659782efe579d197b2e;hp=6936a9c874e2c9bffb4d995e8ab4d8e870c8fda6;hb=3797c6edfef9bef80f70001b14ee636b0309895a;hpb=bc2cc19f30c43d440187b6b9cfc5d251e7f991b6 diff --git a/direct/ynorsim.c b/direct/ynorsim.c index 6936a9c..723b72b 100644 --- a/direct/ynorsim.c +++ b/direct/ynorsim.c @@ -40,6 +40,7 @@ static __u32 word[YNORSIM_DEV_SIZE_U32]; extern int random_seed; +extern int simulate_power_failure; static void NorError(void) { @@ -80,7 +81,8 @@ static void ynorsim_MaybePowerFail(void) remaining_ops--; - if(remaining_ops < 1){ + if(simulate_power_failure && + remaining_ops < 1){ printf("Simulated power failure after %d operations\n",nops_so_far); ynorsim_PowerFail(); } @@ -92,7 +94,7 @@ static void ynorsim_Ready(void) return; srand(random_seed); remaining_ops = 1000000000; - remaining_ops = (rand() % 10000) * 3000 * YNORSIM_BIT_CHANGES; + remaining_ops = (rand() % 10000) * 300 * YNORSIM_BIT_CHANGES; ynorsim_RestoreImage(); }