Selecting "VFO -> New Channel" after power cycle results in the first zone being deleted

Post Reply
EA5JAQ
Posts: 86
Joined: Thu Jul 16, 2020 6:08 am

Selecting "VFO -> New Channel" after power cycle results in the first zone being deleted

Post by EA5JAQ » Sat May 29, 2021 12:49 pm

Hi,
I might've found and solved a bug in my DM-1801, running the lastest version of the firmware.

Steps to recreate:
- Select the first zone in Channel mode
- Change to VFO mode
- Power cycle the device, so it starts in VFO mode (it also happens if you restore settings)
- Select "VFO -> New Channel" and confirm
Result: the first zone gets deleted and the new channel is the first and only item of a new zone with no name. The channels are not deleted, as they're still shown in the "All channels" list. If in the first step, another zone but the first was selected, the new channel gets added but it isn't shown when the radio automatically changes to channel mode after creating the new one. Instead, the first channel of the zone is shown.

I think I might've found the problem. When the "VFO -> New Channel" option is selected and the validateNewChannel() function in uiVFOMode.c is called, the variable currentZone hasn't been initialised (obviously, not the one in the non volatile settings), as it gets initialised in uiChannelMode.c, which hasn't been called as the radio just started in VFO mode. I have added the following to the validateNewChannel() right before that variable is needed:

codeplugZoneGetDataForNumber(nonVolatileSettings.currentZone, &currentZone);

And it seems to have solved the problem for me. I don't know if I have broken something somewhere else, I'll keep testing.

Btw, I'm really happy a solution to the licensing problem has been found, so this amazing project can carry on. Thanks to the devs for all the hard work these years.

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

Re: Selecting "VFO -> New Channel" after power cycle results in the first zone being deleted

Post by F1RMB » Sat May 29, 2021 1:45 pm

Hi,
EA5JAQ wrote:
Sat May 29, 2021 12:49 pm
Hi,
I might've found and solved a bug in my DM-1801, running the lastest version of the firmware.

Steps to recreate:
- Select the first zone in Channel mode
- Change to VFO mode
- Power cycle the device, so it starts in VFO mode (it also happens if you restore settings)
- Select "VFO -> New Channel" and confirm
Result: the first zone gets deleted and the new channel is the first and only item of a new zone with no name. The channels are not deleted, as they're still shown in the "All channels" list. If in the first step, another zone but the first was selected, the new channel gets added but it isn't shown when the radio automatically changes to channel mode after creating the new one. Instead, the first channel of the zone is shown.

I think I might've found the problem. When the "VFO -> New Channel" option is selected and the validateNewChannel() function in uiVFOMode.c is called, the variable currentZone hasn't been initialised (obviously, not the one in the non volatile settings), as it gets initialised in uiChannelMode.c, which hasn't been called as the radio just started in VFO mode. I have added the following to the validateNewChannel() right before that variable is needed:

codeplugZoneGetDataForNumber(nonVolatileSettings.currentZone, &currentZone);

And it seems to have solved the problem for me. I don't know if I have broken something somewhere else, I'll keep testing.

Btw, I'm really happy a solution to the licensing problem has been found, so this amazing project can carry on. Thanks to the devs for all the hard work these years.
Thanks for the report, I'll look at this this afternoon.


Cheers.
---
Daniel

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

Re: Selecting "VFO -> New Channel" after power cycle results in the first zone being deleted

Post by F1RMB » Sat May 29, 2021 3:13 pm

EA5JAQ wrote:
Sat May 29, 2021 12:49 pm
Hi,

... VFO -> New Channel bug report ...

Okay, it's fixed (with a little more code, but it was indeed uninitialized in the case of a cold boot in VFO mode).
It will be part of the next release, and thanks again for the report.


Cheers.
---
Daniel

EA5JAQ
Posts: 86
Joined: Thu Jul 16, 2020 6:08 am

Re: Selecting "VFO -> New Channel" after power cycle results in the first zone being deleted

Post by EA5JAQ » Sat May 29, 2021 4:35 pm

F1RMB wrote:
Sat May 29, 2021 3:13 pm
EA5JAQ wrote:
Sat May 29, 2021 12:49 pm
Hi,

... VFO -> New Channel bug report ...

Okay, it's fixed (with a little more code, but it was indeed uninitialized in the case of a cold boot in VFO mode).
It will be part of the next release, and thanks again for the report.


Cheers.
---
Daniel
Thanks to you! Glad I could help.

73

Post Reply