AnsweredAssumed Answered

What is the double week mechanism?

Question asked by jun yamada on Nov 11, 2019
Latest reply on Nov 11, 2019 by jun yamada

Hi.

 

I am using SDK_2.6.0_MKE04Z128xxx4.

Among them, there is a title on I2C-related driver sources.

What kind of mechanism do you point to specifically?   

The place marked with (<--- ???).

 

/*!
* brief Initializes the I2C handle which is used in transactional functions.
*
* param base I2C base pointer.
* param handle pointer to i2c_master_handle_t structure to store the transfer state.
* param callback pointer to user callback function.
* param userData user parameter passed to the callback function.
*/
void I2C_MasterTransferCreateHandle(I2C_Type *base,
i2c_master_handle_t *handle,
i2c_master_transfer_callback_t callback,
void *userData)
{
assert(NULL != handle);

uint32_t instance = I2C_GetInstance(base);

/* Zero handle. */
(void)memset(handle, 0, sizeof(*handle));

/* Set callback and userData. */
handle->completionCallback = callback;
handle->userData = userData;

/* Save the context in global variables to support the double weak mechanism. */ <--- ???
s_i2cHandle[instance] = handle;

/* Save master interrupt handler. */
s_i2cMasterIsr = I2C_MasterTransferHandleIRQ;

/* Enable NVIC interrupt. */
(void)EnableIRQ(s_i2cIrqs[instance]);
}

 

I am always grateful for your help.

 

jun.

Outcomes