fixed some delays
This commit is contained in:
+21
@@ -175,5 +175,26 @@ void wait_for_start_rand() {
|
||||
srand(entropy);
|
||||
}
|
||||
|
||||
/* Generic helper methods */
|
||||
|
||||
/* Array shuffle method */
|
||||
void shuffle(s8 *array, u16 n) {
|
||||
u16 i, j, t;
|
||||
if(n > 1) {
|
||||
for(i=n-1;i>0;i--) {
|
||||
j = (u16) (rand()%(i+1));
|
||||
t = array[j];
|
||||
array[j] = array[i];
|
||||
array[i] = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Delay by n cycles */
|
||||
void delay_cycles(u16 n) {
|
||||
u16 i;
|
||||
for(i=0;i<n;++i);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user