Changeset 10910 for firmware/FSC/src/w5100_spi_interface.c
- Timestamp:
- 06/05/11 17:40:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FSC/src/w5100_spi_interface.c
r10698 r10910 8 8 volatile U08 eth_write_buffer[ETH_WRITE_BUFFER_SIZE]; 9 9 10 U08 eth_write_index; 10 11 //----------------------------------------------------------------------------- 11 12 // INTERFACE CONTROL VARS … … 305 306 { 306 307 return 0; 307 } 308 usart_write_str((U08*)"sending via eth: with pointer:"); 309 usart_write_U16_hex(string); 310 usart_write_str((U08*)" #of bytes: "); 311 usart_write_U16(NumBytes,4 ); 312 usart_write_char(' \n'); 313 308 } 314 309 U16 last_TX_write_pointer = get_S0_TX_WR(); 315 310 U16 offset = last_TX_write_pointer & S0_TX_MASK; … … 340 335 upper_size = (S0_RX_MASK + 1) - offset; 341 336 lower_size = NumBytes - upper_size; 342 for (U 08i = 0; i < upper_size; ++i)337 for (U16 i = 0; i < upper_size; ++i) 343 338 { 344 339 w5100_write(start_address + i, string[i]); 345 340 } 346 for (U 08i = 0; i < lower_size; ++i)341 for (U16 i = 0; i < lower_size; ++i) 347 342 { 348 343 w5100_write(S0_RX_BASE + i, string[upper_size+i]); … … 351 346 else // if not data turn over in RX-mem 352 347 { 353 for (U 08i = 0; i < NumBytes; ++i)348 for (U16 i = 0; i < NumBytes; ++i) 354 349 { 355 350 w5100_write(start_address + i, string[i]); … … 366 361 } 367 362 363 void eth_write_str( U08* str ){ 364 365 while (*str) { 366 if (eth_write_index < ETH_WRITE_BUFFER_SIZE) { 367 eth_write_buffer[eth_write_index++] = *str++; 368 } 369 370 } 371 w5100_set_TX(eth_write_buffer, eth_write_index); 372 eth_write_index = 0; 373 } 374 375 void eth_writeln_str( U08* str ){ 376 377 while (*str) 378 { 379 if (eth_write_index < ETH_WRITE_BUFFER_SIZE) { 380 eth_write_buffer[eth_write_index++] = *str++; 381 } 382 } 383 if (eth_write_index < ETH_WRITE_BUFFER_SIZE) { 384 eth_write_buffer[eth_write_index++] = '\n'; 385 } 386 w5100_set_TX(eth_write_buffer, eth_write_index); 387 eth_write_index = 0; 388 } 389
Note:
See TracChangeset
for help on using the changeset viewer.