# HG changeset patch # User Declan Rieb # Date 1538964179 21600 # Sun Oct 07 20:02:59 2018 -0600 # Node ID 1bfd33b09f56ab7b6e5640ab4a6fb6be66ac90b5 # Parent 90aaabf28d2961dd008ec02c5f04afa114b568b8 [ft1d] Prevent failure when radio-preset entry is in banks. Fixes #5167 Error was first described in Yaesu FT2D and exists in FT-1D. Radios can be manually configured to use preset frequencies. CHIRP will now ignore such entries; CHIRP cannot change but will LOG.warn them. #5167 diff --git a/chirp/drivers/ft1d.py b/chirp/drivers/ft1d.py --- a/chirp/drivers/ft1d.py +++ b/chirp/drivers/ft1d.py @@ -128,6 +128,15 @@ } dtmf[10]; #seekto 0x154a; +// These "channels" seem to actually be a structure: +// first five bits are flags +// 0 Unused (1=entry is unused) +// 1 SW Broadcast +// 2 VHF Marine +// 3 WX (weather) +// 4 ? a mode? ? +// 11 bits of index into frequency tables +// struct { u16 channel[100]; } bank_members[24]; @@ -449,6 +458,9 @@ for channel in self._channel_numbers_in_bank(bank): chosen_bank[0] = bank.index chosen_mr[0] = channel + if channel & 0x7000 <> 0: + # Ignore preset channels without comment DAR + break if not flags[channel].nosubvfo: chosen_bank[1] = bank.index chosen_mr[1] = channel @@ -488,6 +500,8 @@ empty = 0 for index, channel_number in enumerate(sorted(channels_in_bank)): _members.channel[index] = channel_number - 1 + if channel_number & 0x7000 <> 0: + LOG.warn ("Bank %d uses Yaesu preset frequency id=%04X. Chirp cannot see or change that entry." % (bank.index, channel_number)) empty = index + 1 for index in range(empty, len(_members.channel)): _members.channel[index] = 0xFFFF