Changeset 10911 for firmware/FSC
- Timestamp:
- 06/05/11 18:37:23 (13 years ago)
- Location:
- firmware/FSC/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FSC/src/FSC_eth_with_user_interface.c
r10910 r10911 43 43 U08 highbyte; 44 44 U08 lowbyte; 45 46 U16 eth_red_bytes; 45 47 46 48 app_init(); // Setup: Watchdog and I/Os … … 71 73 } 72 74 73 static U08 welcome[]="FSC 0.2 \n build: 05.06.2010 - 12:57\n";75 static U08 welcome[]="FSC 0.2 \n build: 05.06.2010\n"; 74 76 usart_write_str(welcome); 75 77 /* … … 97 99 if ( (milisec % W5100_INPUT_CHECK_TIME == 0) && (w5100_ready) ) 98 100 { 99 if (get_S0_RX_RSR() != 0) { // we have something to read 100 101 eth_red_bytes = get_S0_RX_RSR(); 102 if (eth_red_bytes != 0) { // we have something to read 103 usart_write_str((pU08)"ethgot:"); 104 usart_write_U16(eth_red_bytes, 7); 105 usart_write_crlf(); 101 106 parse_w5300_incoming( w5100_get_RX(ETH_READ_BUFFER_SIZE, true) ); 102 107 } -
firmware/FSC/src/parser.c
r10910 r10911 315 315 void parse_w5300_incoming( U08 bytes_in_w5100_rx_buffer ) { 316 316 317 usart_writeln_str((pU08)"parsget:"); 318 for (U08 i =0; i< ETH_READ_BUFFER_SIZE ; i++) { 319 usart_write_U08_hex(eth_read_buffer[i]); 320 usart_write_char((U08)eth_read_buffer[i]); 321 322 } 323 usart_write_crlf(); 324 317 325 if (bytes_in_w5100_rx_buffer == 0) // it was stupid to call this parser without having any bytes downloaded 318 326 return; … … 329 337 330 338 case 't': // measure *t*emperature (resistance) channels only 339 ad7719_values_printed = false; 331 340 reset_resistance_done(); 332 341 simple_acknowledge(); … … 334 343 335 344 case 'v': // measure *v*oltage channels only 345 adc_values_printed = false; 336 346 reset_voltage_done(); 337 347 simple_acknowledge(); … … 349 359 break; 350 360 361 case 'k': 362 eth_write_stuff(); 363 break; 364 351 365 case 'z': // re*z*et ATmega32 and peripherals 352 366 eth_write_buffer[0]='!'; … … 475 489 476 490 } 491 492 void eth_write_stuff(void) { 493 S08 buf []="Test Ah Alarm!!\n"; 494 for (U08 i =0 ; i<7 ; i++) { 495 eth_write_str(buf); 496 } 497 } -
firmware/FSC/src/w5100_spi_interface.c
r10910 r10911 217 217 U08 high_byte = (value>>8); 218 218 U08 low_byte = value&0x00FF; 219 w5100_write(S0_TX_WR1, low_byte); 219 220 w5100_write(S0_TX_WR0, high_byte); 220 w5100_write(S0_TX_WR1, low_byte); 221 221 222 } 222 223 … … 279 280 w5100_write ( S0_CR, CR_RECV ); 280 281 282 /* 281 283 usart_write_U16_hex(get_S0_TX_FSR()); usart_write_char('\t'); usart_write_char('|'); 282 284 usart_write_U16_hex(get_S0_TX_RD()); usart_write_char('\t'); usart_write_char('|'); … … 284 286 usart_write_U16_hex(get_S0_RX_RSR()); usart_write_char('\t'); usart_write_char('|'); 285 287 usart_write_U16_hex(get_S0_RX_RD()); usart_write_char('\t'); usart_write_char('|'); 286 288 */ 289 287 290 // if user wishes, W5100 may inform peer about receiption. 288 291 // this should be done quickly, otherwise timeout may occur on … … 306 309 { 307 310 return 0; 308 } 311 } 312 309 313 U16 last_TX_write_pointer = get_S0_TX_WR(); 310 314 U16 offset = last_TX_write_pointer & S0_TX_MASK; 311 315 U16 start_address = S0_TX_BASE + offset; 312 316 317 usart_write_crlf(); 318 usart_write_crlf(); 319 usart_write_str((pU08)"lwp :"); 320 usart_write_U16_hex(last_TX_write_pointer); 321 usart_write_crlf(); 322 323 usart_write_str((pU08)"off :"); 324 usart_write_U16_hex(offset); 325 usart_write_crlf(); 326 327 usart_write_str((pU08)"stad:"); 328 usart_write_U16_hex(start_address); 329 usart_write_crlf(); 330 313 331 314 332 U16 upper_size, lower_size; … … 338 356 { 339 357 w5100_write(start_address + i, string[i]); 358 usart_write_str((pU08)"wr:"); 359 usart_write_U16_hex(start_address + i); 360 usart_write_char(' '); 361 usart_write_char(string[i]); 362 usart_write_crlf(); 363 340 364 } 341 365 for (U16 i = 0; i < lower_size; ++i) 342 366 { 343 367 w5100_write(S0_RX_BASE + i, string[upper_size+i]); 368 usart_write_str((pU08)"wr:"); 369 usart_write_U16_hex(S0_RX_BASE + i); 370 usart_write_char(' '); 371 usart_write_char(string[upper_size+i]); 372 usart_write_crlf(); 373 344 374 } 345 375 } … … 349 379 { 350 380 w5100_write(start_address + i, string[i]); 351 } 352 } 353 354 // inform W5100 about how much data was read out. 381 usart_write_str((pU08)"wr:"); 382 usart_write_U16_hex(start_address + i); 383 usart_write_char(' '); 384 usart_write_char(string[i]); 385 usart_write_crlf(); 386 387 } 388 } 389 390 // inform W5100 about how much data was written. 355 391 set_S0_TX_WR(last_TX_write_pointer + NumBytes); 356 392 usart_write_str((pU08)"wrpt:"); 393 usart_write_U16_hex(last_TX_write_pointer + NumBytes); 394 usart_write_crlf(); 395 357 396 // tell it to send now the data away 358 397 w5100_write( S0_CR, CR_SEND);
Note:
See TracChangeset
for help on using the changeset viewer.