-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
struct TransceiverState #870
Comments
No. All the best, 73 de Frank DD4WH |
Hi, However, we could also postpone this for a time when we refactor the audio driver which is now a 4500+ line monster. |
Hi Danilo, |
This is not a FUN job, it's a dirty job. Only risk and complaints, but the gain comes later. example: I assume that "ts.agc.mode" are readable as "ts.agc_mode". |
We do have a fundamental (mostly philosophical) problem here. There are two opinions which cannot come together:
I am not a professional programmer at all. And I started programming by doing very big monolithic blocks, creating global varaibles and so on (all the things one might not do). If I saw other, good-structured code I was not able to understand it because I missed to learn otherwise than in monolithic blocks. In the meantime I opened my mind and now it is much easier to understand code that is not in a monolithic block but in many well-named sub functions. So if I see a "monster" of 4.500 lines now I think only the ones who have grown up together with this monster can understand it. Everyone who see it first time cannot understand what is going on. So I agree that refactoring of code has very high priority and is a MUST. I guess there are some bugs sleeping due to this "bad programming behaviour" and will some up sometimes later and will not be recovered simply. The first very big step mcHF firmware has done was the time Danilo refactored Clints code and recovered some out-of-bounds, undefined variable states and so on. I think we must not discuss if refactoring is a proof or not. It is not a solution to allow specific changes only in specific branches. This only will win time for the ones who are not able to understand refactored code. The deep problem only will come up some commits or merges later. The goal has to be to take care that the ones who are familar only with the existing code and are not able by themself to go 10 steps awy and see the new structure from bigger distance. I have thought about that problem many times and I have not found a solution yet. Frank is a very good DSP programmer and if he does not continue working on the code we do not have anyone who is able to do that work. Actually we do have block diagrams which are automated produced with every new build which shows changed structure. And breaking monolithic parts in many small but logical parts are better readable to persons who see the code the first time but maybe unreadable to someone who relies upon that these monolithic blocks never will change.... What can be done to satisfy BOTH parts, to hold our team together? What can be done to bring understanding of "well structured and refactored code" to all of us? |
Well i can stay away from the DSP area, since there a lot of other things to do :) Here another example for UI part: uchar waterfall_color_scheme; // stores waterfall color scheme struct WaterfallConfiguration |
Hi all Hobbyist programmer here. I discovered the internals of the mchf code some days ago just after completing the HW build. My primary goal was to add some missing features like a memory management system. I must say that I had a hard time to figure out the structure of the code and I think that a better modularization/factorization would help me a lot. However, I also agree that we must preserve the audio code of any disruptive changes because it is at the core of the project and the work of Franck is totally awesome. Concerning the TransceiverState struct, I think that its factorization is unavoidable if we want to implement effectivelly some features like memories that store frequencies, modes, agc settings, etc. 73 de Nicolas F4FHH |
Hi Nicolas, fully agree. More structured and modularized code would help much. If you take a look at the "old" sources (versions beginnig with 219....) you will see the improvements that already have been implemented. And regarding "memory places": 73 de Andreas, DF8OE |
Hi all, |
Working at STM32f7 is a great news, and I thinking to ask, but I know you are very busy. |
Lately I’m been looking at the bootloader code, and tried to remove all unused c files. The bootloader build are depended on struct TransceiverState, and audio_filter.h,,, Too fix the problem the global TranceiverState struct must be decoupled from some functions by adding parameters. |
Asbjorn, Danilo |
The compile of the bootloader require this struct. Functions that compiles and later removed by the linker: inline bool is_ssb_tx_filter_enabled(); |
Asbjorn, in the db4ple/f7 branch some corrections have been made to the bootloader and none of these functions (or files which they are contained in) are any longer compiled for the bootloader. If you can't wait until this branch is merged, you have to remove the call to mchf_board_touchscreen_init() from bootloader_main.c and remove the files misc/v_eprom/eeprom.c from bootloader.mak (and submit a pull request if you want). |
The struct TransceiverState contains a lot of things: User configuration, board configuration,,, !
I'm planning to move all "agc_" variables into one single "agc" structure.
Then we don't need the "agc_" nameing anymore.
Example:
struct TransceiverAGCState
{
uchar mode;
uchar custom_decay;
uint8_t wdsp;
uint8_t wdsp_mode;
uint8_t wdsp_slope;
uint8_t wdsp_hang_enable;
int wdsp_thresh;
int wdsp_hang_thresh;
int wdsp_hang_time;
uint8_t wdsp_action;
uint8_t wdsp_switch_mode;
uint8_t wdsp_hang_action;
int wdsp_tau_decay[6];
int wdsp_tau_hang_decay;
};
typedef struct TransceiverState
{
...
// AGC mode
struct TransceiverAGCState agc;
....
};
Then i have to rename all ts.agc_mode to ts.agc.mode ,,,,
Low risk and no real code changes.
Ok ?
The text was updated successfully, but these errors were encountered: