Hello,
I just got my kl46z.
Im using a TimerUnit to make 2 PWM signals, one on each channel (0 & 1), and I want to change the offset values by using SetOffsetTicks method.
The problem is that when I use the SetOffsetTicks method I get some errors.
The code I use is this one:
TU2_SetOffsetTicks(LDD_TDeviceData *DeviceDataPtr, uint8_t 0, TU2_TValueType 25000);
cause it didn't work I tried with this one:
TU2_SetOffsetTicks( LDD_TDeviceData *TU2_TDeviceDataPtr, uint8_t 0, TU2_TValueType 25000);
The errors that I get are these ones:
../Sources/Events.c: In function 'AS1_OnRxChar': //*****************Im trying to use this method (SetOffsetTicks) inside this Serial communication event but even if I try to use it in the main code I still get this.
../Sources/Events.c:101:26: error: expected expression before 'LDD_TDeviceData'
mingw32-make: *** [Sources/Events.o] Error 1
I have Auto initialization enabled.
How do I fix this?
Thanks in advance.
已解决! 转到解答。
It seeems that the problem is in the syntax - you need to call it using proper C syntax (don't use type names in the call!) like this :
...
TU2_SetOffsetTicks(TU2_DeviceData, 0, 25000);
...
The TU2_DeviceData is a device structure automatically created for you by Auto initialization so you can reference it.
Best regards
Petr Hradsky
Processor Expert Support Team
It seeems that the problem is in the syntax - you need to call it using proper C syntax (don't use type names in the call!) like this :
...
TU2_SetOffsetTicks(TU2_DeviceData, 0, 25000);
...
The TU2_DeviceData is a device structure automatically created for you by Auto initialization so you can reference it.
Best regards
Petr Hradsky
Processor Expert Support Team