bd7qw 发表于 2016-1-14 21:32:41

KEIL4.74编译LPC4357用的NAND部分程序,老出告警怎末解决?谢谢

本帖最后由 bd7qw 于 2016-1-14 21:34 编辑

如下有段LPC4357用的程序,KEIL4.74编译后老出现..\User\NANDFLASH.c(431): warning:#188-D: enumerated type mixed with another type的警告,不知道如何解决,谢谢

/*********************************************************************//**
* @brief                 Read the whole NAND FLASH memory page based on the
*                                page number, the data will be stored in the pointer
*                                to the buffer.
* @param        pageNum                number of page that will be read, should
*                                 be in range: 0..63
* @param        blockNum        number of block that will be read, should
*                                 be in range: 0..1023
* @param        bufPtr                pointer to the buffer that contain data will be
*                                 read from flash memory
* @return                 Read status, could be:
*                                         - TRUE: success
*                                         - FALSE: fail
**********************************************************************/
Bool NandFlash_PageRead( uint32_t pageNum, uint32_t blockNum, uint8_t *bufPtr )
{
        return (NandFlash_PageReadFromBeginning(pageNum, blockNum, bufPtr) != 0);
}

/*********************************************************************//
就是return返回值这行老警告,初学ARM,求教
有高手请赐教,谢谢

dboyzju 发表于 2016-1-17 22:12:35

Bool这个类型是你自己定义的吧?用的enum?NandFlash_PageReadFromBeginning这个函数返回值是什么类型的?如果是Bool类型的就直接返回吧,如果不是,后面的NandFlash_PageReadFromBeginning(PageNum,blockNum,bufPtr)!=0这个式子的结果不是你定义的Bool类型,可以判断一下,如果满足某个条件返回TRUE,否则返回FALSE,就是返回你定义的Bool类型的值。
页: [1]
查看完整版本: KEIL4.74编译LPC4357用的NAND部分程序,老出告警怎末解决?谢谢