// Write the statistics out to the provided file void CSVAggregator::write_out(CSVTable t, Config &config) { std::ofstream file; prepare_stream(t, config, true); file.open(config.outfile); file << output; file.close(); }
void dma_start_rx(const struct dma_option *option, unsigned count, void *memory) { stm32_dma_stream_t *stream = dma_get_channel(option->channel); prepare_stream(option->channel, count, option->periph, memory, STM32_DMA_CCR_MINC | STM32_DMA_CCR_DIR_P2M | option->flags); dma_go(stream); }
void print(std::ostream& os, const grid<Iter1, Iter2>& grid, const Values&... values) { ads::util::stream_state_saver guard(os); prepare_stream(os); const auto& xs = get_range<0>(grid); const auto& ys = get_range<1>(grid); for (std::size_t i = 0; i < xs.size(); ++ i) { for (std::size_t j = 0; j < ys.size(); ++ j) { print_row(os, xs[i], ys[j], values(i, j)...); } } }
void dma_prepare_tx(const struct dma_option *option, unsigned count, const void *memory) { /* * Cast away const for memory pointer; this is ok because we know * we're preparing the stream for transmit. */ prepare_stream(option->channel, count, option->periph, (void *)memory, STM32_DMA_CCR_MINC | STM32_DMA_CCR_DIR_M2P | option->flags); }
// Written after the streamer - this method uses the stream to output the contents void CSVAggregator::print(CSVTable t, Config &config, bool with_header) { prepare_stream(t, config, with_header); std::cout << output; }