Standardise start/end comment tags (to our internal format) (#20)

This commit is contained in:
Andrew Scheller
2021-01-28 16:05:03 +00:00
committed by Graham Sanderson
parent 58f46b2526
commit 90d785bb5b
9 changed files with 23 additions and 23 deletions

View File

@@ -26,7 +26,7 @@ void __no_inline_not_in_flash_func(check)(bool cond, const char *msg) {
void __no_inline_not_in_flash_func(check_hit_miss_invalidate)() {
io_rw_32 *test_data_ptr = (io_rw_32 *) test_data;
//tag::check_hit_miss_invalidate[]
/// \tag::check_hit_miss_invalidate[]
// Flush cache to make sure we miss the first time we access test_data
xip_ctrl_hw->flush = 1;
while (!(xip_ctrl_hw->stat & XIP_STAT_FLUSH_READY_BITS))
@@ -53,7 +53,7 @@ void __no_inline_not_in_flash_func(check_hit_miss_invalidate)() {
(void) *test_data_ptr;
check(xip_ctrl_hw->ctr_hit == 2 && xip_ctrl_hw->ctr_acc == 4,
"Second access after invalidation should hit again");
//end::check_hit_miss_invalidate[]
/// \end::check_hit_miss_invalidate[]
}
// Some code which achieves a very high cache hit rate:

View File

@@ -41,12 +41,12 @@ int main() {
// writing 0 to stream_ctr.
// It's a good idea to drain the FIFO first!
printf("Starting stream from %p\n", random_test_data);
//tag::start_stream[]
/// \tag::start_stream[]
while (!(xip_ctrl_hw->stat & XIP_STAT_FIFO_EMPTY))
(void) xip_ctrl_hw->stream_fifo;
xip_ctrl_hw->stream_addr = (uint32_t) &random_test_data[0];
xip_ctrl_hw->stream_ctr = count_of(random_test_data);
//end::start_stream[]
/// \end::start_stream[]
// Start DMA transfer from XIP stream FIFO to our buffer in memory. Use
// the auxiliary bus slave for the DMA<-FIFO accesses, to avoid stalling
@@ -54,7 +54,7 @@ int main() {
// example, but it can have a huge effect on DMA throughput.
printf("Starting DMA\n");
//tag::start_dma[]
/// \tag::start_dma[]
const uint dma_chan = 0;
dma_channel_config cfg = dma_channel_get_default_config(dma_chan);
channel_config_set_read_increment(&cfg, false);
@@ -68,7 +68,7 @@ int main() {
count_of(random_test_data), // Transfer count
true // Start immediately!
);
//end::start_dma[]
/// \end::start_dma[]
dma_channel_wait_for_finish_blocking(dma_chan);
@@ -85,4 +85,4 @@ int main() {
}
if (!mismatch)
printf("Data check OK\n");
}
}