Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/16/10 06:14
Read: times


 
#180164 - Structure definition in code banking modules 8052
Hi,

We are using 8052 in our project. We are using Keil Microvision 3, and also using PC-Lint tool ver 9.0f. We are using code banking with 2 code banks. In hardware, we have external code ROM 128K and external memory of 32K.

common area source module is common.c
Bank 0 source module is Ext0.c
Bank 1 source module is Ext1.c

The entire structure declarations in our project are contained in the file common.h (which is included in the common area source module common.c). These structures are defined (using 'extern') in the file extern.h, so that they will be shared among all the modules. This file is included in the 2 banks source modules (Ext0.c and Ext1.c).

The file common.h is as shown:

/****************************************************************************
*				common.h					
*****************************************************************************/

typedef struct g_memory
{
	unsigned char number[MAX_GM_MUMBER];
	unsigned char cnt;
	unsigned char tr_no;
}GM;

typedef struct phonebook
{
	unsigned char name[13];
	unsigned char number[12];
	unsigned char cnt;
	unsigned char entry;
	unsigned char padding[5];

}PBOOK;

typedef struct extention_data
{
	unsigned char dgt_cnt;	
	unsigned char ring_type;
	unsigned char state;	
	unsigned char off_hook;
	unsigned char ring_ev;	
	unsigned char ring_feed;
	unsigned char dgt_dialed;
	unsigned char dgt_send;	
	unsigned char id;		
	unsigned char pulse_cnt;
	unsigned char lps;
	unsigned char flash;	
	unsigned char group_id;
	unsigned char delay_timer;
	unsigned char alaram;
	unsigned char csn_index;
	unsigned char csd_index;
	unsigned char dynamic_lock;
	unsigned char tone_type;
	unsigned char t_lid;	
	unsigned char barge;
	unsigned char barge_lid;
	unsigned char lcr;		
	unsigned char forwarded;
	unsigned char pg_id;
	unsigned char res;
	unsigned char programming;
	unsigned char temp;		
	unsigned char trans_from;
	unsigned char dosa_enable;
	unsigned char type;		
	unsigned char line_id;	
	unsigned char route_id;	
	unsigned char dtmf_id;	
	unsigned char cd_l_index;
	unsigned char timer;
	unsigned char flashed;	
	unsigned char flag_set;	  
	unsigned char dosaDialing;
	unsigned char active;
	unsigned char cb_no;	
	unsigned char cwt_feed;
	unsigned char temp_barge_privacy;
	unsigned char direct_pnt_dialing;
	unsigned char park_ring;
	unsigned char deny_ol_fea;
	unsigned char park_lid;
	unsigned char park_no;
	unsigned char extr_hold;
	unsigned char rt_to_dss;
	unsigned char call_transferred;
	unsigned char hot_line;
	unsigned char hod;
	unsigned char how_no;
	unsigned char service_no;		
	unsigned char guest_group;
	unsigned char check_in_out;
	unsigned char temp_check_in_out;
	unsigned char check_in_id;
	unsigned char pulse_tone_dial;
	unsigned char dl_mins;
	unsigned char dl_hrs;
	unsigned char dl_open_day;
	unsigned char dl_close_day;
	unsigned char dl_open_mins;
	unsigned char dl_cnt_down;
	unsigned char auto_shut_dl;
	unsigned char dl_onoff;
	unsigned int  rng_timer;			
	unsigned int  password;
	unsigned int  r_index;	
	unsigned char call_privacy[3];
	unsigned char how[16];
	unsigned char dgt_buf[35];

}EXTN_DATA;


typedef struct callback
{
	unsigned char cb_type;
	unsigned char no[4];
	unsigned char acb_is_applied;
	unsigned char call_landing_dss;
	unsigned char index;
}CB;

typedef struct hold_queue
{
	unsigned char no[K_MAX_CALLBACK];
	unsigned char head;
	unsigned char tail;
}HQ;

typedef struct cur_hold_queue
{
	unsigned char no[CHQ_BUF];
	unsigned char index;	
}CHQ;

typedef struct trans_lid_queue
{
	unsigned char index;
	unsigned char held_count;
	unsigned char padding[14];
	unsigned char no[K_MAX_PNT];
}THQ;

typedef struct park_lid_queue
{
	unsigned char no[K_MAX_CALLBACK];
	unsigned char head;	
	unsigned char tail;	
}PHQ;

