Aide sur variable en C

Fermé
byllu - 15 déc. 2010 à 17:13
Bonjour,

Actuellement je programme un µP, avec un USBuart

Mon code est celui-ci:

#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules

BYTE Len;
BYTE pData[128];
int i,j,donnee,duree=0,cmpt=0;
void main(void)
{
M8C_ClearWDTAndSleep;
M8C_EnableGInt; //Enable Global Interrupts
USBUART_Start(USBUART_5V_OPERATION); //Start USBUART 5V operation
while(!USBUART_Init()){M8C_ClearWDTAndSleep;}; //Wait for Device to initialize

while(1)
{

M8C_ClearWDTAndSleep;
Len = USBUART_bGetRxCount(); //Get count of ready data
M8C_ClearWDTAndSleep;
if (Len)
{
USBUART_ReadAll(pData); //Read all data rom RX
while (!USBUART_bTxIsReady()); //If TX is ready
USBUART_Write(pData, Len); //Echo
}
M8C_ClearWDTAndSleep;

Mon problème est que je souhaite comparer ce qui est reçu avec une chaîne de caractère!

et là ça ce corse!

Pour un bit je fait ça:

if (*pData==01)
{
PRT0DR=0x80;
}

ça fonctionne mais si par exemple je reçois 01 03 considère que j'ai reçu 01, il ne tient pas compte du 2nd octet.

après pour une chaîne caractère j'ai donc fait:

if (*pData=="MULTI_OFF")
{
PRT0DR=0x00;
}

Mais là j'ai des erreurs:

!E C:\Users\SKL\DOCUME~1\MAGICM~1\PROGRA~1\24894\PROGRA~1\PROGRA~1\main.c(46): operands of == have illegal types 'unsigned char' and 'pointer to __flash char'

Pouvez m'expliquer comment faire pour comparer mes données reçu à un chaîne de caractère?

et pourquoi ce que j'ai fait ne fonctionne pas?

Merci