Project

General

Profile

Bug #1013 » 0001-uv5r-broadcast-fm-settings.patch

Peter Ross, 07/24/2013 02:42 AM

View differences:

chirp/uv5r.py
unknown5:6;
} vfob;
#seekto 0x0F48;
struct {
char fm65_line1[7];
char fm65_line2[7];
u16 freq;
char fm76_line1[7];
char fm76_line2[7];
} broadcast;
#seekto 0x1000;
struct {
u8 unknown1[8];
......
DTMFSPEED_LIST[self._memobj.ani.dtmfoff]))
dtmf.append(rs)
broadcast = RadioSettingGroup("broadcast", "Broadcast FM Settings")
_msg = self._memobj.broadcast
rs = RadioSetting("broadcast.fm65_line1", "65-75M Message 1",
RadioSettingValueString(0, 7, _filter(_msg.fm65_line1)))
broadcast.append(rs)
rs = RadioSetting("broadcast.fm65_line2", "65-75M Message 2",
RadioSettingValueString(0, 7, _filter(_msg.fm65_line2)))
broadcast.append(rs)
rs = RadioSetting("broadcast.fm76_line1", "76-108M Message 1",
RadioSettingValueString(0, 7, _filter(_msg.fm76_line1)))
broadcast.append(rs)
rs = RadioSetting("broadcast.fm76_line2", "76-108M Message 2",
RadioSettingValueString(0, 7, _filter(_msg.fm76_line2)))
broadcast.append(rs)
def convert_broadcast_value_to_freq(value):
freq = int(650 + value) * 100000
return chirp_common.format_freq(freq)
def apply_broadcast_freq(setting, obj):
value = chirp_common.parse_freq(str(setting.value)) / 100000 - 650
obj.freq = max(0, min(value, 0x1AE))
rs = RadioSetting("broadcast.freq", "Frequency (MHz)",
RadioSettingValueString(0, 10, convert_broadcast_value_to_freq(_msg.freq)))
rs.set_apply_callback(apply_broadcast_freq, _msg)
broadcast.append(rs)
group.append(broadcast)
return group
def get_settings(self):
(2-2/2)