typedef struct alarm_time{
	unsigned  char hrs;
	unsigned  char mins;
	unsigned  char date_al_day;
	unsigned  char date_al_month;
	unsigned  char date_al_year;
	unsigned  char alarm_cb_no;
	unsigned  char alarm_applied;
	unsigned  char alarm_type;

}ALARM_TIME;

typedef struct extention_group
{
	unsigned char no[6]; 
	unsigned int  ring_time;
}EG;

typedef struct trunk_def
{
	unsigned char enable;	
	unsigned char latch;
	unsigned char line_card;
	unsigned char trunk_id;
	unsigned char type;
	unsigned char pstn_count;
	unsigned char reserved;
	unsigned char res_lid;
	unsigned char trunk_guard_present;
	unsigned char t_lock_dial;
	unsigned char con_caller;
	unsigned char ecf_nol;
	unsigned char ecf_dest;
	unsigned char has_card;	
	unsigned char led_on;	
	unsigned char miss_call_count;
	unsigned char missed_call_alert;
	unsigned char from_miss_c_c;
	unsigned char mcb_calls_counter;
	unsigned char dosa_enable[2];		
	unsigned char guard_no_cnt[2];
	unsigned char voice_enable[2];
	unsigned char ecf_enable[2];
	unsigned char no[6];				
	unsigned char ring[6];				
	unsigned char ecf_no[16];
	unsigned char access[K_MAX_PORTS];
	unsigned char guard_no[2][16];
	unsigned char pas_connected;

}TD;

typedef struct ttrunk_def
{
	unsigned char hunting;				
	unsigned char count;				
	unsigned char through_disa;			
	unsigned char dss_parked;			
	unsigned char routing;				
	unsigned char rr_count;				
	unsigned char group_extns_busy;		
	unsigned char thro_disa;			
	unsigned int  ring_time;			
	unsigned char destination[2];		
	unsigned char prog_hunting[2];		
	unsigned char disa_enable[2];			
	unsigned char trunk_buf[16];		

}TTD;

typedef struct trunkk_def
{
	unsigned int  index;
	unsigned char telco_company;
	unsigned char trunkNamePresent;
	unsigned char trunk_reversal;
	unsigned char trunk_rev_latch;
	unsigned char trunk_rev_det;
	unsigned char trunk_rev_en;

}TDK;

typedef struct redial_no
{
	unsigned char dgt_cnt;
	unsigned char ldgt_cnt;
	unsigned char priority;
	unsigned char trunk_id;
	unsigned char ltrunk_id;
	unsigned char index;
	unsigned char noft;
	unsigned char boss_ring;
}RNO;

typedef struct rredial_no
{
	unsigned char no[16];
	unsigned char lno[16];
}RRNO;

typedef struct trunk_group
{
	unsigned char tid[K_MAX_PNT];
	unsigned char lcr_type;
	unsigned char no[14];
	unsigned char index;

}T_GROUP;


typedef struct day_night_week_time
{
	unsigned char day_time[2];
	unsigned char night_time[2];
	unsigned char ls_time[2];
	unsigned char le_time[2];
}DNWT;

typedef struct printable_line
{
	unsigned char p_data[82];
	unsigned char line_index;
	unsigned char char_index;
	unsigned char print_type;
	unsigned char date[3];
	unsigned char no;
	unsigned char room_no;
	unsigned char header;
	unsigned char cos_rid;
	unsigned int  rid;
	unsigned char padding[34];

}PL;

typedef struct smdr_record {
	unsigned char trunkno;
	unsigned char number[6];
	unsigned char date[3];
	unsigned char time[2];
	unsigned char extn_no;
	unsigned char extn_no1;
	unsigned int  duration;
}SMDR_R;


typedef struct ismdr_record {
	unsigned char trunkno;
	unsigned char number[6];
	unsigned char date[3];
	unsigned char time[2];
	unsigned char extn_no;
	unsigned char extn_no1;
	unsigned int  duration;
}ISMDR_R;

typedef struct prefix
{
	unsigned char prefix_enable;
	unsigned char prefix_digit[4];
	unsigned char prefix_dc;
	unsigned char pfx_dgts_dialed;
	unsigned char reversal_maturity;
}PREFIX;

typedef struct miss_call_back_q{
	unsigned char trunk;
	unsigned char sno;
}MCBQ;

typedef struct trunk_smdr_record {
	unsigned char number[6];
	unsigned char date[3];
	unsigned char time[2];
	unsigned char extn_no;
	unsigned char extn_no1;
	unsigned char storage_id;
	unsigned int  duration;
}T_SMDR_R;

typedef struct basic_service_provider{

	unsigned char counter;
	unsigned char pos;
	unsigned char padding[14];
	unsigned char entries[K_MAX_PNT];

}BSP;

