00001 #include <math.h>
00002 #include "d_lpc10.h"
00003
00004
00005
00006
00007
00008 #define MIDTAP 1
00009 #define MAXTAP 4
00010
00011 INT16 Rrandom( VOID )
00012 {
00013 INT16 the_random;
00014 static INT16 y[MAXTAP + 1] =
00015 {-21161, -8478, 30892, -10216, 16950};
00016 static INDEX j = MIDTAP;
00017 static INDEX k = MAXTAP;
00018
00019
00020
00021
00022 y[k] += y[j];
00023
00024
00025
00026
00027
00028
00029
00030 the_random = y[k];
00031
00032 if (!k)
00033 k = MAXTAP;
00034 else
00035 k--;
00036
00037 if (!j)
00038 j = MAXTAP;
00039 else
00040 j--;
00041
00042 return the_random;
00043 }
00044
00045