2023-12-01
03:34 AM
- last edited on
2023-12-13
01:47 AM
by
Lina_DABASINSKA
Bonjour,
Pouvez-vous me dire pourquoi cette façon d'écrire lors d'une transmission I2c par interruption ou DMA ne fonctionne pas :
EN: Hello,
Can you tell me why this way of writing during an I2c transmission by interrupt or DMA does not work?
annuler PAC194X_Transmit(s_PAC194X *pObj)
{
HAL_I2C_Master_Transmit_IT(&pObj->I2C, (pObj->I2C_ADD<<1), pObj->BufferTX, pObj->SizeBufferTX);
}
|
Voici ce que j'ai dû faire pour que cela fonctionne :
EN: Here's what I had to do to make it work:
annuler PAC194X_Transmit(s_PAC194X *pObj)
{
si (pObj->I2C.Instance == hi2c4.Instance)
{
HAL_I2C_Master_Transmit_IT(&hi2c4, (pObj->I2C_ADD<<1), pObj->BufferTX, pObj->SizeBufferTX);
}
}
|
en mode blocage, cela fonctionne avec la première méthode.
Merci
Rom
EN:
in blocking mode, it works with the first method.
Thanks
Rom
2023-12-01 05:12 AM
Bonjour,
Excuzes-moi de douter de vous.
La majeure partie de ce forum est en anglais. Je parle un peu Francais c'est tout.
I wonder if the above was translated from English to French prior to submission. The "tell-tale" is the use of "si" in the source-code, where I might expect "if" in regular "C".
2023-12-01 06:07 AM
The first argument to HAL_I2C_Master_Transmit_IT should be a handle, not an instance.
Unclear what s_PAC194X->I2C is and you haven't provided much info about it.