Skip to content

fixup examples to use some SDK1.2.0 added functions #172

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

Merged
merged 1 commit into from
Oct 25, 2021
Merged
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
2 changes: 1 addition & 1 deletion dma/control_blocks/control_blocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int main() {

c = dma_channel_get_default_config(data_chan);
channel_config_set_transfer_data_size(&c, DMA_SIZE_8);
channel_config_set_dreq(&c, DREQ_UART0_TX + 2 * uart_get_index(uart_default));
channel_config_set_dreq(&c, uart_get_dreq(uart_default, true));
// Trigger ctrl_chan when data_chan completes
channel_config_set_chain_to(&c, ctrl_chan);
// Raise the IRQ flag when 0 is written to a trigger register (end of chain):
Expand Down
4 changes: 2 additions & 2 deletions spi/spi_dma/spi_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int main() {
printf("Configure TX DMA\n");
dma_channel_config c = dma_channel_get_default_config(dma_tx);
channel_config_set_transfer_data_size(&c, DMA_SIZE_8);
channel_config_set_dreq(&c, spi_get_index(spi_default) ? DREQ_SPI1_TX : DREQ_SPI0_TX);
channel_config_set_dreq(&c, spi_get_dreq(spi_default, true));
dma_channel_configure(dma_tx, &c,
&spi_get_hw(spi_default)->dr, // write address
txbuf, // read address
Expand All @@ -70,7 +70,7 @@ int main() {
// address to increment (so data is written throughout the buffer)
c = dma_channel_get_default_config(dma_rx);
channel_config_set_transfer_data_size(&c, DMA_SIZE_8);
channel_config_set_dreq(&c, spi_get_index(spi_default) ? DREQ_SPI1_RX : DREQ_SPI0_RX);
channel_config_set_dreq(&c, spi_get_dreq(spi_default, false));
channel_config_set_read_increment(&c, false);
channel_config_set_write_increment(&c, true);
dma_channel_configure(dma_rx, &c,
Expand Down