Ich fummel hier mit einem SAME70 herum und versuche die von Harmony erzeugte Blibliothek für den ADC zu verstehen. Da gibt es einen Prototypen
Code: Alles auswählen
void AFEC0_CallbackRegister(AFEC_CALLBACK callback, uintptr_t context);
Code: Alles auswählen
typedef void (*AFEC_CALLBACK)(uint32_t status, uintptr_t context);
// *****************************************************************************
typedef struct
{
AFEC_CALLBACK callback_fn;
uintptr_t context;
}AFEC_CALLBACK_OBJECT;
Code: Alles auswählen
void APP_AFEC0Callback(unsigned int context )
{
Tcntr++;
}
Code: Alles auswählen
AFEC0_CallbackRegister( APP_AFEC0Callback, (uintptr_t)NULL);
Code: Alles auswählen
../src/main.c:1361:29: error: passing argument 1 of 'AFEC0_CallbackRegister' from incompatible pointer type [-Werror=incompatible-pointer-types]
AFEC0_CallbackRegister( APP_AFEC0Callback, (uintptr_t)NULL);
^~~~~~~~~~~~~~~~~
In file included from ../src/config/default/definitions.h:52,
from ../src/main.c:15:
../src/config/default/peripheral/afec/plib_afec0.h:141:43: note: expected 'AFEC_CALLBACK' {aka 'void (*)(long unsigned int, unsigned int)'} but argument is of type 'void (*)(unsigned int)'
void AFEC0_CallbackRegister(AFEC_CALLBACK callback, uintptr_t context);
~~~~~~~~~~~~~~^~~~~~~~