我有一个API,可实现对EEPROM的写操作。 这是它的声明:
CYBLE_API_RESULT_T CyBle_StoreAppData (uint8 * srcBuff, const uint8 destAddr[], uint32 buffLen, uint8 isForceWrite);
当我调用此函数并将数组参数发送到已声明为uint8类型的srcBuff时,它工作得很好。
问题是,我需要向它发送char数组指针。 我以为char已经是uint8,但是如果我向该函数而不是uint8发送char数组指针,则会收到编译器警告。 为什么不能使用char代替uint8? 这是调用该函数的2个示例:
static const uint8 datastack_ROM[dedicatedRomSize] = {0};
uint8 Container_ID[10];
char Prefix[10];
//Call the function with Container_ID which has been declared as uint8. This is working.
CyBle_StoreAppData(Container_ID,datastack_ROM,10,0);
//Call the function with Prefix which has been declared as char. This is NOT working.
CyBle_StoreAppData(Prefix,datastack_ROM,10,0);
这是第二个呼叫的警告:
passing char[10] to parameter of type 'uint8 *' co