器件型号: AM2432
你(们)好
我注意到在 bsp_send_command_to_firmware() 中使用了 HwiP_disable()、并想询问使用背后的原因。 我们使用中断来运行 RT、而不想禁用中断。
我们可以改用 bsp_global_mutex_lock () 吗?
谢谢您、
Sahar Schwartz
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
器件型号: AM2432
你(们)好
我注意到在 bsp_send_command_to_firmware() 中使用了 HwiP_disable()、并想询问使用背后的原因。 我们使用中断来运行 RT、而不想禁用中断。
我们可以改用 bsp_global_mutex_lock () 吗?
谢谢您、
Sahar Schwartz
你(们)好
是的。 这是可以在 tiescbsp.cpp 中找到的函数:
void bsp_send_command_to_firmware(PRUICSS_Handle pruIcssHandle,
uint32_t command,
uint16_t param1, uint16_t param2)
{
volatile t_host_interface *pHost2PruIntfc = (volatile t_host_interface *)
((((PRUICSS_HwAttrs *)(pruIcssHandle->hwAttrs))->baseAddr) +
PRUICSS_DATARAM(0));
{
#ifdef ENABLE_PDI_TASK
SemaphoreP_pend(&semcmdlow_object, SystemP_WAIT_FOREVER);
#else
uintptr_t key1 = HwiP_disable();
#endif
bsp_pruss_cmd_intfc_write_word(command, &pHost2PruIntfc->cmdlow);
bsp_pruss_cmd_intfc_write_word(param1, &pHost2PruIntfc->param1low);
bsp_pruss_cmd_intfc_write_word(param2, &pHost2PruIntfc->param2low);
#ifdef SUPPORT_CMDACK_POLL_MODE
bsp_pruss_cmd_intfc_write_word(1, &pHost2PruIntfc->cmdlow_ack);
#endif
PRUICSS_sendEvent((g_bsp_params.pruicss_handle), ARM_PRU_EVENT1);
ASSERT_DMB();
ASSERT_DSB();
{
#ifdef SUPPORT_CMDACK_POLL_MODE
volatile uint16_t ack;
do
{
ack = bsp_pruss_cmd_intfc_read_word(&pHost2PruIntfc->cmdlow_ack);
}
while(ack);
#ifndef ENABLE_PDI_TASK
HwiP_restore(key1);
#endif
#else
uint32_t evtoutNum = HOST_CMD_LOW_ACK_EVENT - 20;
#ifndef ENABLE_PDI_TASK
HwiP_restore(key1);
#endif
PRUICSS_waitEvent((PRUICSS_Handle)(g_bsp_params.pruicss_handle), evtoutNum);
#endif
}
bsp_pruss_cmd_intfc_write_word(0xFF, &pHost2PruIntfc->cmdlow);
#ifdef ENABLE_PDI_TASK
SemaphoreP_post(&semcmdlow_object);
#endif
}
}