Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug breaking SCI Rx/Tx with DMA/DTC, fix memory corruption in USB peripheral #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/r_sci_rx/r_sci_rx_vx.xx/r_sci_rx/src/r_sci_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ sci_err_t R_SCI_Open (uint8_t const chan,
{
#if (TX_DTC_DMACA_ENABLE & 0x01 || TX_DTC_DMACA_ENABLE & 0x02)
/* DTC/DMAC don't use the queue */
if ((SCI_DTC_ENABLE != g_handles[chan]->rom->dtc_dmaca_tx_enable) && (SCI_DMACA_ENABLE != g_handles[chan]->rom->dtc_dmaca_tx_enable))
if (((SCI_DTC_ENABLE != g_handles[chan]->rom->dtc_dmaca_tx_enable) && (SCI_DMACA_ENABLE != g_handles[chan]->rom->dtc_dmaca_tx_enable))
|| ((SCI_DTC_ENABLE != g_handles[chan]->rom->dtc_dmaca_rx_enable) && (SCI_DMACA_ENABLE != g_handles[chan]->rom->dtc_dmaca_rx_enable)))
{
err = sci_init_queues(chan);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ usb_er_t usb_pstd_transfer_start(usb_utr_t * ptr)

rtos_get_fixed_memory(&g_rtos_usb_mpf_id, (void **)&p_tran_data, RTOS_ZERO);

if (NULL == ptr)
if (NULL == ptr || NULL == p_tran_data)
{
return USB_ERROR;
}
Expand Down