MCBQ		  xdata mcbq[MISS_CALL_BUF];
T_SMDR_R	  xdata trunk_report_smdr[K_MAX_PNT];
PBOOK		  xdata pname[100];
EXTN_DATA	  xdata ln[K_MAX_PORTS];
ALARM_TIME	  xdata al[K_MAX_PORTS];
CB		  xdata cb[K_MAX_PORTS];
HQ		  xdata hq[K_MAX_PORTS];
CHQ		  xdata chq[K_MAX_PORTS];
HQ		  xdata tlq[K_MAX_PORTS];
THQ		  xdata thq[K_MAX_PORTS];
PHQ		  xdata phq[K_MAX_PORTS];
RNO		  xdata rno[K_MAX_PORTS];
RRNO		  xdata rrno[K_MAX_PORTS];
TD		  xdata trunk[K_MAX_PNT];
TTD		  xdata ttrunk[K_MAX_PNT];
TDK		  xdata trunkk[K_MAX_PNT];
EG		  xdata tl_group[K_MAX_GROUPS+1];
SMDR_R		  xdata report_smdr[OUT_CALL_BUF];
ISMDR_R		  xdata i_call_report[INC_CALL_BUF];
PL		  xdata line;
GM		  xdata gm[200];
DNWT		  xdata dnwt[7];
T_GROUP		  xdata t_group[2];
PREFIX		  xdata pfx[K_MAX_PNT];
BSP		  xdata bsp[9];

 


The file extern.h is as shown:

/****************************************************************************
*				extern.h					
*****************************************************************************/
//-------------------------------------------------------------------
//EXTERNAL VARIABLES FOR GLOBAL40.H 
//-------------------------------------------------------------------

typedef struct g_memory
{
	unsigned char number[MAX_GM_MUMBER];
	unsigned char cnt;
	unsigned char tr_no;
}GM;

typedef struct phonebook
{
	unsigned char name[13];
	unsigned char number[12];
	unsigned char cnt;
	unsigned char entry;
	unsigned char padding[5];

}PBOOK;

typedef struct extention_data
{
	unsigned char dgt_cnt;	
	unsigned char ring_type;
	unsigned char state;	
	unsigned char off_hook;
	unsigned char ring_ev;	
	unsigned char ring_feed;
	unsigned char dgt_dialed;
	unsigned char dgt_send;	
	unsigned char id;		
	unsigned char pulse_cnt;
	unsigned char lps;
	unsigned char flash;	
	unsigned char group_id;
	unsigned char delay_timer;	
	unsigned char alaram;
	unsigned char csn_index;	
	unsigned char csd_index;	
	unsigned char dynamic_lock;
	unsigned char tone_type;
	unsigned char t_lid;	
	unsigned char barge;
	unsigned char barge_lid;
	unsigned char lcr;		
	unsigned char forwarded;
	unsigned char pg_id;
	unsigned char res;
	unsigned char programming;
	unsigned char temp;		
	unsigned char trans_from;
	unsigned char dosa_enable;
	unsigned char type;			
	unsigned char line_id;	
	unsigned char route_id;	
	unsigned char dtmf_id;	
	unsigned char cd_l_index;
	unsigned char timer;
	unsigned char flashed;	
	unsigned char flag_set;
	unsigned char dosaDialing;
	unsigned char active;
	unsigned char cb_no;	
	unsigned char cwt_feed;
	unsigned char temp_barge_privacy;
	unsigned char direct_pnt_dialing;
	unsigned char park_ring;
	unsigned char deny_ol_fea;
	unsigned char park_lid;
	unsigned char park_no;
	unsigned char extr_hold;
	unsigned char rt_to_dss;
	unsigned char call_transferred;
	unsigned char hot_line;		
	unsigned char hod;
	unsigned char how_no;
	unsigned char service_no;		
	unsigned char guest_group;
	unsigned char check_in_out;
	unsigned char temp_check_in_out;
	unsigned char check_in_id;
	unsigned char pulse_tone_dial;
	unsigned char dl_mins;
	unsigned char dl_hrs;
	unsigned char dl_open_day;
	unsigned char dl_close_day;
	unsigned char dl_open_mins;
	unsigned char dl_cnt_down;
	unsigned char auto_shut_dl;
	unsigned char dl_onoff;
	unsigned int  rng_timer;			
	unsigned int  password;
	unsigned int  r_index;	
	unsigned char call_privacy[3];
	unsigned char how[16];
	unsigned char dgt_buf[35];

}EXTN_DATA;


