- Timestamp:
- 07/29/11 10:24:23 (13 years ago)
- Location:
- firmware/FSC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FSC/src/num_conversion.c
r11671 r11696 19 19 { 20 20 U08 len = strlen((const char *)source_ptr); 21 pU08 dest_ptr = nc_format_buffer;21 pU08 dest_ptr = (pU08)&nc_format_buffer; 22 22 23 23 // Fillup loop … … 35 35 *dest_ptr = 0; // Terminate format string 36 36 37 return nc_format_buffer;37 return (pU08)&nc_format_buffer; 38 38 } 39 39 //----------------------------------------------------------------------------- -
firmware/FSC/src/w5100_spi_interface.c
r11681 r11696 424 424 425 425 // now calculate the offset address 426 // calculated according to W5100 datasheet page: 44 427 /* 428 if ((offset + NumBytes) > (S0_TX_MASK + 1) ) // if data is turned over in RX-mem 429 { 430 upper_size = (S0_TX_MASK + 1) - offset; 426 // calculated according to W5100 datasheet page: 44 427 if ((offset + NumBytes) > (S0_RX_MASK + 1) ) // if data is turned over in RX-mem 428 { 429 upper_size = (S0_RX_MASK + 1) - offset; 431 430 lower_size = NumBytes - upper_size; 432 431 for (U16 i = 0; i < upper_size; ++i) … … 442 441 for (U16 i = 0; i < lower_size; ++i) 443 442 { 444 w5100_write(S0_ TX_BASE + i, string[upper_size+i]);443 w5100_write(S0_RX_BASE + i, string[upper_size+i]); 445 444 //usart_write_str((pU08)"wr:"); 446 445 //usart_write_U16_hex(S0_RX_BASE + i); … … 453 452 else // if not data turn over in RX-mem 454 453 { 455 */for (U16 i = 0; i < NumBytes; ++i)456 { 457 w5100_write( S0_TX_BASE + (offset + i)&S0_TX_MASK, string[i]);454 for (U16 i = 0; i < NumBytes; ++i) 455 { 456 w5100_write(start_address + i, string[i]); 458 457 //usart_write_str((pU08)"wr:"); 459 458 //usart_write_U16_hex(start_address + i); … … 463 462 464 463 } 465 //}464 } 466 465 467 466 // inform W5100 about how much data was written. … … 491 490 void eth_write_str( U08* str ){ 492 491 493 while (*str && eth_write_index < ETH_WRITE_BUFFER_SIZE) 494 { 495 eth_write_buffer[eth_write_index++] = *str++; 492 while (*str) { 493 if (eth_write_index < ETH_WRITE_BUFFER_SIZE) { 494 eth_write_buffer[eth_write_index++] = *str++; 495 } 496 496 497 } 497 498 w5100_set_TX(eth_write_buffer, eth_write_index); … … 501 502 void eth_writeln_str( U08* str ){ 502 503 503 while (*str && eth_write_index < ETH_WRITE_BUFFER_SIZE) 504 { 505 eth_write_buffer[eth_write_index++] = *str++; 504 while (*str) 505 { 506 if (eth_write_index < ETH_WRITE_BUFFER_SIZE) { 507 eth_write_buffer[eth_write_index++] = *str++; 508 } 506 509 } 507 510 if (eth_write_index < ETH_WRITE_BUFFER_SIZE) {
Note:
See TracChangeset
for help on using the changeset viewer.