Thanks Mark,
Do continue my test I made the following changes :
unsigned char fnSimIIC_devices(QUEUE_HANDLE Channel,unsigned char ucType, unsigned char ucData) { //add Channel parameter
....
fnResetOthers(Channel,(unsigned char)(ucData & ~0x01));//CHG//HP//091109//
....
fnResetOthers(Channel,0);
....
}
and
static void fnResetOthers(QUEUE_HANDLE Channel,unsigned char ucAddress) { //add Channel parameter
....
if ((ucAddress != simDS1340.address)&&(Channel == simDS1340.channel)) {
simDS1340.ucState = 0;
}
if ((ucAddress != simPCF8574[0].address)&&(Channel == simPCF8574[0].channel)) {
simPCF8574[0].ucState = 0;
}
if ((ucAddress != simPCF8574[1].address)&&(Channel == simPCF8574[1].channel)) {
simPCF8574[1].ucState = 0;
}
if ((ucAddress != simPCF8574[2].address)&&(Channel == simPCF8574[2].channel)) {
simPCF8574[2].ucState = 0;
}
...
}
Of course I also added the same variable name on the differents structures :
typedef struct stDS1340
{
unsigned char channel; //<< added
unsigned char address;
unsigned char ucState;
unsigned char ucRW;
unsigned char ucInternalPointer;
TIME_BLOCK bTime;
} DS1340;
static DS1340 simDS1340 = {0,0xd0, 0};//<< channel 0:
#define ADDRESS_PCF8574_1 0x40
#define ADDRESS_PCF8574_2 0x42
#define ADDRESS_PCF8574_3 0x44
typedef struct stPCF8574
{
unsigned char channel; // << added
unsigned char address;
unsigned char ucState;
unsigned char ucRW;
unsigned char ucOutput;
} PCF8574;
static PCF8574 simPCF8574[3] = { //<< channel 1 for all
{1,ADDRESS_PCF8574_1, 0},
{1,ADDRESS_PCF8574_2, 0},
{1,ADDRESS_PCF8574_3, 0} };
Thanks for your comments.