Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

what is this STATIC BYTE be doing here?

Status
Not open for further replies.

sachinkp21587

Member level 2
Joined
Mar 15, 2010
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
india (U.P.)
Activity points
1,703
i am working on keil IDE using realview mdk-arm for a project based on LPC1768

i made a header file as below
Code:
#ifndef _test_h
#define _test_h

#include "diskio.h"
#include "spi.h"
#include "type.h"
#include "LPC17xx.h"

#define rcvr_spi()		xchg_spi(0xFF)

static
BYTE xchg_spi (BYTE dat);

#endif

and a .c file as follows
Code:
#include "test.h"

static volatile
DSTATUS Stat = STA_NOINIT;	/* Disk status */

static volatile
UINT Timer1, Timer2;		/* 1000Hz decrement timer */

static
UINT CardType;

#define xmit_spi(dat) 	xchg_spi(dat)

//#define rcvr_spi_m(p)	SPI2BUF = 0xFF; while (!SPI2STATbits.SPIRBF); *(p) = (BYTE)SPI2BUF;
#define rcvr_spi_m(p)	*(p) = xchg_spi(0XFF);

static
BYTE xchg_spi (BYTE dat)
{
	return (BYTE)SPISend((uint8_t) dat);
}

now i made a main file in which i included this header file.
also by browsing added the c file to projects folder.

now when i make a call to xchg_spi there occurs an error saying

test.h(12): error: #114: function "xchg_spi" was referenced but not defined

the above compiles without any errors when the static is removed.
why so?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top