Other Parts Discussed in Thread: CONTROLSUITE
I have the following issue:
adcmemory is pointer to ADCRESULT registers
I have the following code:
#define MOTORVI_IIRA (0.414) // EXP (-2 * PI 20k/160k)
#define MOTORVI_IIRB (0.293) // (1 - A) /2
#pragma DATA_SECTION(CLARlastinputValue,"Cla1DataRam0")
volatile float CLARlastinputValue[13];
#pragma DATA_SECTION(adcmemory,"CpuToCla1MsgRAM")
volatile unsigned short *adcmemory;
#pragma DATA_SECTION(CLARESULT,"Cla1ToCpuMsgRAM")
volatile float CLARESULT[13];
#pragma FUNC_ALWAYS_INLINE(CLA_FILTER_Motor)
static inline void CLA_FILTER_Motor( int nummer )
{
volatile float inputValue = (unsigned short)*(adcmemory + nummer);
float result = ((float)MOTORVI_IIRB * inputValue) + ((float)MOTORVI_IIRB * CLARlastinputValue[nummer]) + ((float)MOTORVI_IIRA * CLARESULT[nummer]);
CLARlastinputValue[nummer] = inputValue;
CLARESULT[nummer] = result;
}
__interrupt void Cla1Task2 ( void )
{
// Read ADC and Filter Result
__mdebugstop();
CLA_FILTER_Motor (1);
}
This is the compiler output/disassembly:
0000903a: 7F600000 MDEBUGSTOP
0000903c: 7FA00000 MNOP
0000903e: 7FA00000 MNOP
00009040: 7FA00000 MNOP
00009042: 799FFFBE MCCNDD 0xffbe, UNCF
00009044: 7FA00000 MNOP
00009046: 78400000 MMOVIZ MR0, #0x0
00009048: 78800001 MMOVXI MR0, #0x1
0000904a: 7FA00000 MNOP
0000904c: 7FA00000 MNOP
0000904e: 7FA00000 MNOP
00009050: 7F800000 MSTOP
I think I lost some code in the optimization.
Somebody any suggestion how to solve this? I like to have it in a (inline) function because I have 10 adc channels to filter.
Any suggestion?