Hi,
You cannot just use
MMCSD_err in defining function return type, because
MMCSD_err is just a tag for
enum, and not a
typedef name. So, compiler cannot resolve type by just looking at a tag, and you must either use following declaration:
Code: Select all
enum MMCSD_err mmcsd_init(){
return MMCSD_ERASE_SEQ_ERR;
}
or you may define enum with typedef. Here's the working corrected code for what you were trying to achieve:
Code: Select all
enum MMCSD_err{
MMCSD_GOODEC = 0,
MMCSD_IDLE = 0x01,
MMCSD_ERASE_RESET = 0x02,
MMCSD_ILLEGAL_CMD = 0x04,
MMCSD_CRC_ERR = 0x08,
MMCSD_ERASE_SEQ_ERR = 0x10,
MMCSD_ADDR_ERR = 0x20,
MMCSD_PARAM_ERR = 0x40,
RESP_TIMEOUT = 0x80
};
enum MMCSD_err mmcsd_init(){
return MMCSD_ERASE_SEQ_ERR;
}
void main() {
PORTB = mmcsd_init();
asm nop;
}
Best regards,
Aleksandar