• AVR Freaks

Hot!Compiler error - undefined reference to `DRV_I2C_TransferEventHandlerSet'

Author
DHJ
Starting Member
  • Total Posts : 28
  • Reward points : 0
  • Status: offline
2020/07/06 04:48:26 (permalink)
0

Compiler error - undefined reference to `DRV_I2C_TransferEventHandlerSet'

Hi
 
I get the following error :-
 
undefined reference to `DRV_I2C_TransferEventHandlerSet'
 
whilst trying to compile my code as shown :-
 
app_systemData.i2cHandle = DRV_I2C_Open( DRV_I2C_INDEX_1, DRV_IO_INTENT_READWRITE );
           
            if (app_systemData.i2cHandle != DRV_HANDLE_INVALID)
            {
                /* Register the I2C Driver client event callback */
                 DRV_I2C_TransferEventHandlerSet(app_systemData.i2cHandle, APP_I2C_IoExpander_EventHandler, 0);
 
The odd thing is that it manages to find the DRV_I2C_Open function but errors on the DRV_I2C_TransferEventHandlerSet function.
 
I have included the file #include "driver/i2c/drv_i2c.h" and I can see the function there!
 
Anyone else experienced this issue?
 
 
#1

1 Reply Related Threads

    DHJ
    Starting Member
    • Total Posts : 28
    • Reward points : 0
    • Status: offline
    Re: Compiler error - undefined reference to `DRV_I2C_TransferEventHandlerSet' 2020/07/06 05:58:52 (permalink)
    0
    Found the issue!
     
    Reading the info on the function in the h file it states that "This function is available only in the asynchronous mode."
     
    Switch to asynchronus mode and it compiles!
     
    Pity there was no message in the compiler indicating this!
     
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5