Changeset 10677 for firmware/FSC/src/parser.c
- Timestamp:
- 05/12/11 17:47:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FSC/src/parser.c
r10674 r10677 33 33 case 'G': // GET the Temperature channels, which are enabled 34 34 once_told_you = false; 35 for ( U08 i=0; i< CHANNEL_BITMAP; ++i ) {35 for ( U08 i=0; i<RESISTANCE_CHANNELS/8; ++i ) { 36 36 ad7719_channels_ready[i]=0; 37 37 } … … 40 40 case 'g': // GET the voltage/current/humidity channels, which are enabled 41 41 once_told_you = false; 42 for ( U08 i=0; i<V _BITMAP + I_BITMAP + H_BITMAP; ++i ) {42 for ( U08 i=0; i<VOLTAGE_CHANNELS/8; ++i ) { 43 43 adc_channels_ready[i]=0; 44 44 } … … 84 84 // to be discarded, because something went wrong, and the bytemade no sense... 85 85 // the end of a commmand, and so the 'real parser' may do his work. 86 86 /* 87 87 void incoming_byte_parser() { 88 88 static bool receiving_command = false; … … 105 105 106 106 } 107 107 */ 108 /* 108 109 109 110 // this is the recent MSR parser … … 124 125 usart_write_str(usart_rx_buffer); 125 126 usart_write_char('\n'); 126 //usart_write_str((pU08)"\n received number of bytes:"); 127 //usart_write_U08(usart_rx_buffer_index,3); 128 129 if (usart_rx_buffer_index >0) { 127 128 129 if (usart_received_chars >0) { 130 130 switch (usart_rx_buffer[0]) { 131 131 case 'E': // user wants to enable/disable something … … 135 135 case 'd': 136 136 137 if (usart_r x_buffer_index>=1) { // let's see what.137 if (usart_received_chars>=1) { // let's see what. 138 138 if ( usart_rx_buffer[1] != 'r' && 139 139 usart_rx_buffer[1] != 'v' && … … 141 141 usart_rx_buffer[1] != 'p' ) 142 142 { 143 print_invalid_enable_statement();143 //print_invalid_enable_statement(); 144 144 break; 145 145 } … … 147 147 148 148 input_number = 0; 149 if (usart_r x_buffer_index>2) { // lets check the first digit149 if (usart_received_chars >2) { // lets check the first digit 150 150 if ( usart_rx_buffer[2] >= '0' && usart_rx_buffer[2] <= '9' ) { 151 151 input_number = usart_rx_buffer[2] - '0'; 152 152 } else { 153 print_invalid_enable_statement();153 //print_invalid_enable_statement(); 154 154 break; 155 155 } 156 156 } 157 if (usart_r x_buffer_index>3) { // lets check the 2nd digit157 if (usart_received_chars >3) { // lets check the 2nd digit 158 158 if ( usart_rx_buffer[3] >= '0' && usart_rx_buffer[3] <= '9' ) { 159 159 input_number = 10*input_number + usart_rx_buffer[3] - '0'; … … 164 164 } 165 165 } 166 if (usart_r x_buffer_index>2) {166 if (usart_received_chars>2) { 167 167 usart_write_str((pU08)"\n I will switch "); 168 168 if (enable) … … 226 226 227 227 228 }// end of if usart_r x_buffer_index>2 --> this should not be necessary at all228 }// end of if usart_received_chars>2 --> this should not be necessary at all 229 229 break; 230 230 … … 241 241 case 'G': // GET the Temperature channels, which are enabled 242 242 ad7719_values_printed = false; 243 for ( U08 i=0; i< CHANNEL_BITMAP; ++i ) {243 for ( U08 i=0; i<RESISTANCE_CHANNELS/8; ++i ) { 244 244 ad7719_channels_ready[i]=0; 245 245 } … … 247 247 case 'g': // GET the voltage/current/humidity channels, which are enabled 248 248 adc_values_printed = false; 249 for ( U08 i=0; i<V _BITMAP; ++i ) {249 for ( U08 i=0; i<VOLTAGE_CHANNELS/8; ++i ) { 250 250 adc_channels_ready[i]=0; 251 251 } … … 301 301 for (U08 i=0; i<USART_RX_BUFFER_SIZE; ++i) 302 302 usart_rx_buffer[i] = 0; 303 usart_r x_buffer_index= 0;303 usart_received_chars = 0; 304 304 usart_rx_ready = false; 305 305 } // END of MSR_parser(); 306 306 307 */
Note:
See TracChangeset
for help on using the changeset viewer.