Use G_PI instead of defining our own version of PI.
This commit is contained in:
parent
562a34908e
commit
bbc42811d0
|
@ -225,7 +225,7 @@ static void generate_analog_pattern(struct analog_gen *ag, uint64_t sample_rate)
|
||||||
for (i = 0; i < num_samples; i++) {
|
for (i = 0; i < num_samples; i++) {
|
||||||
t = (double) i / (double) sample_rate;
|
t = (double) i / (double) sample_rate;
|
||||||
ag->pattern_data[i] = ag->amplitude *
|
ag->pattern_data[i] = ag->amplitude *
|
||||||
sin(2 * PI * frequency * t);
|
sin(2 * G_PI * frequency * t);
|
||||||
}
|
}
|
||||||
|
|
||||||
ag->num_samples = num_samples;
|
ag->num_samples = num_samples;
|
||||||
|
@ -238,8 +238,8 @@ static void generate_analog_pattern(struct analog_gen *ag, uint64_t sample_rate)
|
||||||
|
|
||||||
for (i = 0; i < num_samples; i++) {
|
for (i = 0; i < num_samples; i++) {
|
||||||
t = (double) i / (double) sample_rate;
|
t = (double) i / (double) sample_rate;
|
||||||
ag->pattern_data[i] = (2 * ag->amplitude / PI) *
|
ag->pattern_data[i] = (2 * ag->amplitude / G_PI) *
|
||||||
asin(sin(2 * PI * frequency * t));
|
asin(sin(2 * G_PI * frequency * t));
|
||||||
}
|
}
|
||||||
|
|
||||||
ag->num_samples = num_samples;
|
ag->num_samples = num_samples;
|
||||||
|
|
|
@ -307,7 +307,7 @@ static void make_heartbeat(uint8_t *table, int len)
|
||||||
len >>= 3;
|
len >>= 3;
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
for (j = 0; j < len; j++)
|
for (j = 0; j < len; j++)
|
||||||
*table++ = sin(j * PI / len) * 255;
|
*table++ = sin(j * G_PI / len) * 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int configure_led(const struct sr_dev_inst *sdi)
|
static int configure_led(const struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -156,8 +156,6 @@
|
||||||
((uint8_t*)(p))[2] = (uint8_t)((x)>>16); \
|
((uint8_t*)(p))[2] = (uint8_t)((x)>>16); \
|
||||||
((uint8_t*)(p))[3] = (uint8_t)((x)>>24); } while (0)
|
((uint8_t*)(p))[3] = (uint8_t)((x)>>24); } while (0)
|
||||||
|
|
||||||
#define PI 3.1415926535897932384626433832795
|
|
||||||
|
|
||||||
/* Portability fixes for FreeBSD. */
|
/* Portability fixes for FreeBSD. */
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#define LIBUSB_CLASS_APPLICATION 0xfe
|
#define LIBUSB_CLASS_APPLICATION 0xfe
|
||||||
|
|
Loading…
Reference in New Issue