Changeset 1140 for trunk


Ignore:
Timestamp:
12/21/01 12:36:22 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/candrv/canopen.cc

    r1138 r1140  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz, 2001 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz <mailto:tbretz@uni-sw.gwdg.de>, 2001
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2001
     
    7878//  HandlePDO1/2/3/4:handles received PDOs
    7979//
    80 void CanOpen::HandleCanMessage(WORD_t cobid, BYTE_t *data, struct timeval *tv)
     80void CanOpen::HandleCanMessage(WORD_t cobid, BYTE_t *data, timeval_t *tv)
    8181{
    8282    const WORD_t fcode = cobid >> 7;
  • trunk/MagicSoft/Cosy/candrv/network.cc

    r1138 r1140  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz, 2001 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz <mailto:tbretz@uni-sw.gwdg.de>, 2001
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2001
     
    8585//  HandleSDOError: Handles error occursion (see CanOpen standard)
    8686//
    87 void Network::HandleSDO(BYTE_t node, BYTE_t cmd, WORD_t idx, BYTE_t subidx, LWORD_t data, struct timeval *tv)
     87void Network::HandleSDO(BYTE_t node, BYTE_t cmd, WORD_t idx, BYTE_t subidx, LWORD_t data, timeval_t *tv)
    8888{
    8989    switch (cmd)
     
    139139// Distributes PDO1 messages to the correspoding node calling HandlePDO1
    140140//
    141 void Network::HandlePDO1(BYTE_t node, BYTE_t *data, struct timeval *tv)
     141void Network::HandlePDO1(BYTE_t node, BYTE_t *data, timeval_t *tv)
    142142{
    143143    if (!fNodes[node])
     
    157157// Distributes PDO2 messages to the correspoding node calling HandlePDO2
    158158//
    159 void Network::HandlePDO2(BYTE_t node, BYTE_t *data, struct timeval *tv)
     159void Network::HandlePDO2(BYTE_t node, BYTE_t *data, timeval_t *tv)
    160160{
    161161    if (!fNodes[node])
     
    175175// Distributes PDO3 messages to the correspoding node calling HandlePDO3
    176176//
    177 void Network::HandlePDO3(BYTE_t node, BYTE_t *data, struct timeval *tv)
     177void Network::HandlePDO3(BYTE_t node, BYTE_t *data, timeval_t *tv)
    178178{
    179179    if (!fNodes[node])
     
    193193// Distributes PDO4 messages to the correspoding node calling HandlePDO4
    194194//
    195 void Network::HandlePDO4(BYTE_t node, BYTE_t *data, struct timeval *tv)
     195void Network::HandlePDO4(BYTE_t node, BYTE_t *data, timeval_t *tv)
    196196{
    197197    if (!fNodes[node])
  • trunk/MagicSoft/Cosy/candrv/network.h

    r1139 r1140  
    1111    int fNodeInitialized[32];
    1212
    13     void HandleSDO(BYTE_t node, BYTE_t cmd, WORD_t idx, BYTE_t subidx, LWORD_t data, struct timeval *tv);
    14     void HandlePDO1(BYTE_t node, BYTE_t *data, struct timeval *tv);
    15     void HandlePDO2(BYTE_t node, BYTE_t *data, struct timeval *tv);
    16     void HandlePDO3(BYTE_t node, BYTE_t *data, struct timeval *tv);
    17     void HandlePDO4(BYTE_t node, BYTE_t *data, struct timeval *tv);
     13    void HandleSDO(BYTE_t node, BYTE_t cmd, WORD_t idx, BYTE_t subidx, LWORD_t data, timeval *tv);
     14    void HandlePDO1(BYTE_t node, BYTE_t *data, timeval_t *tv);
     15    void HandlePDO2(BYTE_t node, BYTE_t *data, timeval_t *tv);
     16    void HandlePDO3(BYTE_t node, BYTE_t *data, timeval_t *tv);
     17    void HandlePDO4(BYTE_t node, BYTE_t *data, timeval_t *tv);
    1818
    1919    void InitNodes();
  • trunk/MagicSoft/Cosy/candrv/nodedrv.cc

    r1139 r1140  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz, 2001 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz <mailto:tbretz@uni-sw.gwdg.de>, 2001
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2001
     
    3232//  virtual void InitDevice(Network *net)
    3333//  virtual void StopDevice()
    34 //  virtual void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, struct timeval *tv)
     34//  virtual void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv)
    3535//  virtual void HandleSDOOK(WORD_t idx, BYTE_t subidx)
    3636//  virtual void HandleSDOError(LWORD_t data)
    37 //  virtual void HandlePDO1(BYTE_t *data, struct timeval *tv)
    38 //  virtual void HandlePDO2(BYTE_t *data, struct timeval *tv)
    39 //  virtual void HandlePDO3(BYTE_t *data, struct timeval *tv)
    40 //  virtual void HandlePDO4(BYTE_t *data, struct timeval *tv)
     37//  virtual void HandlePDO1(BYTE_t *data, timeval_t *tv)
     38//  virtual void HandlePDO2(BYTE_t *data, timeval_t *tv)
     39//  virtual void HandlePDO3(BYTE_t *data, timeval_t *tv)
     40//  virtual void HandlePDO4(BYTE_t *data, timeval_t *tv)
    4141//
    4242///////////////////////////////////////////////////////////////////////
     
    141141// Prints the received SDo from this device
    142142//
    143 void NodeDrv::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, struct timeval *tv)
     143void NodeDrv::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv)
    144144{
    145145    cout << "SdoRx: Idx=0x"<< hex << idx << "/" << (int)subidx;
  • trunk/MagicSoft/Cosy/candrv/nodedrv.h

    r1139 r1140  
    1212typedef UInt_t   LWORD_t;
    1313typedef Int_t    LWORDS_t;
    14 struct timeval;
    1514#else
    1615#include "gendef.h"
    1716#endif
     17
     18typedef struct timeval timeval_t;
    1819
    1920class Network;
     
    4748    bool HasError()       { return fError; }
    4849
    49     virtual void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, struct timeval *tv);
     50    virtual void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv);
    5051    virtual void HandleSDOOK(WORD_t idx, BYTE_t subidx);
    5152    virtual void HandleSDOError(LWORD_t data);
    5253
    53     virtual void HandlePDO1(BYTE_t *data, struct timeval *tv) {};
    54     virtual void HandlePDO2(BYTE_t *data, struct timeval *tv) {};
    55     virtual void HandlePDO3(BYTE_t *data, struct timeval *tv) {};
    56     virtual void HandlePDO4(BYTE_t *data, struct timeval *tv) {};
     54    virtual void HandlePDO1(BYTE_t *data, timeval_t *tv) {};
     55    virtual void HandlePDO2(BYTE_t *data, timeval_t *tv) {};
     56    virtual void HandlePDO3(BYTE_t *data, timeval_t *tv) {};
     57    virtual void HandlePDO4(BYTE_t *data, timeval_t *tv) {};
    5758
    5859    void SendPDO1(BYTE_t data[8]);
  • trunk/MagicSoft/Cosy/candrv/vmodican.cc

    r1137 r1140  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz, 2001 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz <mailto:tbretz@uni-sw.gwdg.de>, 2001
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2001
     
    110110    {
    111111        unsigned char c;
    112         struct timeval tv;
     112        timeval_t tv;
    113113
    114114        //
     
    183183// by the can interface
    184184//
    185 void VmodIcan::HandleMessage(Message *msg, struct timeval *tv)
     185void VmodIcan::HandleMessage(Message *msg, timeval_t *tv)
    186186{
    187187    //
  • trunk/MagicSoft/Cosy/candrv/vmodican.h

    r1139 r1140  
    44#include <pthread.h>
    55
    6 #include "unistd.h"          // gettimeofday
     6#include <unistd.h>          // gettimeofday
    77
    88#include "log.h"
     
    2121class FastMessage;
    2222
     23typedef struct timeval timeval_t;
     24
    2325class VmodIcan : public Log, protected MThread
    2426{
     
    3234    void *Thread();
    3335
    34     void HandleMessage(Message *msg, struct timeval *tv);
    35     virtual void HandleCanMessage(WORD_t cobid, BYTE_t *data, struct timeval *tv) {}
     36    void HandleMessage(Message *msg, timeval_t *tv);
     37    virtual void HandleCanMessage(WORD_t cobid, BYTE_t *data, timeval_t *tv) {}
    3638
    3739    int Receive(Message *pm);
  • trunk/MagicSoft/Cosy/devdrv/macs.cc

    r1109 r1140  
    2424}
    2525
    26 void Macs::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, struct timeval *tv)
     26void Macs::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv)
    2727{
    2828    switch (idx)
     
    325325}
    326326
    327 void Macs::HandlePDO1(BYTE_t *data, struct timeval *tv)
     327void Macs::HandlePDO1(BYTE_t *data, timeval_t *tv)
    328328{
    329329    fPdoPos    = (data[4]<<24) | (data[5]<<16) | (data[6]<<8) | data[7];
     
    335335}
    336336
    337 void Macs::HandlePDO2(BYTE_t *data, struct timeval *tv)
     337void Macs::HandlePDO2(BYTE_t *data, timeval_t *tv)
    338338{
    339339    LWORDS_t errnum = (data[0]<<24) | (data[1]<<16) | (data[2]<<8) | data[3];
  • trunk/MagicSoft/Cosy/devdrv/macs.h

    r1109 r1140  
    4646    void StopDevice();
    4747
    48     void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, struct timeval *tv);
     48    void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv);
    4949    void HandleSDOOK(WORD_t idx, BYTE_t subidx);
    5050    void HandleSDOError(LWORD_t data)           { NodeDrv::HandleSDOError(data); }
    5151
    52     void HandlePDO1(BYTE_t *data, struct timeval *tv);
    53     void HandlePDO2(BYTE_t *data, struct timeval *tv);
     52    void HandlePDO1(BYTE_t *data, timeval_t *tv);
     53    void HandlePDO2(BYTE_t *data, timeval_t *tv);
    5454
    5555    void SendMsg(BYTE_t data[6]);
  • trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc

    r1109 r1140  
    2424}
    2525
    26 void ShaftEncoder::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, struct timeval *tv)
     26void ShaftEncoder::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv)
    2727{
    2828    switch (idx)
     
    115115}
    116116
    117 void ShaftEncoder::HandlePDOType0(BYTE_t *data, struct timeval *tv)
     117void ShaftEncoder::HandlePDOType0(BYTE_t *data, timeval_t *tv)
    118118{
    119119    //
     
    129129}
    130130
    131 void ShaftEncoder::HandlePDOType1(BYTE_t *data, struct timeval *tv)
     131void ShaftEncoder::HandlePDOType1(BYTE_t *data, timeval_t *tv)
    132132{
    133133    //
     
    147147}
    148148
    149 void ShaftEncoder::HandlePDOType2(BYTE_t *data, struct timeval *tv)
     149void ShaftEncoder::HandlePDOType2(BYTE_t *data, timeval_t *tv)
    150150{
    151151    //
  • trunk/MagicSoft/Cosy/devdrv/shaftencoder.h

    r1109 r1140  
    2626    Timer fTime;
    2727
    28     void HandlePDOType0(BYTE_t *data, struct timeval *tv);
    29     void HandlePDOType1(BYTE_t *data, struct timeval *tv);
    30     void HandlePDOType2(BYTE_t *data, struct timeval *tv);
     28    void HandlePDOType0(BYTE_t *data, timeval_t *tv);
     29    void HandlePDOType1(BYTE_t *data, timeval_t *tv);
     30    void HandlePDOType2(BYTE_t *data, timeval_t *tv);
    3131
    3232    void ReqPos();
     
    4343    void SetDisplay(TGLabel **label) { fLabel = label; }
    4444
    45     void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, struct timeval *tv);
     45    void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv);
    4646    void HandleSDOOK(WORD_t idx, BYTE_t subidx) { NodeDrv::HandleSDOOK(idx, subidx); }
    4747    void HandleSDOError(LWORD_t data)           { NodeDrv::HandleSDOError(data); }
    4848
    49     void HandlePDO1(BYTE_t *data, struct timeval *tv) { HandlePDOType2(data, tv); }
    50     void HandlePDO2(BYTE_t *data, struct timeval *tv) { HandlePDOType2(data, tv); }
     49    void HandlePDO1(BYTE_t *data, timeval_t *tv) { HandlePDOType2(data, tv); }
     50    void HandlePDO2(BYTE_t *data, timeval_t *tv) { HandlePDOType2(data, tv); }
    5151
    5252    LWORDS_t GetPos() { return fPos+fTurn*fTicks; }
Note: See TracChangeset for help on using the changeset viewer.