ADC problem with MKE02Z64VLD4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC problem with MKE02Z64VLD4

Jump to solution
729 Views
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

Labels (1)
0 Kudos
1 Solution
438 Views
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.

View solution in original post

0 Kudos
1 Reply
439 Views
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 Kudos