[chirp_devel] [PATCH][UV-5R] Add VFO Frequency Presets to Work Mode Tab [#467]
Jim Unroe
Mon Jan 28 15:17:15 PST 2013
Maybe I'm missing something. If the user has to enter the frequency as a
floating point number, how does storing it as an integer help? When the
user's input is changed to and saved as in integer, wouldn't the same error
occur?
Jim
On Mon, Jan 28, 2013 at 11:24 AM, Andrew Errington <erringtona at gmail.com>wrote:
> On Mon, 28 Jan 2013 19:33:44 Jim Unroe wrote:
> > I'm don't believe I understand what "try with integers" means.
> >
> > Here's the portion of code that I think the problem is in. More
> > specifically the 'def convert_freq_to_bytes(real_freq) part.
> >
> > + def convert_bytes_to_freq(bytes):
> > + real_freq = 0
> > + for byte in bytes:
> > + real_freq = (real_freq * 10) + byte
> > + return real_freq / 100000.0
> > +
> > + def convert_freq_to_bytes(real_freq):
> > + bytes = [ 0 for x in range(0,8) ] # init list with 8
> times 0
> > + real_freq = int(freq * 100000) # it has to be integer
>
> ^^^^
> Don't you mean "real_freq" here, not "freq"?
>
> 73,
>
> Andrew
> _______________________________________________
> chirp_devel mailing list
> chirp_devel at intrepid.danplanet.com
> http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
> Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20130128/fe215c40/attachment-0001.html
More information about the chirp_devel
mailing list