Remembering last selected channel in a zone ?

Discussions related to the firmware code development
Post Reply
ok1pt
Posts: 45
Joined: Mon Jul 20, 2020 3:38 am

Remembering last selected channel in a zone ?

Post by ok1pt » Tue Oct 13, 2020 6:24 am

Hi!
I'm missing a feature of remembering and automatically setting the selected (recently used) channel per zone. Zones always come with 1st channel selected.
I looked how to implmement it, but I need some hints. I didn't find a place in struct_codeplugZone_t, and there are also commented out functions codeplugZoneGetSelected() and codeplugZoneSetSelected(), which would be probably usable for this purpose, with a comment "Use our own non volatile storage instead", but without any remark HOW to do it, where is this storage, which structures does it contain etc. Is any programmer's help about this topic available ? Maybe just reference to some .h or .c files where it is being used would be enough...
With regards, Pavel

VK3KYY
Posts: 3067
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia
Contact:

Re: Remembering last selected channel in a zone ?

Post by VK3KYY » Tue Oct 13, 2020 10:43 pm

The maximum non-volatile storage space is 128 bytes.

This practical maximum is for multiple reasons, including page size in the EEPROM, operation of the RD-5R which has to immediately save the non-volatile data when every its changed, and use of a small unassigned section of the codeplug data section for the non-volatile storage.

ok1pt
Posts: 45
Joined: Mon Jul 20, 2020 3:38 am

Re: Remembering last selected channel in a zone ?

Post by ok1pt » Wed Oct 14, 2020 4:25 am

VK3KYY wrote:
Tue Oct 13, 2020 10:43 pm
The maximum non-volatile storage space is 128 bytes.
Oh, so this isn't too much!
So, do you think it's not doable at all, or, can we do it for a limited number of zones only (say first 8, if we can dedicate 8 bytes from the storage) ? How much is this storage occupied now and what do you plan to use it in the future ? This is the place which is cleared after config magic number change ?

WIth regards, Pavel

VK3KYY
Posts: 3067
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia
Contact:

Re: Remembering last selected channel in a zone ?

Post by VK3KYY » Wed Oct 14, 2020 6:08 am

You could do it in your radio, but I won't accept PRs that use up the precious non volatile storage for uses like this

You could store it in RAM, but I don't have time to explain how how to implement that and what you need to save and restore, as its a feature I don't need.

User avatar
F1RMB
Posts: 836
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France
Contact:

Re: Remembering last selected channel in a zone ?

Post by F1RMB » Wed Oct 14, 2020 6:19 am

ok1pt wrote:
Wed Oct 14, 2020 4:25 am
VK3KYY wrote:
Tue Oct 13, 2020 10:43 pm
The maximum non-volatile storage space is 128 bytes.
Oh, so this isn't too much!
So, do you think it's not doable at all, or, can we do it for a limited number of zones only (say first 8, if we can dedicate 8 bytes from the storage) ? How much is this storage occupied now and what do you plan to use it in the future ? This is the place which is cleared after config magic number change ?

WIth regards, Pavel
Why such an arbitrary value of 8 ? Why not 9, or 2.
As Roger explained, and me also few times, space is limited and precious, and this kind of feature is useless in regard of required resources, as all Zones has to be covered.

BTW, one byte is not enough to store channel number, but two.


Cheers.
---
Daniel
73 de Daniel.

VK3KYY
Posts: 3067
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia
Contact:

Re: Remembering last selected channel in a zone ?

Post by VK3KYY » Wed Oct 14, 2020 6:22 am

You'd also need to store the current index into the TG list and possibly other data e.g. TS override , TG override so its probably at least 7 or 8 bytes per zone. I forgot how many zones there are, possibly 76.

Storing just a few zones would be very confusing to the operator.

Post Reply