#include "output.h" #include "usart.h" void print_status() { usart_write_str((pU08)"adc status:\n"); for (U08 i=0; i< V_BITMAP + I_BITMAP + H_BITMAP;++i) { usart_write_U08_bin(adc_enables[i]); usart_write_char(' '); } usart_write_char('\n'); for (U08 i=0; i< V_BITMAP + I_BITMAP + H_BITMAP;++i){ usart_write_U08_bin(adc_channels_ready[i]); usart_write_char(' '); } usart_write_char('\n'); usart_write_str((pU08)"ad7719 status:\n"); for (U08 i=0; i< CHANNEL_BITMAP;++i) { usart_write_U08_bin(ad7719_enables[i]); usart_write_char(' '); } usart_write_char('\n'); for (U08 i=0; i< CHANNEL_BITMAP;++i){ usart_write_U08_bin(ad7719_channels_ready[i]); usart_write_char(' '); } usart_write_char('\n'); usart_write_str((pU08)"time:"); usart_write_float((float)local_ms/1000 , 1,7); usart_write_str((pU08)" sec.\n"); usart_write_str((pU08)"adc measured all: "); if (adc_measured_all) usart_write_str((pU08)" true\n"); else usart_write_str((pU08)"false\n"); usart_write_str((pU08)"ad7719 measured all: "); if (ad7719_measured_all) usart_write_str((pU08)" true\n"); else usart_write_str((pU08)"false\n"); usart_write_str((pU08)"adc current channel:"); usart_write_U08(adc_current_channel,2); usart_write_char('\n'); usart_write_str((pU08)"ad7719 current channel:"); usart_write_U08(ad7719_current_channel,2); usart_write_char('\n'); } void print_adc_nicely() { usart_write_str((pU08)"\n printing voltages in mV:\n"); // output: U08 adc_values[V_CHANNELS + I_CHANNELS + H_CHANNELS]; for (U08 i=0; i< V_CHANNELS + I_CHANNELS + H_CHANNELS;++i) { if (i%8 == 0) usart_write_char('\n'); adc_output(i, adc_values[i]); usart_write_str((pU08)" "); } usart_write_char('\n'); } void print_ad7719_nicely() { float value; usart_write_str((pU08)"\n printing measured resistance in kohms:\n"); for (U08 i=0; i< TEMP_CHANNELS;++i) { if (i%8 == 0) usart_write_char('\n'); // print channel name: usart_write_str((pU08)"R:"); //R for resistance usart_write_char('A'+i/8); // Letters A,B,C,D,E,F,G,H //usart_write_char(' '); usart_write_U08(i%8+1,1); // Numbers 1...8 usart_write_char(':'); // check if this channel is enabled in the bitmap if (ad7719_enables[i/8] & (1<