Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 1141)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 1266)
@@ -1,3 +1,22 @@
                                                                   -*-*- END -*-*-
+
+ 2002/04/04 - Thomas Bretz:
+ 
+   * cosy.cc:
+     - redirected logging output also to screen
+
+   * base/msgqueue.cc:
+     - qualified void-pointer in delete-statements
+
+   * candrv/canopen.cc, candrv/vmodican.cc, candrv/network.cc:
+     - added some more output
+
+   * candrv/vmodican.cc:
+     - added a more informative ouput in case of open fails and exit
+
+   * videodev/Camera.cc:
+     - qualified return value of mmap
+
+
 
  2001/12/21 - Thomas Bretz:
Index: trunk/MagicSoft/Cosy/base/msgqueue.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 1141)
+++ trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 1266)
@@ -3,4 +3,5 @@
 #include <iostream.h>
 
+#include <unistd.h>        // usleep
 #include <sys/resource.h>  // PRIO_PROCESS
 
@@ -14,5 +15,5 @@
 {
     pthread_cancel(fThread);
-    delete fMp;
+    delete (unsigned char*)fMp;
 }
 
@@ -87,5 +88,5 @@
     fMsg = msg;
 
-    delete fMp;
+    delete (unsigned char*)fMp;
     fMp = new unsigned char[size];
 
Index: trunk/MagicSoft/Cosy/candrv/canopen.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/canopen.cc	(revision 1141)
+++ trunk/MagicSoft/Cosy/candrv/canopen.cc	(revision 1266)
@@ -51,4 +51,6 @@
             pthread_mutex_lock(&fPdoMux[i][j]);
         }
+
+    lout << "- CanOpen initialized." << endl;
 }
 
Index: trunk/MagicSoft/Cosy/candrv/network.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/network.cc	(revision 1141)
+++ trunk/MagicSoft/Cosy/candrv/network.cc	(revision 1266)
@@ -74,4 +74,6 @@
     for (int i=0; i<32; i++)
         fNodes[i] = NULL;
+
+    lout << "- Network initialized." << endl;
 }
 
@@ -233,9 +235,9 @@
         if (fNodes[i])
         {
-            lout << "- Initializing Node #" << dec << i << endl;
+            lout << "- Setting up Node #" << dec << i << endl;
             fNodes[i]->InitDevice(this);
             fNodeInitialized[i] = TRUE;
         }
-    lout << "- All Nodes initialized." << endl;
+    lout << "- All Nodes setup." << endl;
 }
 
Index: trunk/MagicSoft/Cosy/candrv/nodedrv.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/nodedrv.cc	(revision 1141)
+++ trunk/MagicSoft/Cosy/candrv/nodedrv.cc	(revision 1266)
@@ -73,4 +73,6 @@
         fName += (int)nodeid;
     }
+
+    lout << "- Node #" << nodeid << " (" << name << ") initialized." << endl;
 }
 
Index: trunk/MagicSoft/Cosy/candrv/vmodican.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/vmodican.cc	(revision 1141)
+++ trunk/MagicSoft/Cosy/candrv/vmodican.cc	(revision 1266)
@@ -39,4 +39,5 @@
 #include <unistd.h>        // read
 #include <pthread.h>       // pthread_create
+#include <sys/time.h>      // gettimeofday
 #include <sys/ioctl.h>     // ioctl
 #include <sys/resource.h>  // PRIO_PROCESS
@@ -592,8 +593,9 @@
     {
         lout << "Error: Opening device '" << devname << "' (rc=" << fd << ")" << endl;
+        lout << strerror(errno) << endl;
         return FALSE;
     }
 
-    lout << "- Device " << devname << " open." << endl;
+    lout << "- Device " << devname << " #" << fd << " open." << endl;
 
     return TRUE;
@@ -921,5 +923,10 @@
     Detach();
 
-    Open(dev);                         // open module
+    if (!Open(dev))
+    {
+        cout << "Cannot open device '" << dev << "'... exit." << endl;
+        cout << strerror(errno) << endl;
+        exit(1);                       // open module
+    }
     Reset();
     EnableFifo();                      // connect to host (in interrupt mode)
@@ -931,5 +938,8 @@
      EnableFastCan(50, 50);
      SetTermination(0);
-    */
+     */
+
+    lout << "- VmodIcan initialized." << endl;
+
 }
 
Index: trunk/MagicSoft/Cosy/cosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/cosy.cc	(revision 1141)
+++ trunk/MagicSoft/Cosy/cosy.cc	(revision 1266)
@@ -12,5 +12,10 @@
 
 #define clog(txt) \
-    lout << edev(MLog::eStdout) << txt << endl << ddev(MLog::eStdout)
+    { \
+    const Bool_t is = lout.IsOutputDeviceEnabled(MLog::eStdout); \
+    lout << edev(MLog::eStdout) << txt << endl; \
+    if (is) \
+    lout.EnableOutputDevice(MLog::eStdout); \
+    }
 
 int main(int argc, char **argv)
@@ -23,4 +28,5 @@
     //
     MLog lout("log/cosy.log", kTRUE);
+    lout.EnableOutputDevice(MLog::eStdout);
 
     clog("Starting Cosy at " << time.GetTimeStr() << " ...");
@@ -37,5 +43,8 @@
     // Create the Network. Device: /dev/dpm_00, Rate: 500kbps
     //
+    clog("- Constructing MCosy.");
     MCosy *cosy = new MCosy("/dev/dpm_00", 500, lout);
+
+    clog("- Starting MCosy.");
     cosy->Start();
 
Index: trunk/MagicSoft/Cosy/videodev/Camera.cc
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 1141)
+++ trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 1266)
@@ -154,5 +154,5 @@
     // map file (device) into memory
     //
-    pMapBuffer = mmap(0, iBufferSize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+    pMapBuffer = (char*)mmap(0, iBufferSize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
 
     if ((int)pMapBuffer == -1)
Index: trunk/MagicSoft/Cosy/videodev/Camera.h
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 1141)
+++ trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 1266)
@@ -10,4 +10,5 @@
 #include <TROOT.h>
 #include <pthread.h>
+#include <unistd.h>
 #include <sys/time.h>
 #endif