typedef struct callback
{
	unsigned char cb_type;
	unsigned char no[4];
	unsigned char acb_is_applied;
	unsigned char call_landing_dss;
	unsigned char index;
}CB;

typedef struct hold_queue
{
	unsigned char no[K_MAX_CALLBACK];
	unsigned char head;
	unsigned char tail;
}HQ;

typedef struct cur_hold_queue
{
	unsigned char no[CHQ_BUF];
	unsigned char index;	
}CHQ;

typedef struct trans_lid_queue
{
	unsigned char index;	
	unsigned char held_count;
	unsigned char padding[14];
	unsigned char no[K_MAX_PNT];
}THQ;

typedef struct park_lid_queue
{
	unsigned char no[K_MAX_CALLBACK];
	unsigned char head;	
	unsigned char tail;	
}PHQ;

typedef struct alarm_time{
	unsigned  char hrs;
	unsigned  char mins;
	unsigned  char date_al_day;
	unsigned  char date_al_month;
	unsigned  char date_al_year;
	unsigned  char alarm_cb_no;
	unsigned  char alarm_applied;
	unsigned  char alarm_type;

}ALARM_TIME;

typedef struct extention_group
{
	unsigned char no[6]; 
	unsigned int  ring_time;
}EG;

typedef struct trunk_def
{
	unsigned char enable;	
	unsigned char latch;
	unsigned char line_card;
	unsigned char trunk_id;
	unsigned char type;
	unsigned char pstn_count;
	unsigned char reserved;
	unsigned char res_lid;
	unsigned char trunk_guard_present;
	unsigned char t_lock_dial;
	unsigned char con_caller;
	unsigned char ecf_nol;
	unsigned char ecf_dest;
	unsigned char has_card;	
	unsigned char led_on;	
	unsigned char miss_call_count;
	unsigned char missed_call_alert;
	unsigned char from_miss_c_c;
	unsigned char mcb_calls_counter;
	unsigned char dosa_enable[2];		
	unsigned char guard_no_cnt[2];
	unsigned char voice_enable[2];
	unsigned char ecf_enable[2];
	unsigned char no[6];				
	unsigned char ring[6];				
	unsigned char ecf_no[16];
	unsigned char access[K_MAX_PORTS];
	unsigned char guard_no[2][16];
	unsigned char pas_connected;

}TD;

typedef struct ttrunk_def
{
	unsigned char hunting;				
	unsigned char count;				
	unsigned char through_disa;			
	unsigned char dss_parked;			
	unsigned char routing;				
	unsigned char rr_count;				
	unsigned char group_extns_busy;		
	unsigned char thro_disa;			
	unsigned int  ring_time;			
	unsigned char destination[2];		
	unsigned char prog_hunting[2];		
	unsigned char disa_enable[2];			
	unsigned char trunk_buf[16];		

}TTD;

typedef struct trunkk_def
{
	unsigned int  index;
	unsigned char telco_company;
	unsigned char trunkNamePresent;
	unsigned char trunk_reversal;
	unsigned char trunk_rev_latch;
	unsigned char trunk_rev_det;
	unsigned char trunk_rev_en;

}TDK;

typedef struct redial_no
{
	unsigned char dgt_cnt;
	unsigned char ldgt_cnt;
	unsigned char priority;
	unsigned char trunk_id;
	unsigned char ltrunk_id;
	unsigned char index;
	unsigned char noft;
	unsigned char boss_ring;
}RNO;

typedef struct rredial_no
{
	unsigned char no[16];
	unsigned char lno[16];
}RRNO;

typedef struct trunk_group
{
	unsigned char tid[K_MAX_PNT];
	unsigned char lcr_type;
	unsigned char no[14];
	unsigned char index;

}T_GROUP;


typedef struct day_night_week_time
{
	unsigned char day_time[2];
	unsigned char night_time[2];
	unsigned char ls_time[2];
	unsigned char le_time[2];
}DNWT;

typedef struct printable_line
{
	unsigned char p_data[82];
	unsigned char line_index;
	unsigned char char_index;
	unsigned char print_type;
	unsigned char date[3];
	unsigned char no;
	unsigned char room_no;
	unsigned char header;
	unsigned char cos_rid;
	unsigned int  rid;
	unsigned char padding[34];
}PL;

typedef struct smdr_record {
	unsigned char trunkno;
	unsigned char number[6];
	unsigned char date[3];
	unsigned char time[2];
	unsigned char extn_no;
	unsigned char extn_no1;
	unsigned int  duration;
}SMDR_R;


