Commit ec84cd3e authored by claes's avatar claes

Name of byteordering enum changed

parent 44ef765d
/*
* Proview $Id: rt_io_m_pb_ai.c,v 1.5 2007-01-17 12:40:30 claes Exp $
* Proview $Id: rt_io_m_pb_ai.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -275,7 +275,7 @@ static pwr_tStatus IoCardRead (
if (op->BytesPerChannel == 4) {
memcpy(&udata32, local->input_area + op->OffsetInputs + 4*i, 4);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) udata32 = swap32(udata32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) udata32 = swap32(udata32);
data32 = (pwr_tInt32) udata32;
sop->RawValue = 0;
if (op->NumberRepresentation == PB_NUMREP_UNSIGNEDINT)
......@@ -294,7 +294,7 @@ static pwr_tStatus IoCardRead (
else if (op->BytesPerChannel == 3) {
udata32 = 0;
memcpy(&udata32, local->input_area + op->OffsetInputs + 3*i, 3);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) {
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) {
udata32 = swap32(udata32);
udata32 = udata32 >> 8;
}
......@@ -315,7 +315,7 @@ static pwr_tStatus IoCardRead (
}
else if (op->BytesPerChannel == 2) {
memcpy(&udata16, local->input_area + op->OffsetInputs + 2*i, 2);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) udata16 = swap16(udata16);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) udata16 = swap16(udata16);
data16 = (pwr_tInt16) udata16;
sop->RawValue = udata16;
if (op->NumberRepresentation == PB_NUMREP_UNSIGNEDINT)
......
/*
* Proview $Id: rt_io_m_pb_ao.c,v 1.5 2007-01-12 13:28:31 claes Exp $
* Proview $Id: rt_io_m_pb_ao.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -166,12 +166,12 @@ static pwr_tStatus IoCardWrite (
if (op->NumberRepresentation == PB_NUMREP_UNSIGNEDINT) {
udata32 = (pwr_tUInt32) rawvalue;
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) udata32 = swap32(udata32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) udata32 = swap32(udata32);
memcpy(local->output_area + op->OffsetOutputs + 4*i, &udata32, 4);
}
else if (op->NumberRepresentation == PB_NUMREP_SIGNEDINT) {
data32 = (pwr_tInt32) rawvalue;
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) data32 = swap32(data32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) data32 = swap32(data32);
memcpy(local->output_area + op->OffsetOutputs + 4*i, &data32, 4);
}
......@@ -180,12 +180,12 @@ static pwr_tStatus IoCardWrite (
if (op->NumberRepresentation == PB_NUMREP_UNSIGNEDINT) {
udata32 = (pwr_tUInt32) rawvalue;
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) udata32 = swap32(udata32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) udata32 = swap32(udata32);
memcpy(local->output_area + op->OffsetOutputs + 3*i, &udata32, 3);
}
else if (op->NumberRepresentation == PB_NUMREP_SIGNEDINT) {
data32 = (pwr_tInt32) rawvalue;
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) data32 = swap32(data32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) data32 = swap32(data32);
memcpy(local->output_area + op->OffsetOutputs + 3*i, &data32, 3);
}
......@@ -194,12 +194,12 @@ static pwr_tStatus IoCardWrite (
if (op->NumberRepresentation == PB_NUMREP_UNSIGNEDINT) {
udata16 = (pwr_tUInt16) rawvalue;
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) udata16 = swap16(udata16);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) udata16 = swap16(udata16);
memcpy(local->output_area + op->OffsetOutputs + 2*i, &udata16, 2);
}
else if (op->NumberRepresentation == PB_NUMREP_SIGNEDINT) {
data16 = (pwr_tInt16) rawvalue;
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) data16 = swap16(data16);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) data16 = swap16(data16);
memcpy(local->output_area + op->OffsetOutputs + 2*i, &data16, 2);
}
......
/*
* Proview $Id: rt_io_m_pb_di.c,v 1.5 2007-01-12 13:28:31 claes Exp $
* Proview $Id: rt_io_m_pb_di.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -232,7 +232,7 @@ static pwr_tStatus IoCardRead (
memcpy(&data, local->input_area + op->OffsetInputs, op->BytesOfInput);
data32 = (pwr_tUInt32 *) &data;
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) {
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) {
if (op->Orientation == PB_ORIENTATION_WORD) {
data[0] = swap16(data[0]);
data[1] = swap16(data[1]);
......
/*
* Proview $Id: rt_io_m_pb_do.c,v 1.5 2007-01-12 13:28:31 claes Exp $
* Proview $Id: rt_io_m_pb_do.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -125,7 +125,7 @@ static pwr_tStatus IoCardWrite (
io_DoPackWord(cp, &data[0], 0);
if (op->NumberOfChannels > 16) io_DoPackWord(cp, &data[1], 1);
*/
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) {
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) {
if (op->Orientation == PB_ORIENTATION_WORD) {
data[0] = swap16(data[0]);
data[1] = swap16(data[1]);
......
/*
* Proview $Id: rt_io_m_pb_dp_slave.c,v 1.10 2007-11-23 10:07:10 claes Exp $
* Proview $Id: rt_io_m_pb_dp_slave.c,v 1.11 2008-02-05 08:14:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -264,9 +264,9 @@ static pwr_tStatus IoRackInit (
}
chanp->offset = input_counter;
chanp->mask = 1<<chan_di->Number;
if (chan_di->Representation == pwr_eDataRepEnum_Bit16 && op->ByteOrdering == pwr_eByteOrdering_BigEndian)
if (chan_di->Representation == pwr_eDataRepEnum_Bit16 && op->ByteOrdering == pwr_eByteOrderingEnum_BigEndian)
chanp->mask = swap16(chanp->mask);
if (chan_di->Representation == pwr_eDataRepEnum_Bit32 && op->ByteOrdering == pwr_eByteOrdering_BigEndian)
if (chan_di->Representation == pwr_eDataRepEnum_Bit32 && op->ByteOrdering == pwr_eByteOrderingEnum_BigEndian)
chanp->mask = swap32((unsigned short) chanp->mask);
if (chan_di->Number == 0) latent_input_count = GetChanSize(chan_di->Representation);
// printf("Di channel found in %s, Number %d, Offset %d\n", cardp->Name, chan_di->Number, chanp->offset);
......@@ -312,9 +312,9 @@ static pwr_tStatus IoRackInit (
chanp->offset = output_counter;
chan_size = GetChanSize(chan_do->Representation);
chanp->mask = 1<<chan_do->Number;
if (chan_do->Representation == pwr_eDataRepEnum_Bit16 && op->ByteOrdering == pwr_eByteOrdering_BigEndian)
if (chan_do->Representation == pwr_eDataRepEnum_Bit16 && op->ByteOrdering == pwr_eByteOrderingEnum_BigEndian)
chanp->mask = swap16(chanp->mask);
if (chan_do->Representation == pwr_eDataRepEnum_Bit32 && op->ByteOrdering == pwr_eByteOrdering_BigEndian)
if (chan_do->Representation == pwr_eDataRepEnum_Bit32 && op->ByteOrdering == pwr_eByteOrderingEnum_BigEndian)
chanp->mask = swap32((unsigned short) chanp->mask);
if (chan_do->Number == 0) latent_output_count = GetChanSize(chan_do->Representation);
// printf("Do channel found in %s, Number %d, Offset %d\n", cardp->Name, chan_do->Number, chanp->offset);
......
/*
* Proview $Id: rt_io_m_pb_ii.c,v 1.5 2007-01-12 13:28:31 claes Exp $
* Proview $Id: rt_io_m_pb_ii.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -119,12 +119,12 @@ static pwr_tStatus IoCardRead (
if (op->BytesPerChannel == 4) {
if (op->NumberRepresentation == PB_NUMREP_UNSIGNEDINT) {
memcpy(&udata32, local->input_area + op->OffsetInputs + 4*i, 4);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) udata32 = swap32(udata32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) udata32 = swap32(udata32);
*(pwr_tInt32 *) chanp->vbp = (pwr_tInt32) udata32;
}
else if (op->NumberRepresentation == PB_NUMREP_SIGNEDINT) {
memcpy(&data32, local->input_area + op->OffsetInputs + 4*i, 4);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) data32 = swap32(data32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) data32 = swap32(data32);
*(pwr_tInt32 *) chanp->vbp = data32;
}
}
......@@ -132,7 +132,7 @@ static pwr_tStatus IoCardRead (
if (op->NumberRepresentation == PB_NUMREP_UNSIGNEDINT) {
udata32 = 0;
memcpy(&udata32, local->input_area + op->OffsetInputs + 3*i, 3);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) {
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) {
udata32 = swap32(udata32);
udata32 = udata32 >> 8;
}
......@@ -141,7 +141,7 @@ static pwr_tStatus IoCardRead (
else if (op->NumberRepresentation == PB_NUMREP_SIGNEDINT) {
data32 = 0;
memcpy(&data32, local->input_area + op->OffsetInputs + 3*i, 3);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) {
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) {
data32 = swap32(data32);
data32 = data32 >> 8;
}
......@@ -151,12 +151,12 @@ static pwr_tStatus IoCardRead (
else if (op->BytesPerChannel == 2) {
if (op->NumberRepresentation == PB_NUMREP_UNSIGNEDINT) {
memcpy(&udata16, local->input_area + op->OffsetInputs + 2*i, 2);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) udata16 = swap16(udata16);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) udata16 = swap16(udata16);
*(pwr_tInt32 *) chanp->vbp = (pwr_tInt32) udata16;
}
else if (op->NumberRepresentation == PB_NUMREP_SIGNEDINT) {
memcpy(&data16, local->input_area + op->OffsetInputs + 2*i, 2);
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) data16 = swap16(data16);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) data16 = swap16(data16);
*(pwr_tInt32 *) chanp->vbp = (pwr_tInt32) data16;
}
}
......
/*
* Proview $Id: rt_io_m_pb_io.c,v 1.5 2007-01-12 13:28:31 claes Exp $
* Proview $Id: rt_io_m_pb_io.c,v 1.6 2008-02-05 08:14:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -115,16 +115,16 @@ static pwr_tStatus IoCardWrite (
data32 = *(pwr_tInt32 *) chanp->vbp;
if (op->BytesPerChannel == 4) {
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) data32 = swap32(data32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) data32 = swap32(data32);
memcpy(local->output_area + op->OffsetOutputs + 4*i, &data32, 4);
}
else if (op->BytesPerChannel == 3) {
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) data32 = swap32(data32);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) data32 = swap32(data32);
memcpy(local->output_area + op->OffsetOutputs + 3*i, &data32, 3);
}
else if (op->BytesPerChannel == 2) {
data16 = (pwr_tInt16) data32;
if (slave->ByteOrdering == pwr_eByteOrdering_BigEndian) data16 = swap16(data16);
if (slave->ByteOrdering == pwr_eByteOrderingEnum_BigEndian) data16 = swap16(data16);
memcpy(local->output_area + op->OffsetOutputs + 2*i, &data16, 2);
}
else if (op->BytesPerChannel == 1) {
......
/*
* Proview $Id: rt_pb_gsd.cpp,v 1.11 2007-11-16 07:52:54 claes Exp $
* Proview $Id: rt_pb_gsd.cpp,v 1.12 2008-02-05 08:14:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1254,7 +1254,7 @@ int pb_gsd::prm_items_to_data( gsd_sPrmDataItem *item, int item_size,
unsigned short v = (unsigned short) item[i].value;
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
if ( byte_order == pwr_eByteOrdering_LittleEndian)
if ( byte_order == pwr_eByteOrderingEnum_LittleEndian)
memcpy( &data[item[i].ref->Reference_Offset], &v, sizeof(v));
else {
unsigned char b[2];
......@@ -1263,7 +1263,7 @@ int pb_gsd::prm_items_to_data( gsd_sPrmDataItem *item, int item_size,
data[item[i].ref->Reference_Offset+1] = b[0];
}
#elif (pwr_dHost_byteOrder == pwr_dBigEndian)
if ( byte_order == pwr_eByteOrdering_BigEndian)
if ( byte_order == pwr_eByteOrderingEnum_BigEndian)
memcpy( &data[item[i].ref->Reference_Offset], &v, sizeof(v));
else {
unsigned char b[2];
......@@ -1282,7 +1282,7 @@ int pb_gsd::prm_items_to_data( gsd_sPrmDataItem *item, int item_size,
short v = (short) item[i].value;
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
if ( byte_order == pwr_eByteOrdering_LittleEndian)
if ( byte_order == pwr_eByteOrderingEnum_LittleEndian)
memcpy( &data[item[i].ref->Reference_Offset], &v, sizeof(v));
else {
unsigned char b[2];
......@@ -1291,7 +1291,7 @@ int pb_gsd::prm_items_to_data( gsd_sPrmDataItem *item, int item_size,
data[item[i].ref->Reference_Offset+1] = b[0];
}
#elif (pwr_dHost_byteOrder == pwr_dBigEndian)
if ( byte_order == pwr_eByteOrdering_BigEndian)
if ( byte_order == pwr_eByteOrderingEnum_BigEndian)
memcpy( &data[item[i].ref->Reference_Offset], &v, sizeof(v));
else {
unsigned char b[2];
......@@ -1310,7 +1310,7 @@ int pb_gsd::prm_items_to_data( gsd_sPrmDataItem *item, int item_size,
unsigned int v = (unsigned int) item[i].value;
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
if ( byte_order == pwr_eByteOrdering_LittleEndian)
if ( byte_order == pwr_eByteOrderingEnum_LittleEndian)
memcpy( &data[item[i].ref->Reference_Offset], &v, sizeof(v));
else {
unsigned char b[4];
......@@ -1321,7 +1321,7 @@ int pb_gsd::prm_items_to_data( gsd_sPrmDataItem *item, int item_size,
data[item[i].ref->Reference_Offset+3] = b[0];
}
#elif (pwr_dHost_byteOrder == pwr_dBigEndian)
if ( byte_order == pwr_eByteOrdering_BigEndian)
if ( byte_order == pwr_eByteOrderingEnum_BigEndian)
memcpy( &data[item[i].ref->Reference_Offset], &v, sizeof(v));
else {
unsigned char b[4];
......@@ -1342,7 +1342,7 @@ int pb_gsd::prm_items_to_data( gsd_sPrmDataItem *item, int item_size,
int v = (int) item[i].value;
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
if ( byte_order == pwr_eByteOrdering_LittleEndian)
if ( byte_order == pwr_eByteOrderingEnum_LittleEndian)
memcpy( &data[item[i].ref->Reference_Offset], &v, sizeof(v));
else {
unsigned char b[4];
......@@ -1353,7 +1353,7 @@ int pb_gsd::prm_items_to_data( gsd_sPrmDataItem *item, int item_size,
data[item[i].ref->Reference_Offset+3] = b[0];
}
#elif (pwr_dHost_byteOrder == pwr_dBigEndian)
if ( byte_order == pwr_eByteOrdering_BigEndian)
if ( byte_order == pwr_eByteOrderingEnum_BigEndian)
memcpy( &data[item[i].ref->Reference_Offset], &v, sizeof(v));
else {
unsigned char b[4];
......@@ -1422,7 +1422,7 @@ int pb_gsd::prm_data_to_items( gsd_sPrmDataItem *item, int item_size,
case gsd_Unsigned16: {
unsigned short v;
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
if ( byte_order == pwr_eByteOrdering_LittleEndian)
if ( byte_order == pwr_eByteOrderingEnum_LittleEndian)
memcpy( &v, &data[item[i].ref->Reference_Offset], sizeof(v));
else {
unsigned char b[2];
......@@ -1431,7 +1431,7 @@ int pb_gsd::prm_data_to_items( gsd_sPrmDataItem *item, int item_size,
memcpy( &v, b, sizeof(v));
}
#elif (pwr_dHost_byteOrder == pwr_dBigEndian)
if ( byte_order == pwr_eByteOrdering_BigEndian)
if ( byte_order == pwr_eByteOrderingEnum_BigEndian)
memcpy( &v, &data[item[i].ref->Reference_Offset], sizeof(v));
else {
unsigned char b[2];
......@@ -1446,7 +1446,7 @@ int pb_gsd::prm_data_to_items( gsd_sPrmDataItem *item, int item_size,
case gsd_Signed16: {
short v;
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
if ( byte_order == pwr_eByteOrdering_LittleEndian)
if ( byte_order == pwr_eByteOrderingEnum_LittleEndian)
memcpy( &v, &data[item[i].ref->Reference_Offset], sizeof(v));
else {
unsigned char b[2];
......@@ -1455,7 +1455,7 @@ int pb_gsd::prm_data_to_items( gsd_sPrmDataItem *item, int item_size,
memcpy( &v, b, sizeof(v));
}
#elif (pwr_dHost_byteOrder == pwr_dBigEndian)
if ( byte_order == pwr_eByteOrdering_BigEndian)
if ( byte_order == pwr_eByteOrderingEnum_BigEndian)
memcpy( &v, &data[item[i].ref->Reference_Offset], sizeof(v));
else {
unsigned char b[2];
......@@ -1470,7 +1470,7 @@ int pb_gsd::prm_data_to_items( gsd_sPrmDataItem *item, int item_size,
case gsd_Unsigned32: {
unsigned int v;
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
if ( byte_order == pwr_eByteOrdering_LittleEndian)
if ( byte_order == pwr_eByteOrderingEnum_LittleEndian)
memcpy( &v, &data[item[i].ref->Reference_Offset], sizeof(v));
else {
unsigned char b[4];
......@@ -1481,7 +1481,7 @@ int pb_gsd::prm_data_to_items( gsd_sPrmDataItem *item, int item_size,
memcpy( &v, b, sizeof(v));
}
#elif (pwr_dHost_byteOrder == pwr_dBigEndian)
if ( byte_order == pwr_eByteOrdering_BigEndian)
if ( byte_order == pwr_eByteOrderingEnum_BigEndian)
memcpy( &v, &data[item[i].ref->Reference_Offset], sizeof(v));
else {
unsigned char b[4];
......@@ -1498,7 +1498,7 @@ int pb_gsd::prm_data_to_items( gsd_sPrmDataItem *item, int item_size,
case gsd_Signed32: {
int v;
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
if ( byte_order == pwr_eByteOrdering_LittleEndian)
if ( byte_order == pwr_eByteOrderingEnum_LittleEndian)
memcpy( &v, &data[item[i].ref->Reference_Offset], sizeof(v));
else {
unsigned char b[4];
......@@ -1509,7 +1509,7 @@ int pb_gsd::prm_data_to_items( gsd_sPrmDataItem *item, int item_size,
memcpy( &v, b, sizeof(v));
}
#elif (pwr_dHost_byteOrder == pwr_dBigEndian)
if ( byte_order == pwr_eByteOrdering_BigEndian)
if ( byte_order == pwr_eByteOrderingEnum_BigEndian)
memcpy( &v, &data[item[i].ref->Reference_Offset], sizeof(v));
else {
unsigned char b[4];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment