主题 : ADS1.2编译 错误提示implicit cast of pointer to non-equal pointer 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 22786
精华: 0
发帖: 9
金钱: 45 两
威望: 9 点
综合积分: 18 分
注册时间: 2010-06-07
最后登录: 2013-04-06
楼主  发表于: 2010-09-29 08:10

 ADS1.2编译 错误提示implicit cast of pointer to non-equal pointer



#define GSM_G



// System Head File



#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>



// User Head File
#include "option.h"
#include "2440addr.h"
#include "def.h"



//#include "mainfile.h"
#include "serial.h"
#include "GSM.h"








void SendMessage1(uchar *buf)
{



UartSendString(1,buf);




}



uchar mess_buf_in_end = 0;




// 发送AT指令
void ATCommand(uchar *mess, uchar flag)
{
mess_buf_in_end = 0;
Uart1.pIn = 0;
SendMessage1(mess);  // 串口发送数据
if(flag) SendMessage1("\r\n");   //出错位置
}




// 等待GSM数据
char WaitMessageBack(uchar *mess, uchar n)
{
for(;;)
{
  if(mess_buf_in_end == 1)
  {
   mess_buf_in_end = 0;
   if(!strncmp(Uart1.buf, mess, n))  //出错位置
   {
    return TRUE;
   }
  }
}
}




// 接收AT指令数据
void Receive_Mess(uchar ch)
{
switch (ch)
{
case 0x0d:  //行结束符



  Uart1.buf[Uart1.pIn] = '\0';
  Uart1.pIn = 0;
  mess_buf_in_end = 1;



  break;
case 0x0a:  //不予理睬
  break;
default:
  Uart1.buf[Uart1.pIn++] = ch ;
  if(Uart1.pIn >= 0xff) Uart1.pIn = 0xff;
  break;
}
}




// 初始化短信息
void SMSInit(void)
{
ATCommand("ATE0",1);      // 关闭回显
WaitMessageBack("OK",2);
ATCommand("AT+CCID",1);  // 查看SIM 卡
Delay(3000) ;
ATCommand("AT+CSCA=\"+8613800200500\"",1); // 设置在广州地区的服务中心号码
WaitMessageBack("OK",2);
ATCommand("AT+CMGF=1",1);  // 设置为文本方式
WaitMessageBack("OK",2);
ATCommand("AT+CNMI=2,1,0,0,0",1);
WaitMessageBack("OK",2);
}



// 发英文短信
// number 为手机号码
// mess  为短信内容
void SendSMS(uchar *number, uchar *mess)
{
uchar buf[2]={0x1A, 0x00};
ATCommand("AT+CMGS=\"", 0);
ATCommand(number, 0);
ATCommand("\"", 1);
Delay(3000) ;
ATCommand(mess, 0);
ATCommand(buf, 0);
WaitMessageBack("+CMGS",5);
}

一直提示这个变量类型不匹配错误  高手麻烦看下怎么修改  uchar 改成char 错误依旧