allow me explain the whole issue post by my poor English... ![]()
in the beginning I define a class with some function using public variable in assembler, the way I used variable in assembly is directly reference to label in assembly domain (global) like
`int attribute((used)) MyVariable asm("MyVariable");
so that I can access in assembly like this
`asm ("lds %0 MyVariable")
in this way I can optimize performance better, so it must be static, and also needs to be access at main program as public
when I put those class with main program together in one file (OK.ino) it works very will, then I try to sperate then into three files, (just put one certain function at two file (cpp and h) without disturb main program, and also easy to maintain and read), the error comes
please see the original post in the top ErrorTest.ino and MyClass.cpp MyClass.h
It looks like the compiler not allow the variable be access by program in outside file, (the variable has defined as static , public , and labeling in assembly (global))
if I do not labeling in assembly (global area), then the external program can access then, but assembly will not be able to access, and comes MyVariable not defined message,
then I can use different way to make inline assembly transfer parameter in, like this
` asm("ld %0, %A[MyVariable]\n\t" "ld %1, %B[MyVariable]\n\t" :: "r" (tmp1), "r" (tmp2), [MyVariable] "+r" (MyVariable) : )
but it takes CPU time for me in my case, and also I found other issue in this way, it look like MyVariable will be changed by other issue (I don't know why, I will not discuss this issue here, it become more complicated)
so finally I use public data pointer to access static private variable, and it work fine,
It's not a good solution, and I don't know why the original issue happen, but
now I can go forward.. it just fine
that is all about this post..
thanks for your kindly help. It's great for me,