Changeset 11667 for firmware/FSC/src/FSC_eth_with_user_interface.c
- Timestamp:
- 07/27/11 18:57:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FSC/src/FSC_eth_with_user_interface.c
r10911 r11667 46 46 U16 eth_red_bytes; 47 47 48 U08 rc; 49 48 50 app_init(); // Setup: Watchdog and I/Os 49 51 usart_init(); … … 62 64 63 65 for ( U08 i=0; i < (RESISTANCE_CHANNELS/8); ++i ) { 64 ad7719_enables[i]=0x 00;66 ad7719_enables[i]=0xFF; 65 67 ad7719_channels_ready[i]=0; 66 68 } … … 90 92 91 93 // checks if socket is okay and resets in case of problem the W5100 92 if (w5100_caretaker()) 94 rc=w5100_caretaker(); 95 if ( rc != 0x17 && rc != 0x14) 93 96 { 97 usart_write_str((pU08)"caretaker! error code:"); 98 usart_write_U08_hex(rc); 99 usart_write_crlf(); 94 100 // something is not okay with the ethernet ... 95 101 // will be reset in the next revolution.. but maybe we want to do more... … … 99 105 if ( (milisec % W5100_INPUT_CHECK_TIME == 0) && (w5100_ready) ) 100 106 { 101 eth_red_bytes = get_S0_RX_RSR(); 102 if (eth_red_bytes != 0) { // we have something to read 107 if ( (eth_red_bytes = get_S0_RX_RSR()) != 0) { 108 for (U08 rep=0; rep<1; ) { 109 if (eth_red_bytes == get_S0_RX_RSR() ) 110 rep++; 111 else 112 eth_red_bytes =get_S0_RX_RSR(); 113 } 103 114 usart_write_str((pU08)"ethgot:"); 104 115 usart_write_U16(eth_red_bytes, 7); … … 106 117 parse_w5300_incoming( w5100_get_RX(ETH_READ_BUFFER_SIZE, true) ); 107 118 } 119 108 120 } 109 121 … … 116 128 usart_write_U32(sec ,8); 117 129 print_adc_nicely(false,true); 130 write_status_via_eth(); 118 131 //print_adc_stupid(); 119 132 reset_voltage_done(); 120 133 reset_voltage_values(); 121 telegram_start();122 w5100_set_TX((U08*) adc_values, ADC_VALUES_LEN_BYTE);134 //telegram_start(); 135 //w5100_set_TX((U08*) adc_values, ADC_VALUES_LEN_BYTE); 123 136 124 137 reset_voltage_done(); … … 127 140 adc_values_printed = true; 128 141 print_adc_nicely(true,true); 142 write_status_via_eth(); 129 143 //print_adc_stupid(); 130 144 //reset_voltage_done(); 131 telegram_start();132 w5100_set_TX((U08*) adc_values, ADC_VALUES_LEN_BYTE);145 //telegram_start(); 146 //w5100_set_TX((U08*) adc_values, ADC_VALUES_LEN_BYTE); 133 147 134 148 } … … 138 152 139 153 if(ad7719_print_endless){ 140 usart_write_str((pU08)"R|");141 usart_write_U32(sec ,8);142 print_ad7719_nicely(false,true);154 155 print_ad7719_nicely(); 156 write_status_via_eth(); 143 157 reset_resistance_done(); 144 telegram_start(); 145 w5100_set_TX((U08*) ad7719_values, AD7719_VALUES_LEN_BYTE); 158 reset_voltage_done(); 159 160 //telegram_start(); 161 //w5100_set_TX((U08*) ad7719_values, AD7719_VALUES_LEN_BYTE); 146 162 147 163 } else … … 149 165 ad7719_values_printed = true; 150 166 print_ad7719_nicely(true,true); 167 write_status_via_eth(); 151 168 reset_resistance_done(); 152 telegram_start();153 w5100_set_TX((U08*) ad7719_values, AD7719_VALUES_LEN_BYTE);169 //telegram_start(); 170 //w5100_set_TX((U08*) ad7719_values, AD7719_VALUES_LEN_BYTE); 154 171 155 172 }
Note:
See TracChangeset
for help on using the changeset viewer.