-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Uart receiving data via dma and selecting speed and UART for logging output #3078
Conversation
PVS-Studio report for commit |
…o/flipperzero-firmware-community into skorp/furi_hal_usart_console
Compiled f7 firmware for commit |
furi_thread_flags_set(furi_thread_get_id(usb_uart->thread), WorkerEvtRxDone); | ||
} | ||
UNUSED(ev); | ||
uint8_t data[data_len]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't allocate data on stack with variable passed from outside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
UNUSED(ev); | ||
uint8_t data[data_len]; | ||
furi_hal_uart_dma_rx(id_uart, data, data_len); | ||
furi_stream_buffer_send(usb_uart->rx_stream, data, data_len, 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no timeouts in interrupts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
} else if(LL_USART_IsActiveFlag_ORE(USART1)) { | ||
LL_USART_ClearFlag_ORE(USART1); | ||
size_t furi_hal_uart_dma_rx(FuriHalUartId ch, uint8_t* data, size_t len) { | ||
furi_assert(uart[ch] != NULL && uart[ch]->buffer_rx_ptr != NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FURI_IS_IRQ_MODE check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
} | ||
irq_cb[ch] = cb; | ||
irq_ctx[ch] = ctx; | ||
size_t furi_hal_uart_dma_bytes_available(FuriHalUartId ch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
…ne, replace magic number with define
What's new
Verification
Checklist (For Reviewer)