Skip to content

Commit

Permalink
mouse fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paulh002 committed Jul 8, 2023
1 parent 9859faf commit edf301a
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bld/
[Ll]og/
[Ll]ogs/
**/.visualgdb/
**/.vscode/
**/sdrberry-cppcheck-build-dir
**/doc
**/archive
Expand Down
2 changes: 0 additions & 2 deletions AudioInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ void AudioInput::ToneBuffer()
f = (Sample) Nexttone();
}
buf.push_back(f);
if (m_stereo)
buf.push_back(f);
}
databuffer->push(move(buf));
}
Expand Down
6 changes: 3 additions & 3 deletions Mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,22 @@ bool Mouse::read_mouse_event()

MouseState Mouse::GetMouseState()
{
int bytes;
int bytes, count = 0;

state.MouseActivity = false;
state.Rotated = 0;
if (m_fd > 0)
{
bytes = read(m_fd, (void *)&mouse_event, sizeof(struct input_event));
while (bytes != -1)
while (bytes > 0)
{
if (mouse_event.type == EV_REL && mouse_event.code == REL_WHEEL)
{
vfo.step_vfo(step * mouse_event.value);
state.Rotated = mouse_event.value;
}

if (mouse_event.type == EV_REL && mouse_event.code == REL_X)
if (mouse_event.type == EV_REL && mouse_event.code == REL_X )
{
state.x = state.x + mouse_event.value;
if (state.x >= screenWidth)
Expand Down
8 changes: 4 additions & 4 deletions gui_cal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ void gui_cal::hide(bool hide)
}
}

float gui_cal::getRxPhase() { return (float)calRxPhase / 1000.0; }
float gui_cal::getRxGain() { return 1.0 + (float)calRxGain / 1000.0; }
float gui_cal::getTxPhase() { return (float)calTxPhase / 1000.0; }
float gui_cal::getTxGain() { return 1.0 + (float)calTxGain / 1000.0; }
float gui_cal::getRxPhase() { return (float)calRxPhase / 2500.0; }
float gui_cal::getRxGain() { return 1.0 + (float)calRxGain / 2500.0; }
float gui_cal::getTxPhase() { return (float)calTxPhase / 500.0; }
float gui_cal::getTxGain() { return 1.0 + (float)calTxGain / 500.0; }

void gui_cal::SetCalibrationBand(int bandIndex)
{
Expand Down
2 changes: 1 addition & 1 deletion install/buster-7inch rpi/cmdline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
console=serial0,115200 console=tty1 root=PARTUUID=14bb16d1-02 rootfstype=ext4 fsck.repair=yes rootwait vt.global_cursor_default=0
console=serial0,115200 console=tty1 root=PARTUUID=14bb16d1-02 rootfstype=ext4 fsck.repair=yes rootwait vt.global_cursor_default=0 usbhid.mousepoll=2
13 changes: 13 additions & 0 deletions install/hifiberry/hifiberry.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[si5351]
correction = "121000"
correctiontx = "132500"
rxdrive = "8"
txdrive = "8"
mode = "IQMULTI"
multiplier = 1
disabletxoutput = "off"

[sound]
device = "snd_rpi_hifiberry_dacplusadcpro"
samplerate = "192000"
input = "diff"
139 changes: 139 additions & 0 deletions install/hifiberry/sdrberry_settings-single.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
[Agc]
fast = {"10", "100"}
medium = {"50", "250"}
mode = "1"
ratio = "10"
sdrplay = "off"
slow = {"100", "500"}
threshold = "10"

[Audio]
device = "USB Audio Device"

[CAT]
USB = "/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0"

[ESP32]
mac address = ""

[FreeDV]

[Radio]
AGC = "off"
band = "ham"
drive = "100"
gain = "0"
if-gain = "40"
micgain = "73"
noise = "4"
noisefloor = "35"
volume = "85"
waterfallsize = "3"

[SDR Receivers]
default = "hifiberry"
receivers = {"hifiberry", "radioberry", "plutosdr", "rtlsdr", "sdrplay", "hackrf"}

[Speech]
bass = "4"
fast = {"12", "120"}
medium = {"50", "250"}
mode = "0"
ratio = "12"
slow = {"100", "500"}
threshold = "0"
treble = "0"

[VFO1]
Mode = "lsb"
freq = "7074000"

[VFO2]
Mode = "LSB"
freq = "3500000"

[bands]
f_high = {"1880000", "3800000", "5450000", "7200000", "10350000", "14350000", "18168000", "21450000", "28000000", "29000000", "52000000", "70500000", "107000000", "146000000", "436000000", "1300000000", "2400000000"}
f_low = {"1800000", "3500000", "5350000", "7000000", "10000000", "14000000", "18068000", "21000000", "26500000", "28000000", "50000000", "70000000", "83000000", "144000000", "430000000", "1240000000", "2320000000"}
labels = {"m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "cm", "cm", "cm"}
meters = {"160", "80", "60", "40", "30", "20", "17", "15", "11", "10", "6", "4", "3", "2", "70", "23", "13"}
mode = {"lsb", "lsb", "lsb", "lsb", "lsb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb"}

[filter]
address = {"32", "33", "63"}
command_rx = {"21", "137", "24", "22", "133", "144", "21", "137", "48", "25", "133", "48", "37", "133", "20", "21", "134", "20", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18"}
command_tx = {"21", "73", "8", "22", "69", "128", "21", "73", "32", "25", "69", "32", "21", "73", "4", "21", "70", "2", "21", "70", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2"}
i2cdevice = "pcf8574"
passthrough_rx = {"21", "137", "18"}
passthrough_tx = {"21", "73", "2"}

[wsjtx]
73 = ""
bandwidth = "4500"
call = "PA0PHH"
freqFT8 = {"1840", "3573", "5357", "7074", "10133", "14074", "18100", "21074", "27074", "28074", "28077"}
freqFT4 = {"1840","3568","3575","7047","10140","14080","18104","21140","27000","28180"}
locator = "JO22"
reserverd = {"POTA"}
rx = "1200"
tx = "1000"

[hackrf]
bandwidth = "1750000"
gain = "50"
if-gain = "10"

[hifiberry]
dc = "1"
drive = "100"
gain = "0"
if-gain = "40"
rx-gain-correction = {"4", "12", "21", "25", "35", "61", "78", "93", "114", "93", "0", "0", "0", "0", "0", "0", "0"}
rx-phase-correction = {"-1", "1", "2", "-1", "8", "8", "21", "35", "42", "66", "0", "0", "0", "0", "0", "0", "0"}
samplerate = "192"
samplerate_tx = "192"
span = "96"
tx-gain-correction = {14, 10, 5, 8, 14, 14, 38, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0}
tx-phase-correction = {-12, -25, -20, -16, -12, -5, -33, -27, 0, 0, 0, 0, 0, 0, 0, 0, 0}

[input]
mousexx = "Mouse"
touchscreen = "raspberrypi-ts"

[preselect]
buttons = {"3630000", "7073000", "10100000", "14250000", "14250000"}

[probes]
hifiberry = "driver=hifiberry"
pluto = "driver=plutosdr,hostname=192.168.100.1"
radioberry = "driver=radioberry"
rtlsdr = "driver=rtlsdr"
sdrplay = "driver=sdrplay"

[radioberry]
drive = "89"
gain = "3"
if-gain = "60"
samplerate = "384"
samplerate_tx = "48"
span = "96"

[rtlsdr]
gain = "40"
if-gain = "30"

[samplerate]
hackrf = "4000"
plutosdr = "1000"
radioberry = "48"
rtlsdr = "1000"
sdrplay = "1000"

[samplerate_tx]
hackrf = "4000"
radioberry = "48"

[sdrplay]
AGC = "off"
gain = "40"
if-gain = "30"
83 changes: 49 additions & 34 deletions install/hifiberry/sdrberry_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,92 +16,96 @@ USB = "/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0
[ESP32]
mac address = ""

[FreeDV]

[Radio]
AGC = "off"
band = "ham"
drive = "89"
gain = "3"
if-gain = "60"
micgain = "55"
volume = "57"
drive = "100"
gain = "0"
if-gain = "40"
micgain = "73"
noise = "4"
noisefloor = "35"
volume = "85"
waterfallsize = "3"

[SDR Receivers]
default = "hifiberry"
receivers = {"hifiberry","radioberry", "plutosdr", "rtlsdr", "sdrplay", "hackrf"}
receivers = {"hifiberry", "radioberry", "plutosdr", "rtlsdr", "sdrplay", "hackrf"}

[Speech]
bass = "4"
fast = {"12", "120"}
medium = {"50", "250"}
mode = "1"
mode = "0"
ratio = "12"
slow = {"100", "500"}
threshold = "0"
treble = "0"

[VFO1]
Mode = "lsb"
freq = "3600000"
freq = "7074000"

[VFO2]
Mode = "LSB"
freq = "3500000"

[bands]
f_high = {"1880000", "3800000", "5450000", "7200000", "10150000", "14350000", "18168000", "21450000", "29000000", "52000000", "70500000", "107000000", "146000000", "436000000", "1300000000", "2400000000"}
f_low = {"1800000", "3500000", "5350000", "7000000", "10100000", "14000000", "18068000", "21000000", "28000000", "50000000", "70000000", "83000000", "144000000", "430000000", "1240000000", "2320000000"}
labels = {"m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "cm", "cm", "cm"}
meters = {"160", "80", "60", "40", "30", "20", "17", "15", "10", "6", "4", "3", "2", "70", "23", "13"}
mode = {"lsb", "lsb", "lsb", "lsb", "lsb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb"}
f_high = {"1880000", "3800000", "5450000", "7200000", "10350000", "14350000", "18168000", "21450000", "28000000", "29000000", "52000000", "70500000", "107000000", "146000000", "436000000", "1300000000", "2400000000"}
f_low = {"1800000", "3500000", "5350000", "7000000", "10000000", "14000000", "18068000", "21000000", "26500000", "28000000", "50000000", "70000000", "83000000", "144000000", "430000000", "1240000000", "2320000000"}
labels = {"m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "cm", "cm", "cm"}
meters = {"160", "80", "60", "40", "30", "20", "17", "15", "11", "10", "6", "4", "3", "2", "70", "23", "13"}
mode = {"lsb", "lsb", "lsb", "lsb", "lsb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb", "usb"}

[filter]
address = {"56", "57", "63"}
command_rx = {"21", "137", "24", "22", "133", "144", "21", "137", "48", "25", "133", "48", "21", "137", "20", "37", "133", "20", "21", "134", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18"}
command_tx = {"21", "73", "8", "22", "69", "128", "21", "73", "32", "25", "69", "32", "21", "73", "4", "37", "69", "2", "21", "70", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2"}
address = {"32", "33", "63"}
command_rx = {"21", "137", "24", "22", "133", "144", "21", "137", "48", "25", "133", "48", "37", "133", "20", "21", "134", "20", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18", "21", "137", "18"}
command_tx = {"21", "73", "8", "22", "69", "128", "21", "73", "32", "25", "69", "32", "21", "73", "4", "21", "70", "2", "21", "70", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2", "21", "73", "2"}
i2cdevice = "pcf8574"
passthrough_rx = {"21", "137", "18"}
passthrough_tx = {"21", "73", "2"}

[ft8]
call = "PA0PHH"
freq = {"1840", "3573", "5357", "7073", "10133", "14074", "18100", "21074", "28074"}
locator = "JO22"

[hackrf]
bandwidth = "1750000"
gain = "50"
if-gain = "10"

[hifiberry]
dc = "1"
drive = "100"
gain = "0"
if-gain = "40"
rx-gain-correction = {4, -11, 8, 16, 41, 81, 98, 107, 92, 115, 0, 0, 0, 0, 0, 0, 0}
rx-phase-correction = {-1, -16, 4, 24, 36, 48, 145, 150, 144, 148, 0, 0, 0, 0, 0, 0, 0}
samplerate = "192"
samplerate_tx = "192"
span = "96"
tx-gain-correction = {"14", "10", "5", "8", "14", "14", "38", "12", "0", "0", "0", "0", "0", "0", "0", "0", "0"}
tx-phase-correction = {"-12", "-25", "-20", "-16", "-12", "-5", "-33", "-27", "0", "0", "0", "0", "0", "0", "0", "0", "0"}

[input]
mouse = "Mouse"
mousexx = "Mouse"
touchscreen = "raspberrypi-ts"

[preselect]
buttons = {"3630000", "7073000", "10100000", "14250000", "14250000"}

[probes]
hifiberry = "driver=hifiberry"
pluto = "driver=plutosdr,hostname=192.168.100.1"
radioberry = "driver=radioberry"
rtlsdr = "driver=rtlsdr"
sdrplay = "driver=sdrplay"
hifiberry = "driver=hifiberry"

[hifiberry]
drive = "89"
gain = "3"
if-gain = "60"
samplerate="192"
samplerate_tx="192"
span="96"

[radioberry]
drive = "89"
gain = "3"
if-gain = "60"
samplerate="384"
samplerate_tx="48"
span="96"
samplerate = "384"
samplerate_tx = "48"
span = "96"

[rtlsdr]
gain = "40"
Expand All @@ -122,3 +126,14 @@ radioberry = "48"
AGC = "off"
gain = "40"
if-gain = "30"

[wsjtx]
73 = ""
bandwidth = "4500"
call = "PA0PHH"
freqFT4 = {"1840", "3568", "3575", "7047", "10140", "14080", "18104", "21140", "27000", "28180"}
freqFT8 = {"1840", "3573", "5357", "7074", "10133", "14074", "18100", "21074", "27074", "28074", "28077"}
locator = "JO22"
reserverd = {"POTA"}
rx = "1200"
tx = "1000"
5 changes: 5 additions & 0 deletions install/mouse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if the mouse is slaggy add to boot/cmdline.txt
usbhid.mousepoll=2

or
usbhid.mousepoll=0
2 changes: 1 addition & 1 deletion sdrberry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ int main(int argc, char *argv[])
guiQueue.pop_front();
}
gui_mutex.unlock();
usleep(1000);
usleep(500);
}
audio_output->close();
delete audio_output;
Expand Down

0 comments on commit edf301a

Please sign in to comment.