Changeset 6923 for trunk/MagicSoft/Cosy/candrv
- Timestamp:
- 04/11/05 10:58:30 (20 years ago)
- Location:
- trunk/MagicSoft/Cosy/candrv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/candrv/network.cc
r2518 r6923 278 278 // -------------------------------------------------------------------------- 279 279 // 280 // Print all errors which are currently set 281 // 282 void Network::PrintError() const 283 { 284 for (int i=0; i<32; i++) 285 { 286 if (!fNodes[i]) 287 continue; 288 289 if (!fNodes[i]->HasError()) 290 continue; 291 292 lout << "- Node #" << dec << i << " '" << fNodes[i]->GetNodeName() << "' "; 293 294 if (fNodes[i]->GetError() <= 0) 295 lout << "Error occured." << endl; 296 else 297 lout << "has error #" << fNodes[i]->GetError() << endl; 298 } 299 } 300 301 // -------------------------------------------------------------------------- 302 // 280 303 // returns true if one of the nodes has the error-flag set (HasError). 281 304 // … … 354 377 fNodes[i]->CheckConnection(); 355 378 } 356 -
trunk/MagicSoft/Cosy/candrv/network.h
r4105 r6923 37 37 virtual void Stop(); 38 38 39 void PrintError() const; 40 39 41 bool HasError() const; 40 42 bool HasZombie() const; -
trunk/MagicSoft/Cosy/candrv/nodedrv.cc
r4105 r6923 416 416 // queue and no waiting is done, false is returned.. 417 417 // 418 bool NodeDrv::WaitForSdo(WORD_t idx, BYTE_t subidx, WORDS_t timeout )418 bool NodeDrv::WaitForSdo(WORD_t idx, BYTE_t subidx, WORDS_t timeout, bool zombie) 419 419 { 420 420 bool rc = fNetwork->WaitForSdo(fId, idx, subidx, fIsZombie?-1:timeout); 421 422 if (!rc) 423 { 424 lout << "NodeDrv::WaitForSdo: 0x" << hex << idx << "/" << dec << (int)subidx << " " << GetNodeName() << " --> ZOMBIE!" << endl; 421 if (rc) 422 return true; 423 424 lout << " + " << GetNodeName() << ": NodeDrv::WaitForSdo: 0x" << hex << idx << "/" << dec << (int)subidx << " --> ZOMBIE! " << MTime() << endl; 425 if (zombie) 425 426 SetZombie(); 426 } 427 /* 428 if (HasError()) 429 { 430 lout << "NodeDrv::WaitForSdo: HasError 0x" << hex << idx << "/" << dec << (int)subidx << " " << GetNodeName() << " --> ZOMBIE!" << endl; 431 fIsZombie = kTRUE; 432 } 433 */ 434 return fIsZombie ? false : rc; 427 return false; 435 428 } 436 429 -
trunk/MagicSoft/Cosy/candrv/nodedrv.h
r4105 r6923 106 106 107 107 // void WaitForSdos(); 108 bool WaitForSdo(WORD_t idx, BYTE_t subidx=0, WORDS_t timeout=500 );108 bool WaitForSdo(WORD_t idx, BYTE_t subidx=0, WORDS_t timeout=500, bool zombie=true); 109 109 110 110 void EnableCanMsg(BYTE_t fcode);
Note:
See TracChangeset
for help on using the changeset viewer.