ROBOTC.net forums
http://www.robotc.net/forums/

**Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3.51
http://www.robotc.net/forums/viewtopic.php?f=41&t=4875
Page 1 of 1

Author:  JamieD [ Sun Sep 23, 2012 12:37 am ]
Post subject:  **Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3.51

With the upgrade to ROBOTC 3.51 we're now getting the following error. It's coming out of common.h, from the 3rdPartyDrivers version 2.8 when common.h is pulled in via:
#include "drivers/HTSMUX-driver.h"
#include "drivers/HTANG-driver.h"

**Error**:Calling procedure 'sendI2CMsg'. '*' Indirection levels mismatch. Parameter: 'unsigned const char * pSendMsg'. Expression: 'error_array[0]'. Type: 'ubyte'
**Error**:Calling procedure 'sendI2CMsg'. '*' Indirection levels mismatch. Parameter: 'unsigned const char * pSendMsg'. Expression: 'data[0]'. Type: 'tByteArray &'
**Error**:Calling procedure 'sendI2CMsg'. '*' Indirection levels mismatch. Parameter: 'unsigned const char * pSendMsg'. Expression: 'data[0]'. Type: 'tByteArray &'
**Error**:Calling procedure 'readI2CReply'. '*' Indirection levels mismatch. Parameter: 'unsigned char * pReplyBytes'. Expression: 'data[0]'. Type: 'tByteArray &'

I believe this will get fixed with Xander's rewrite to 3.x of his driver suite. Is there a reasonable way to get past this fixing it in common.h of 3rdPartyDriverSuite 2.8 in the meantime? I would like to both fix, and make an effort to understand what's going on here.

Best Regards,
Jamie Diamond

Author:  mightor [ Sun Sep 23, 2012 1:18 am ]
Post subject:  Re: **Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3

There's probably a way to get rid of the errors/warnings but I don't know if that'll make it work :)

replace arrayname[0] for every call to sendI2CMsg with &arrayname[0]

This may or may not work, I have no idea and I have no way of testing that since I am about 700km away from my NXTs right now :)

- Xander

Author:  didiercoll [ Sun Sep 23, 2012 3:13 am ]
Post subject:  Re: **Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3

* common.h provides a number of frequently used functions that are useful for writing
* drivers.

File: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ROBOTC\rdpartyrobotcdr-v2.8\drivers\common.h

#include "firmwareVersion.h"

Hello

I have same problems as Jamied with

HTGYRO-driver.h provides an API for the HiTechnic Gyroscopic Sensor.

which call common.h

but it call

firmwareVersion.h

which nis not in my files in the computer ..... ????

and it seems to be a very important file ?

was working last sunday .

perhaps are you working on firmwareVersion.h?
and it will come back later ?

didier

Author:  MHTS [ Sun Sep 23, 2012 3:24 am ]
Post subject:  Re: **Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3

Here is how I fixed common.h. Basically change in four places adding '&' in front of the array name (like what Xander said).
Code:
     1.1 --- a/RobotCDrivers/drivers/common.h   Sun Aug 26 09:55:31 2012 -0700
     1.2 +++ b/RobotCDrivers/drivers/common.h   Wed Sep 19 05:09:27 2012 -0700
     1.3 @@ -162,7 +162,7 @@
     1.4  #endif // __COMMON_H_DEBUG__
     1.5 
     1.6    for (int i = 0; i < 5; i++) {
     1.7 -    sendI2CMsg(link, error_array[0], 0);
     1.8 +    sendI2CMsg(link, &error_array[0], 0);
     1.9      wait1Msec(5);
    1.10    }
    1.11  }
    1.12 @@ -246,11 +246,11 @@
    1.13        return false;
    1.14    }
    1.15 
    1.16 -  sendI2CMsg(link, data[0], replylen);
    1.17 +  sendI2CMsg(link, &data[0], replylen);
    1.18 
    1.19    if (!waitForI2CBus(link)) {
    1.20      clearI2CError(link, data[1]);
    1.21 -    sendI2CMsg(link, data[0], replylen);
    1.22 +    sendI2CMsg(link, &data[0], replylen);
    1.23      if (!waitForI2CBus(link))
    1.24        return false;
    1.25    }
    1.26 @@ -300,7 +300,7 @@
    1.27      return false;
    1.28 
    1.29    // ask for the input to put into the data array
    1.30 -  readI2CReply(link, data[0], replylen);
    1.31 +  readI2CReply(link, &data[0], replylen);
    1.32 
    1.33    return true;
    1.34  }

Author:  didiercoll [ Sun Sep 23, 2012 4:30 am ]
Post subject:  Re: **Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3

Ok

true

it works

it seems to be the key of lot of problems ?

but it is strange that it call

#include "firmwareVersion.h"

if this file is not in the computer ?

in any way thanks

didier

Author:  NeXT-Generation [ Sun Sep 23, 2012 9:02 am ]
Post subject:  Re: **Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3

Thanks!! I was trying to fix this myself... But, you know me...

EDIT: confirmed and working with my PID LineLeader line-follower.

Author:  MikeJMcFarlane [ Mon Sep 24, 2012 6:28 am ]
Post subject:  Re: **Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3

mightor wrote:
There's probably a way to get rid of the errors/warnings but I don't know if that'll make it work :)

replace arrayname[0] for every call to sendI2CMsg with &arrayname[0]

This may or may not work, I have no idea and I have no way of testing that since I am about 700km away from my NXTs right now :)

- Xander


This fixed my prob too, thanks.

Hope the hol is going well and you aren't spending all your time glued to the forum:-)

Author:  mightor [ Mon Sep 24, 2012 3:14 pm ]
Post subject:  Re: **Error**:Calling procedure 'sendI2CMsg' - with ROBOTC 3

Oh, I am not, don't worry :) I am back now but totally pooped. Hopefully I can do some final testing of my suite tomorrow evening and then release the first beta, so you guys can get your hands dirty with it.

- Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/