Change Details
| tornado/fw/sim/alg.c |
| 12 | 12 | #define F 2 /* rotational speed in Hz */ |
| 13 | 13 | #define R 0.46 /* radius of accelerometer orbit */ |
| 14 | 14 | |
| 15 | | #define H (G/2) /* hysteresis, in accelerometer units */ |
| 15 | #define H (G/3) /* hysteresis, in accelerometer units */ |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | /* noise pattern: frequency, amplitude pairs */ |
| ... | ... | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| 44 | | #define E_SHIFT 6 /* ~ 0.06 */ |
| 45 | | #define M_SHIFT 10 /* ~ 2/S */ |
| 44 | #define E_SHIFT 8 /* ~ 0.06 */ |
| 45 | #define M_SHIFT 11 /* ~ 2/S */ |
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | static void process(unsigned v) |
| 49 | 49 | { |
| 50 | | static uint16_t e = MID << E_SHIFT; |
| 50 | static uint32_t e = MID << E_SHIFT; |
| 51 | 51 | static uint32_t m = MID << M_SHIFT; |
| 52 | 52 | static bool up = 0; |
| 53 | 53 | int d; |
Download the corresponding diff file