Pumpkin, Inc.

Pumpkin User Forums

Can't compile OSReadMsg or OSReadMsgQ

For issues specific to TI's MSP430 line of ultra-low-power microcontrollers, including compilers (e.g. Quadravox AQ430), IDEs (e.g. IAR Embedded Workbench) and development tools (e.g. TI MSP-FET430 Flash Emulation Tool).

Can't compile OSReadMsg or OSReadMsgQ

Postby aek » Thu Aug 05, 2004 3:36 am

Dunno -- email me the project (or better yet, a very small test case project).

Thx,

------------------

[This message has been edited by aek (edited August 05, 2004).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Can't compile OSReadMsg or OSReadMsgQ

Postby dcassidy » Thu Aug 05, 2004 9:28 am

IAR 2.21b


I added a n = OSReadMsg(MSG_MODE_P) to some fully functioning code and get Error[Pe513]: a value of type "void *" cannot be assigned to an entity of type "unsigned char"


#define MSG_MODE_P OSECBP(2)
unsigned int n;

I am compiling from source

#define OSEVENTS 5 // #of OSECBP blocks
#define OSENABLE_EVENT_FLAGS TRUE
#define OSENABLE_EVENT_READING TRUE
#define OSEVENT_FLAGS 1 // #of OSEFCBP blocks
#define OSBYTES_OF_EVENT_FLAGS 2
#define OSMESSAGE_QUEUES 1 // #of OSMQCBP blocks
#define OSTASKS 8 // #of OSTCBP blocks
#define OSENABLE_DELAYS TRUE
#define OSBYTES_OF_DELAYS 2
#define OSENABLE_TIMEOUTS TRUE
#define OSENABLE_MESSAGES TRUE
#define OSENABLE_MESSAGE_QUEUES TRUE

What's wrong?

dcassidy
 
Posts: 16
Joined: Tue Feb 17, 2004 12:00 am
Location: Chelmsford, MA, USA

Re: Can't compile OSReadMsg or OSReadMsgQ

Postby aek » Thu Aug 05, 2004 9:49 am

Hi.

n is unsigned int ... you need to assign OSReadMsg() to a message pointer (msgP in the Salvo code examples).

Just because an unsigned int is the same size as a message pointer doesn't mean the compiler will like it

code:
OStypeMsgP msgP;

msgP = OSReadMsg(MSG_MODE_P);


------------------

[This message has been edited by aek (edited August 05, 2004).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Can't compile OSReadMsg or OSReadMsgQ

Postby dcassidy » Thu Aug 05, 2004 10:25 am

OK got that, but now when I check to see if there is stuff in a q I get the following error:Error[Pe165]: too few arguments in function call. I typed in the example and get the same thing at line **
code:
#include "salvo.h"

#define MSGQ2_P OSECBP(6)

void TaskB (void) {
static char oldchar;
char newchar;
OStypeMsgP msgP;

for(;;) {
OS_Delay(1,TaskB1);
** msgP = OSReadMsgQ(MSGQ2_P);
if(msgP) {
newchar = *(char*)msgP;
if(newchar != oldchar) {
oldchar = newchar;
}
}
}
}


[This message has been edited by aek (edited August 05, 2004).]

dcassidy
 
Posts: 16
Joined: Tue Feb 17, 2004 12:00 am
Location: Chelmsford, MA, USA

Re: Can't compile OSReadMsg or OSReadMsgQ

Postby aek » Fri Aug 06, 2004 10:09 am

Hi David.

I'm not sure why it's necessary, but you also need to

code:
#define OSENABLE_EVENT_TRYING TRUE

-- then it will compile fine.

Thanks for the stripped-down project!

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to TI's MSP430

Who is online

Users browsing this forum: No registered users and 2 guests

cron