Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
094bb2c1e8 | ||
|
|
9aee76a3a5 |
@@ -89,7 +89,8 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
|
||||
int firstnobang = -1;
|
||||
int freq1, freq2, time;
|
||||
int modulate = 0;
|
||||
float db, gain;
|
||||
float db = 1.0;
|
||||
float gain;
|
||||
int used = 0;
|
||||
dup = strdup(t->data);
|
||||
s = strtok(dup, ",");
|
||||
@@ -112,16 +113,13 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
|
||||
} else if (sscanf(s, "%d+%d", &freq1, &freq2) == 2) {
|
||||
PRINT_DEBUG("f1+f2 format: %d, %d\n", freq1, freq2);
|
||||
time = 0;
|
||||
db = 1.0;
|
||||
} else if (sscanf(s, "%d*%d", &freq1, &freq2) == 2) {
|
||||
PRINT_DEBUG("f1+f2 format: %d, %d\n", freq1, freq2);
|
||||
modulate = 1;
|
||||
time = 0;
|
||||
db = 1.0;
|
||||
} else if (sscanf(s, "%d/%d", &freq1, &time) == 2) {
|
||||
PRINT_DEBUG("f1/time format: %d, %d\n", freq1, time);
|
||||
freq2 = 0;
|
||||
db = 1.0;
|
||||
} else if (sscanf(s, "%d@/%d", &freq1, &time) == 2) {
|
||||
/* The "@" character has been added to enable an
|
||||
* approximately -20db tone generation of any frequency This has been done
|
||||
@@ -136,7 +134,6 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
|
||||
firstnobang = *count;
|
||||
freq2 = 0;
|
||||
time = 0;
|
||||
db = 1.0;
|
||||
} else {
|
||||
fprintf(stderr, "tone component '%s' of '%s' is a syntax error\n", s,t->data);
|
||||
return -1;
|
||||
|
||||
@@ -67,6 +67,8 @@ static void xusb_init();
|
||||
* variable of that name. Existing options:
|
||||
*
|
||||
* - "use-clear-halt" -- force USB "clear_halt" operation during
|
||||
* device initialization (this is the default)
|
||||
* - "no-use-clear-halt" -- force no USB "clear_halt" operation during
|
||||
* device initialization
|
||||
* - "no-lock" -- prevent using global sempahore to serialize libusb
|
||||
* initialization. Previously done via "XUSB_NOLOCK"
|
||||
@@ -888,7 +890,7 @@ static void xusb_init()
|
||||
}
|
||||
|
||||
/* XTALK option handling */
|
||||
static int use_clear_halt = 0;
|
||||
static int use_clear_halt = 1;
|
||||
static int libusb_no_lock = 0;
|
||||
|
||||
static int xtalk_one_option(const char *option_string)
|
||||
@@ -897,6 +899,10 @@ static int xtalk_one_option(const char *option_string)
|
||||
use_clear_halt = 1;
|
||||
return 0;
|
||||
}
|
||||
if (strcmp(option_string, "no-use-clear-halt") == 0) {
|
||||
use_clear_halt = 0;
|
||||
return 0;
|
||||
}
|
||||
if (strcmp(option_string, "no-lock") == 0) {
|
||||
libusb_no_lock = 1;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user