Hi everyone,
Nowadays, I am studying on AN4907 EngineControl demo and I notice that when we call the local variables in the local functions, we use the register_chan_base keyword as shown in below.
I took the image above from the etpuc_crank.c file of the AN4907 demo and "register_chan_base" is used for register keyword. I went on the register_chan_base definition and I jumped into the ETpu_Hw.h file (below image). It specifies default type of the register_chan_base is unsigned int24.
Now, this is my question; What is the purpose of the usage of register_chan_base in this demo? I mean, the size of the register_chan_base is not enough to hold the struct of CRANK_CHAN_PARAMS.
Best regards,
Mert.
Solved! Go to Solution.
Hi,
pay attention here, section 2, point 21
https://www.phaedsys.com/principals/bytecraft/bytecraftdata/eTPU_C_FAQ.pdf
Hi again,
I checked the documents and I accept two of your answers as solution.
Thanks you again.
Mert KİREMİTCİ
Hi,
Thanks a lot for your helps.
I will check the specified documents as soon as possible.
Mert KİREMİTCİ
Hi,
pay attention here, section 2, point 21
https://www.phaedsys.com/principals/bytecraft/bytecraftdata/eTPU_C_FAQ.pdf
That is an interesting document with some good information, although some is ByteCraft specific. For some more information on the same topic, I also invite a look at section 5.1.1 of https://services.ashware.com/Download_Files/compiler_ref_manual.pdf.
Note that originally the CPBA access via 'register_chan_base' had to be done as a C pointer, so "volatile register_chan_base struct CRANK_CHAN_PARAMS *crank_local", with members accessed via the '->' de-ref operator, but at some point the direct mapping of a channel frame struct to 'register_chan_base' was supported as well. Either way results in the same executable code.