Skip to content

Commit

Permalink
ga510v2: Fix power level handling
Browse files Browse the repository at this point in the history
The GA510v2 has two bits for a three-level power value, unlike the
UV-17 it inherits from. This splits the channel def apart to fix that.

Fixes #11475
  • Loading branch information
kk7ds committed Aug 13, 2024
1 parent 318c4ca commit a8cdf67
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
6 changes: 4 additions & 2 deletions chirp/drivers/baofeng_uv17.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class UV17(baofeng_uv17Pro.UV17Pro):
LIST_MODE = ["Name", "Frequency"]
CHANNELS = 999

MEM_DEFS = """
CHANNEL_DEF = """
struct channel {
lbcd rxfreq[4];
lbcd txfreq[4];
Expand All @@ -215,6 +215,8 @@ class UV17(baofeng_uv17Pro.UV17Pro):
scan:1;
u8 unknown4;
};
"""
MEM_DEFS = """
struct channelname {
char name[11];
};
Expand Down Expand Up @@ -320,7 +322,7 @@ class UV17(baofeng_uv17Pro.UV17Pro):
struct ani ani;
"""
MEM_FORMAT = MEM_DEFS + MEM_LAYOUT
MEM_FORMAT = CHANNEL_DEF + MEM_DEFS + MEM_LAYOUT

def _make_frame(self, cmd, addr, length, data=""):
"""Pack the info in the header format"""
Expand Down
22 changes: 21 additions & 1 deletion chirp/drivers/ga510.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,26 @@ class RadioddityGA510v2(baofeng_uv17.UV17):
LIST_MODE = ["Name", "Frequency"]
CHANNELS = 128

CHANNEL_DEF = """
struct channel {
lbcd rxfreq[4];
lbcd txfreq[4];
u8 unused1;
ul16 rxtone;
ul16 txtone;
u8 unknown1:1,
bcl:1,
pttid:2,
unknown2:1,
wide:1,
lowpower:2;
u8 scode:4,
unknown3:3,
scan:1;
u8 unknown4;
};
"""

MEM_LAYOUT = """
#seekto 0x1000;
struct settings settings;
Expand All @@ -1157,6 +1177,6 @@ class RadioddityGA510v2(baofeng_uv17.UV17):
#seekto 0x400B;
struct channelname names1[128];
"""
MEM_FORMAT = baofeng_uv17.UV17.MEM_DEFS + MEM_LAYOUT
MEM_FORMAT = CHANNEL_DEF + baofeng_uv17.UV17.MEM_DEFS + MEM_LAYOUT

_has_workmode_support = False

0 comments on commit a8cdf67

Please sign in to comment.