Changeset 10245 for firmware/FSC
- Timestamp:
- 03/17/11 10:29:43 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FSC/src/FSC.c
r10244 r10245 110 110 ad7719_channels_ready[i]=0; 111 111 } 112 ad7719_enables[0]=0x0 8;112 ad7719_enables[0]=0x01; 113 113 for ( U08 i=0; i<V_BITMAP + I_BITMAP; ++i ) { 114 adc_enables[i]=0x 00;114 adc_enables[i]=0xFF; 115 115 adc_channels_ready[i]=0; 116 116 } 117 adc_enables[V_BITMAP + I_BITMAP + H_BITMAP -1] = 0x0 0;117 adc_enables[V_BITMAP + I_BITMAP + H_BITMAP -1] = 0x0F; 118 118 adc_channels_ready[V_BITMAP + I_BITMAP + H_BITMAP -1]=0; 119 119 … … 125 125 while (1) 126 126 { 127 128 //IF one of the ADC measured all channels, we wanted to know. 129 check_if_measured_all(); 130 131 if (ad7719_measured_all && adc_measured_all && !once_told_you) 132 { 133 adc_output_all(); 134 once_told_you = true; 135 } 136 //---------------------------------------------------------------------------- 137 127 138 if (heartbeat_enable) PORTB ^= (1<<PB3); // toggle Out2_spare --> heartbeat 128 139 //---------------------------------------------------------------------------- … … 230 241 } 231 242 } 232 //---------------------------------------------------------------------------- 233 //IF one of the ADC measured all channels, we wanted to know. 234 check_if_measured_all(); 235 236 if (ad7719_measured_all && adc_measured_all && !once_told_you) 237 { 238 adc_output_all(); 239 once_told_you = true; 240 } 243 241 244 //---------------------------------------------------------------------------- 242 245 /* … … 831 834 break; 832 835 case 'e': // ATmega internal ADC enable bitmaps may be set 833 if ((usart_received_chars>5) && 834 (usart_rx_buffer[3] >= 'A' && usart_rx_buffer[3] <= 'H')) 835 { 836 adc_enables[usart_rx_buffer[3]-'A']=usart_rx_buffer[5]; 837 adc_channels_ready[usart_rx_buffer[3]-'A']=0x00; 838 } 836 usart_write_str((pU08)"\n setting ADC enable registers all"); 837 if (usart_rx_buffer[1] == '0'){ 838 usart_write_str((pU08)"OFF \n"); 839 for ( U08 i=0; i<V_BITMAP + I_BITMAP; ++i ) { 840 adc_enables[i]=0x00; 841 adc_channels_ready[i]=0; 842 } 843 adc_enables[V_BITMAP + I_BITMAP + H_BITMAP -1] = 0x00; 844 adc_channels_ready[V_BITMAP + I_BITMAP + H_BITMAP -1]=0; 845 } else { 846 usart_write_str((pU08)"ON\n"); 847 for ( U08 i=0; i<V_BITMAP + I_BITMAP; ++i ) { 848 adc_enables[i]=0xFF; 849 adc_channels_ready[i]=0; 850 } 851 adc_enables[V_BITMAP + I_BITMAP + H_BITMAP -1] = 0x0F; 852 adc_channels_ready[V_BITMAP + I_BITMAP + H_BITMAP -1]=0; 853 } 854 855 839 856 break; 840 857 case 'h': … … 1013 1030 // output: U08 adc_values[V_CHANNELS + I_CHANNELS + H_CHANNELS]; 1014 1031 for (U08 i=0; i< V_CHANNELS + I_CHANNELS + H_CHANNELS;++i) { 1015 if (i%8 == 0) usart_write_char('\n'); 1032 if (i%8 == 0) usart_write_char('\n'); 1033 1034 if (i==0) 1035 usart_write_str((pU08)"voltages:\n"); 1036 if (i==40) 1037 usart_write_str((pU08)"currents in mV :-) :\n"); 1038 if (i==80) 1039 usart_write_str((pU08)"humiditiesin mV :-) :\n"); 1040 1041 1042 1016 1043 adc_output(i, adc_values[i]); 1017 1044 usart_write_str((pU08)" ");
Note:
See TracChangeset
for help on using the changeset viewer.