PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Oct 02, 2010 12:23 pm |
|
|
If you don't find a work-around for the problem in the forum archives,
then email CCS Support a short (but compilable) example.
This is what I mean by a short example. In fact, it could be shorter.
You don't need your ppout() routine to show the problem. Just a simple
printf of the sizeof() result is enough. You can run this in MPLAB simulator
and study the problem.
Code: |
#include <18F452.H>
#fuses XT,NOWDT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
typedef struct{
int8 s1[5];
int8 s2[5];
int8 s3[5];
}pump_;
const pump_ pump[2]={
1,2,3,4,5, //p1 s1
1,2,3,4,5,
1,2,3,4,5, //p1 s3
1,2,3,4,5, //p2 s1
1,2,3,4,5,
1,2,3,4,5}; //p2 s3
//==============================
void main()
{
int8 result;
result = sizeof(pump[0].s1);
printf("%x \r", result);
while(1);
}
|
I worked on your problem briefly. I tried to fix it by type-casting the
structure reference in the sizeof statement to _pump, and that changed it
to 0F (from 1e) so maybe it helped, but it's not the solution. For all I
know, there might be a solution in the forum archives, maybe even by
me, but I don't have time to search for it. If you own the compiler then
you can email CCS support about it. Maybe they might help, or maybe
fix it in the next version. |
|