fixed some delays

This commit is contained in:
Luxferre
2026-01-11 14:57:44 +02:00
parent e8156e49e5
commit c6a026846a
2 changed files with 24 additions and 18 deletions
+21
View File
@@ -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