typedef struct ismdr_record {
	unsigned char trunkno;
	unsigned char number[6];
	unsigned char date[3];
	unsigned char time[2];
	unsigned char extn_no;
	unsigned char extn_no1;
	unsigned int  duration;
}ISMDR_R;

typedef struct prefix
{
	unsigned char prefix_enable;
	unsigned char prefix_digit[4];
	unsigned char prefix_dc;
	unsigned char pfx_dgts_dialed;
	unsigned char reversal_maturity;
}PREFIX;

typedef struct miss_call_back_q{
	unsigned char trunk;
	unsigned char sno;
}MCBQ;

typedef struct trunk_smdr_record {
	unsigned char number[6];
	unsigned char date[3];
	unsigned char time[2];
	unsigned char extn_no;
	unsigned char extn_no1;
	unsigned char storage_id;
	unsigned int  duration;
}T_SMDR_R;

typedef struct basic_service_provider{

	unsigned char counter;
	unsigned char pos;
	unsigned char padding[14];
	unsigned char entries[K_MAX_PNT];

}BSP;

extern MCBQ               xdata mcbq[MISS_CALL_BUF];
extern T_SMDR_R		  xdata trunk_report_smdr[K_MAX_PNT];
extern PBOOK		  xdata pname[100];
extern EXTN_DATA	  xdata ln[K_MAX_PORTS];
extern ALARM_TIME	  xdata al[K_MAX_PORTS];
extern CB		  xdata cb[K_MAX_PORTS];
extern HQ		  xdata hq[K_MAX_PORTS];
extern CHQ		  xdata chq[K_MAX_PORTS];
extern HQ		  xdata tlq[K_MAX_PORTS];
extern THQ		  xdata thq[K_MAX_PORTS];
extern PHQ		  xdata phq[K_MAX_PORTS];
extern RNO		  xdata rno[K_MAX_PORTS];
extern RRNO		  xdata rrno[K_MAX_PORTS];
extern TD		  xdata trunk[K_MAX_PNT];
extern TTD		  xdata ttrunk[K_MAX_PNT];
extern TDK		  xdata trunkk[K_MAX_PNT];
extern EG		  xdata tl_group[K_MAX_GROUPS+1];	
extern SMDR_R		  xdata report_smdr[OUT_CALL_BUF];
extern ISMDR_R		  xdata i_call_report[INC_CALL_BUF];
extern PL		  xdata line;
extern GM		  xdata gm[200];
extern DNWT		  xdata dnwt[7];
extern T_GROUP		  xdata t_group[2];
extern PREFIX		  xdata pfx[K_MAX_PNT];
extern BSP		  xdata bsp[9];

 


When we are running PC-Lint from Keil C51 -> tools -> Lint all C-Source Files, PC-lint is generating the following warnings for some structure members: Text from PC-Lint.pdf

Info 768 : global struct member 'Symbol' (Location) not referenced:
-- A member (name provided as Symbol) of a struct or union appeared in a non-library header file but was not used in any module comprising the program. This message is suppressed for unit checkout. Since struct's may be replicated in storage, finding an unused member can pay handsome storage dividends. However, many structures merely reflect an agreed upon convention for accessing storage and for any one program many members are unused. In this case, receiving this message can be a nuisance. One convenient way to avoid unwanted messages (other than the usual -e and -esym) is to always place such structures in library header files. Alternatively, you can place the struct within a ++flb ... --flb sandwich to force it to be considered library.

Info 770 : tag 'Symbol' defined identically at Location:
-- A member (name provided as Symbol) of an enum appeared in a non-library header file but was not used in any module comprising the program. This message is suppressed for unit checkout. There are reasons why a programmer may occasionally want to retain an unused enum and for this reason this message is distinguished from 768 (unused member). See message 768 for ways of selectively suppressing this message.

Q1. Is it a proper method of declaring structures and defining their scope which we implemented in our code?

Q2. What is the alternate method of declaring and defining this type of structures when sharing them between different source modules?

Q3. Is there any method that PC-Lint follows to deal with code banking in 8052?

Kindly suggest.
Thanks in advance.


List of 6 messages in thread
TopicAuthorDate
Structure definition in code banking modules 8052            01/01/70 00:00      
   Don't have two typedef for same type            01/01/70 00:00      
   FAQ - declarations & definitions            01/01/70 00:00      
      declaration and definition interchanged            01/01/70 00:00      
         Follow conventions            01/01/70 00:00      
            Coincidental Cohesion            01/01/70 00:00      

Back to Subject List