ADC problem with MKE02Z64VLD4

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ADC problem with MKE02Z64VLD4

跳至解决方案
716 次查看
juanma_clautron
Contributor II

Hi

 

I'm having a problem with KDS and Processor Expert.

 

- KDS 2.0.0

- CPU > MKE02Z64VLD4

- Component > ADC

 

When I click on "Generate Processor Expert Code" it generates ADC.c and ADC.h files. Then I click on "Build Project" and it shows the next error on ADC_Init method:

 

expected ';' before '}' token

 

If I check the file ADC.c I find the error: in last line, it misses " ; ".

 

void ADC_Init(void)

{

  OutFlg = 0U;                         /* No measured value */

  SumChan = 0U;                        /* Set the counter of measured channels to 0 */

  ModeFlg = STOP;                      /* Device isn't running */

  AdcLdd1_DeviceDataPtr = AdcLdd1_Init(NULL); /* Calling init method of the inherited component */

  ADC_PDD_SetFIFO_ScanMode(ADC_BASE_PTR, ADC_PDD_SCAN) /* Only channel methods are selected. To initiate FIFO only one channel in this mode is needed. */

}


I'll try to find how to modify basic components, but it's not possible. Erich Styger (http://mcuoneclipse.com/) told me that it's not possible to modify built-in components. The only solution is: Generate, then disable Generate and modify manually.

 

Is it possible to change the component?

 

Thanks

标签 (1)
标记 (4)
0 项奖励
1 解答
425 次查看
juanma_clautron
Contributor II

SOLVED! Well semi-solved!

1 - I add the component to the project

2 - Generate code

3 - Everything works correctly (only 3 lines)

void AD1_Init(void)

{

OutFlg = FALSE; /* No measured value */

ModeFlg = STOP; /* Device isn’t running */

AdcLdd1_DeviceDataPtr = AdcLdd1_Init(NULL); /* Calling init method of the inherited component */

}

4 - I disabled all methods and only enable “MeasureChan” and “GetChanValue”.

5 - Generate and … the line appears with an error!! It says the only channel methods are selected, this is why the line appears.

void ADC_Init(void)

{

OutFlg = 0U; /* No measured value */

SumChan = 0U; /* Set the counter of measured channels to 0 */

ModeFlg = STOP; /* Device isn’t running */

AdcLdd1_DeviceDataPtr = AdcLdd1_Init(NULL); /* Calling init method of the inherited component */

ADC_PDD_SetFIFO_ScanMode(ADC_BASE_PTR, ADC_PDD_SCAN) /* Only channel methods are selected. To initiate FIFO only one channel in this mode is needed. */

}

6 - The problem is solved if I enable one no-only channel method, but the problem remains unsolved.

在原帖中查看解决方案

0 项奖励
1 回复
426 次查看
juanma_clautron
Contributor II

SOLVED! Well semi-solved!

1 - I add the component to the project

2 - Generate code

3 - Everything works correctly (only 3 lines)

void AD1_Init(void)

{

OutFlg = FALSE; /* No measured value */

ModeFlg = STOP; /* Device isn’t running */

AdcLdd1_DeviceDataPtr = AdcLdd1_Init(NULL); /* Calling init method of the inherited component */

}

4 - I disabled all methods and only enable “MeasureChan” and “GetChanValue”.

5 - Generate and … the line appears with an error!! It says the only channel methods are selected, this is why the line appears.

void ADC_Init(void)

{

OutFlg = 0U; /* No measured value */

SumChan = 0U; /* Set the counter of measured channels to 0 */

ModeFlg = STOP; /* Device isn’t running */

AdcLdd1_DeviceDataPtr = AdcLdd1_Init(NULL); /* Calling init method of the inherited component */

ADC_PDD_SetFIFO_ScanMode(ADC_BASE_PTR, ADC_PDD_SCAN) /* Only channel methods are selected. To initiate FIFO only one channel in this mode is needed. */

}

6 - The problem is solved if I enable one no-only channel method, but the problem remains unsolved.

0 项奖励