Hi,
We are using S12ZVCA with processor expert. How to transfer variables between main.c and Event.c?
main.c as follow:
unsigned int i;
void main(void)
{.........
for(;;)
{
SCI_Send(i);
}
.........
}........
/*
** ###################################################################
**
** This file was created by Processor Expert 10.3 [05.09]
** for the Freescale HCS12Z series of microcontrollers.
**
** ###################################################################
*/
Event.c as follow:
unsigned int i;
void TI1_OnInterrupt(void)
{
++i; // How to transfer i to main.c
}
Best regards,
Aaron
Solved! Go to Solution.
Hi Aaron,
Create a global variable in your own source file can be the solution as you can see on the below link:
https://community.nxp.com/message/24869?commentID=24869#comment-24869
There is a description with different Code Warrior and MCU, but the principle is the same.
I hope it helps you.
Best regards,
Diana
Hi Aaron,
Create a global variable in your own source file can be the solution as you can see on the below link:
https://community.nxp.com/message/24869?commentID=24869#comment-24869
There is a description with different Code Warrior and MCU, but the principle is the same.
I hope it helps you.
Best regards,
Diana
Hi Diana,
Thanks for you quick reply. We got the link error as follow:
myfunc.c
#include "myfunc.h"
unsigned char TI1_CountUp;
unsigned char foo(void)
{
return TI1_CountUp;
}
myfunc.h
#ifndef MYFUNC_H_
#define MYFUNC_H_extern unsigned char TI1_CountUp;
unsigned char foo(void);
#endif /* MYFUNC_H_ */
Event.c
#include "Cpu.h"
#include "Events.h"/* User includes (#include below this line is not maintained by Processor Expert) */
#include "Board_B0005_v100.h"
#include "myfunc.h"............
void TI1_OnInterrupt(void)
{
/* Write your code here ... */
++TI1_CountUp;
}............
main.c
/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "Events.h".........
/* User includes (#include below this line is not maintained by Processor Expert) */
#include "myfunc.h".........
void main(void)
{........
/* Write your code here */
for(;;)
{
do{} while(!AS1_GetTxComplete());
AS1_SendChar(TI1_CountUp);
}
}
How to resolve the issue:
ERROR L1822: Symbol __copy in file C:/....../FLASH/Sources\main_c.obj is undefined
Best regards,
Aaron