找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 57442|回復(fù): 13
打印 上一主題 下一主題
收起左側(cè)

搞定keil:error C132: : not in formal parameter list

  [復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:60076 發(fā)表于 2014-4-9 13:40 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
1:  keil 的一個(gè)小錯(cuò)誤 error C132: : not in formal parameter list 如果同時(shí)調(diào)用多個(gè)函數(shù)C H 文件,當(dāng)調(diào)用某個(gè)H 文件,莫名其妙的出錯(cuò),而且報(bào)錯(cuò)非常多。原因:原來(lái)是在H文件 函數(shù)聲明 void init_ADC()時(shí)漏了一個(gè)小小的“;” 分號(hào)。就錯(cuò)了很多地方。。所以每次函數(shù)聲明時(shí)候,copy后,一定要在最后加上分號(hào) ; .。

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂4 踩
回復(fù)

使用道具 舉報(bào)

沙發(fā)
ID:44262 發(fā)表于 2014-7-17 17:41 來(lái)自手機(jī) | 只看該作者
幫了我的大忙 謝謝
回復(fù)

使用道具 舉報(bào)

板凳
ID:87829 發(fā)表于 2015-8-7 13:24 | 只看該作者
#include<stdio.h>
#include<reg51.h>
#include<intrins.h>/*子函數(shù)聲明*/
void exdelay(void);
void putchar(unsigned int c);
void putstr(unsigned char code *s);
void putsrxy(unsigned char cx,unsigned char cy,unsigned char code *s );
void setcharcgram(unsigned char cindex,unsigned char code *s);
void charursornext(void);
void putimage(unsigned char code *s);
void putsizeimage(unsigned char XSIZE,unsigned charYSIZE,unsigned char code *s) ;
void glcbpos(void);
void charlcbpos(void);
void lcdreset(void);
void delay3ms(void);
void lcdon(void);
void lcoff(void);
void lcgraphon(void);
void lcgraphoff(void);
unsigned char lcdrd(void);
void lcdwd(unsigned char d );
void lcdwc(unsigned char c);
void lcdwaitidle(void);
sbit RSPIN=P3^2;
sbit RWPIN=P3^3;
sbit PEIN=P3^4;
unsigned char CXPOS;
unsigned char CYPOS;
unsigned char GXPOS;
unsigned char GYPOS;
#define USECHAR1CODE 0xffff;
#define USECHAR2CODE 0xfffd;
#define USECHAR3CODE 0xfffb;
#define USECHAR4CODE 0xfff9;
unsigned char code CHAR1CGRAMTAB[]={
0x00,0x0f,
0x00,0x7f,
0x01,0xf0,
0x03,0xc0,
0x07,0x0f,
0x0e,0x3f,
0x1c,0xfe,
0x39,0xfc,
0x33,0xfc,
0x73,0xfe,
0x67,0xff,
0x67,0xe7,
0xcf,0xe3,
0xcf,0xe1,
0xcf,0xe4,
0xc0,0x06
};
unsigned char code CHAR2CGRAMTAB[]={
0xf0,0x00,
0xfe,0x00,
0x0f,0x80,
0x03,0xc0,
0xf0,0xe0,
0xfc,0x70,
0x7f,0x38,
0x3f,0x9c,
0x3f,0xcc,
0x7f,0xce,
0xff,0xe6,
0xe7,0xe6,
0xc7,0xf3,
0x87,0xff,
0x27,0xff,
0x60,0x03
};
unsigned char code CHAR3CGRAMTAB[]={
0xc0,0x07,
0xff,0xe7,
0xff,0xe7,
0xcf,0xe7,
0x67,0xe7,
0x67,0xff,
0x73,0xff,
0x33,0xff,
0x39,0xff,
0x1c,0xff,
0x0e,0x3f,
0x07,0x0f,
0x03,0xc0,
0x01,0xf0,
0x00,0x7f,
0x00,0x0f
};
unsigned char code CHAR4CGRAMTAB[]={
0xe0,0x03,
0xe7,0xf3,
0xe7,0xf3,
0xe7,0xf3,
0xe7,0xe6,
0xff,0xe6,
0xff,0xce,
0xff,0xcc,
0xff,0x9c,
0xff,0x38,
0xfc,0x70,
0xf0,0xe0,
0x03,0xc0,
0x0f,0x80,
0xfe,0x00,
0xf0,0x00
};
unsigned char codeImg_SUNMAN_128x64[]={};
void main(void )
{
while(1)
{
        lcdreset();
        charlcdfill('');
        puststrxy(2,0,"SMG12864ZK");
        exdelay();
        exdelay();
        putstrxy(0,1,"中文字符圖形點(diǎn)陣");
        exdelay();
        exdelay();
        putstrxy(2,2,"液晶顯示模塊");
        exdelay();
        exdelay();
        putstrxy(0,3,"長(zhǎng)沙太陽(yáng)人SUNMAN");
        exdelay();
        exdelay();
        setcharcgram(0,CHAR1CGRAMTAB);
        setcharcgram(1,CHAR2CGRAMTAB);
        setcharcgram(2,CHAR3CGRAMTAB);
        setcharcgram(3,CHAR4CGRAMTAB);
        CXPOS=4,CYPOS=0;
        putchar(USERCHAR1CODE);
        exdelay();
        putchar(USERCHAR2CODE);
        exdelay();
        CXPOS=4,CYPOS=1;
        putchar(USERCHAR3CODE);
            exdelay();
        putchar(USERCHAR4CODE);
        exdelay();
        exdelay();
        charlcdfill('');
        lcdgraphon();
        GXPOS=0,GYPOS=0;
        putimage(Img__SUNMAN_128x64);
        exdelay();
        exdelay();
        glcdfill(0);
        lcdgraphoff();
}
}
void exdelay(void)
{
unsigned char i,j,k;
_nop_();
_nop_();
i=22;
j=3;
k=227;
do{
do{while(--k);
}
while(--j);
}
while(--i);
}
void putchar(unsigned int c)
{
unsigned char d;
if(c>128)
{
if((CXPOS&0x1)==1)
{
lcdwd('');
charcursornext();
}
charlcdpos();
if((c&0xff00)==0xff00)
{
c=0xff00-c;
}
lcdwd(c/256);
charcursornext();
lcdwd(c&0xff);
charcursornext();
}
else
{
charlcdpos();
if((CXPOS&0x1)==1)
{
d=lcdrd();
charlcdpos();
lcdwd(d);
lcdwd(c);
}
else
{
lcdwd(c);
lcdwd('');
}
charcursornext();
} }

void putstr(unsigned char code *s)
{
        unsigned int c;
        while(1);
        {
                c=*s;
                s++;
                if(c==0)brek;
                if(c<128)
                {
                 putchar(c);
                }
                else
                {
                putchar(c*256+*s);
                s++;
                }
        }
}
void putstrxy(unsigned char cx,unsigned char cy,unsigned char code *s)
{
  CXPOS=cx;
  CYPOS=cy;
  putstr(s);
}
void setcharcgram(unsigned char cindex,unsigned char code *s)
{
        unsigned char i;
        lcdwc(0x34);
        lcdwc(0x02);
        lcdwc(0x30);
        lcdwc((cindex&0x3<<4)|0x40);
        for(i=0;i<32;i++,s++)
{
lcdwd(*s);
}
}
void putsizeimage(unsigned char XSIZE,unsigned char YSIZE,unsigned char code *s)
{
unsigned char lx,ly,x;
x=GXPOS;
for(ly=0;ly<YSIZE;ly++,GYPOS++)
{
for(GXPOS=x,lx=0;lx<XSIZE;)
{
if((GXPOS&0x08)==0)
        {
        glcpos();
        }
lcdwd(*s);
s++;
lx+=8;
GXPOS+=8;
}
}
GXPOS=x;
}
void putimage(unsigned char code *s)
{unsigned char XSIZE,YSIZE;
XSIZE=*s;
s++;
YSIZE=*s;
s++;
putsizeimage(XSIZE,YSIZE,s);
}
void charlcdpos(void)
{
unsigned char ddaddr;
CXPOS&=0xf;
ddaddr=CXPOS/2;
if(CYPOS==0)
lcdwc(ddaddr|0x80);
else if(CYPOS==1)
lcdwc(ddaddr|0x90);
else if(CYPOS==2)
lcdwc(ddaddr|0x88);
else
lcdwc(ddaddr|0x98);
}
void charcursornext(void)
{
CXPOS++;
CXPOS&0x0f;
if(CXPOS==0)
{
CYPOS++;
CYPOS&=0x3;
}
}
void lcdreset(void)
{
lcdwc(0x33);
delay3ms();
lcdwc(0x30);
delay3ms();
lcdwc(0x30);
delay3ms();
lcdwc(0x01);
delay3ms();
lcdon();       
}
void delay3ms(void)
{
unsigned char i,j;
i=54;
j=199;
do{
while(--j);
}
while(--i);
}
void glcdpos(void)
{
lcdwc(0x36);
lcdwc((GYPOS&0X1f)|0x80);
if(GYPOS>=32)
        lcdwc((GYPOS/16+8)|0x80);
else
        lcdwc((GYPOS/16)|0x80);
        lcdwc(0x30);
}
void lcdon(void)
{
        lcdwc(0x30);
        lcdwc(0x0c);
}
void lcdoff(void)
{
        lcdwc(0x30);
        lcdwc(0x08);
}
void lcdgraphon(void)
{
        lcdwc(0x36);
        lcdwc(0x30);
}
void lcdgraphoff(void)
{
        lcdwc(0x34);
        lcdwc(0x30);
}
unsigned char lcdrd(void)
{       
        unsigned char d;
        lcdwaitidle();
        RSPIN=1;
        RWPIN=1;
        EPIN=1;
        _nop_();
        d=P1;
        EPIN=0;
        return d;
}
void lcdwd(unsigned char d)
{
        lcdwaitidle();
        P1=d;
        RSPIN=1;
        RWPIN=0;
        EPIN=1;
        _nop_();
        EPIN=0;
}
void lcdwc(unsigned char c)
{
        lcdwaitidle();
        P1=c;
        RSPIN=0;
        RWPIN=0;
        EPIN=1;
        _nop_();
        EPIN=0;
}
void lcdwaitidle(void)
{
        unsigned char i;
        P1=0xff;
        RSPIN=0;
        RWPIN=1;
        EPIN=1;
        for(i=0;i<20;i++)
          if((P1&0X80)!=0x80)break;
        EPIN=0;
}
能不能看一下為什么這個(gè)編譯錯(cuò)誤么
回復(fù)

使用道具 舉報(bào)

地板
ID:723894 發(fā)表于 2020-4-20 20:27 | 只看該作者
太感謝了,真的少了個(gè) ;一堆報(bào)錯(cuò),看來(lái)半天
回復(fù)

使用道具 舉報(bào)

5#
ID:761007 發(fā)表于 2020-5-27 21:00 | 只看該作者
感謝樓主,幫大忙了!
回復(fù)

使用道具 舉報(bào)

6#
ID:802056 發(fā)表于 2020-7-21 21:57 | 只看該作者
真應(yīng)該給您打個(gè)賞
回復(fù)

使用道具 舉報(bào)

7#
ID:474978 發(fā)表于 2021-6-16 18:53 | 只看該作者
樓主牛
回復(fù)

使用道具 舉報(bào)

8#
ID:750420 發(fā)表于 2022-8-15 11:31 | 只看該作者
幫大忙了謝謝
回復(fù)

使用道具 舉報(bào)

9#
ID:1010435 發(fā)表于 2023-7-28 10:26 | 只看該作者
keil好像是從上往下一條一條編譯的,包括#include 如果報(bào)錯(cuò)一大堆,從第一個(gè)錯(cuò)誤開始解決,一般第一個(gè)解決了,有可能都解決了。
回復(fù)

使用道具 舉報(bào)

10#
ID:1112144 發(fā)表于 2024-3-4 18:32 | 只看該作者
幫了我大忙,太感謝了老哥
回復(fù)

使用道具 舉報(bào)

11#
ID:997051 發(fā)表于 2024-3-11 05:59 | 只看該作者
mtt661 發(fā)表于 2023-7-28 10:26
keil好像是從上往下一條一條編譯的,包括#include 如果報(bào)錯(cuò)一大堆,從第一個(gè)錯(cuò)誤開始解決,一般第一個(gè)解決 ...

精辟。的確如此
回復(fù)

使用道具 舉報(bào)

12#
ID:1114318 發(fā)表于 2024-4-17 21:45 | 只看該作者
真的感謝你
回復(fù)

使用道具 舉報(bào)

13#
ID:253767 發(fā)表于 2024-4-18 06:31 | 只看該作者
錯(cuò)誤C132::不在形式參數(shù)列表中
回復(fù)

使用道具 舉報(bào)

14#
ID:1142165 發(fā)表于 2025-1-1 13:43 | 只看該作者
tieq1952 發(fā)表于 2024-4-18 06:31
錯(cuò)誤C132::不在形式參數(shù)列表中

兄弟,最后你是怎么解決的,教教我唄
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表