This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem of compiling viclowlevel.c and viclowlevel.h

hi all, I have difficulty of compiling viclowlevel.c and viclowlevel.h . when I compile that it shows the error below,

..\sdfat1\SingleFAT\viclowlevel.c(5): error: #77-D: this declaration has no storage class or type specifier
..\sdfat1\SingleFAT\viclowlevel.c(5): error: #65: expected a ";"

the .c and .h file are as shown below:

#define IRQ_MASK 0x00000080

#include "viclowlevel.h"

inline unsigned asm_get_cpsr(void)
{ unsigned long retval; asm volatile (" mrs %0, cpsr" : "=r" (retval) : /* no inputs */ ); return retval;
}

inline void asm_set_cpsr(unsigned val)
{ asm volatile (" msr cpsr, %0" : /* no outputs */ : "r" (val) );
}

unsigned enableIRQ(void)
{ unsigned _cpsr;

_cpsr = asm_get_cpsr(); asm_set_cpsr(_cpsr & ~IRQ_MASK); return _cpsr;
}

unsigned disableIRQ(void)
{ unsigned _cpsr;

_cpsr = asm_get_cpsr(); asm_set_cpsr(_cpsr | IRQ_MASK); return _cpsr;
}

unsigned restoreIRQ(unsigned oldCPSR)
{ unsigned _cpsr;

_cpsr = asm_get_cpsr(); asm_set_cpsr((_cpsr & ~IRQ_MASK) | (oldCPSR & IRQ_MASK)); return _cpsr;
}

#ifndef _viclowlevel_
#define _viclowlevel_

unsigned enableIRQ(void);
unsigned disableIRQ(void);
unsigned restoreIRQ(unsigned oldCPSR);
inline unsigned asm_get_cpsr(void);
inline void asm_set_cpsr(unsigned val);

#endif //_viclowlevel_

I know there are some problems of getting inline
after I have added "__" in front of the word inline

it still say that :

..\sdfat1\SingleFAT\viclowlevel.c(8): error: #20: identifier "asm" is undefined
..\sdfat1\SingleFAT\viclowlevel.c(8): error: #65: expected a ";"
..\sdfat1\SingleFAT\viclowlevel.c(14): error: #20: identifier "asm" is undefined
..\sdfat1\SingleFAT\viclowlevel.c(14): error: #65: expected a ";"

please help ~~

0