/* * This file is meant to be the start of a version of your code that runs on a * standard Linux host. The goal is to make your debug easier by allowing you * access to the full Linux-based IDE. * We also provide a version of read_analog() that just reads numbers from a * file. The idea is that this not only works on a Linux host (which doesn't\ * have an ADC), but is also 100% repeatable. */ #include #include #include #include #include "stdint.h" // My own function for printing -- feel free to remove it. using namespace std; #define LOG(args) cout << args << endl // A replacement for analog_read(); pass it the name of the file to get // data from. static int analog_read(string filename) { static ifstream in_file; static bool first_time = 1; if (first_time) { first_time = 0; in_file.open (filename); if (!in_file.is_open()) DIE ("Cannot open "<> val)) return (-1); return (val); } int main () { task_read_adc_filter_write_dac(); }