Patrik Nylund

HC08: Project.map

Discussion created by Patrik Nylund on Sep 27, 2006
Latest reply on Sep 29, 2006 by Patrik Nylund
Hi... I am having a strange problem.
 
I have a struct liks this
 
#define SIGNED8 char
#define UNSIGNED8 unsigned char
#define UNSIGNED16 unsigned int
#define SIGNED16 int
#define UNSIGNED32 unsigned long int
#define SIGNED32 long int
 
typedef struct
{
 UNSIGNED8 NodeId;
 UNSIGNED16 HeartBeatTime;
 UNSIGNED16 EmcyInhibitTime;
 UNSIGNED32 RPDO_COB_ID;
 UNSIGNED16 RPDO_Event_Time;
 UNSIGNED32 TPDO_COB_ID;
 UNSIGNED16 TPDO_Event_Time;
 UNSIGNED8 BaudRate;         // 0x2000
 UNSIGNED8 OperatingMode;    // 0x2001
 UNSIGNED16 PWM_FrequencyDiv;// 0x2002
 UNSIGNED16 P_Gain;          // 0x2003
 UNSIGNED32 AnalogOffset;    // 0x6431
 UNSIGNED32 AnalogGain;      // 0x6432
 UNSIGNED32 Serial;          // 0x1018,04
} ObjectDictionary;
 
My map file says that the size of obejct is 31 bytes, even though it is 35, and my program returns randomly very strange values(bug). When I change all UNSIGNED32 to UNSIGNED16 the program starts working correct, but map file doesnt change. What is wrong?
I am programming a HC08 with Freescale CodeWarrior v5.0.
 
Can you use variables of type long int with HC08?
 
thanks in advance Patrik

 

Message Edited by CrasyCat on 2007-04-13 01:49 PM

Outcomes