Changeset 11696 for firmware


Ignore:
Timestamp:
Jul 29, 2011, 10:24:23 AM (8 years ago)
Author:
neise
Message:
the changes we made with thomas B did not work. I have to find out why...
only crap is send away now.
Location:
firmware/FSC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • firmware/FSC/src/num_conversion.c

    r11671 r11696  
    1919{
    2020  U08 len = strlen((const char *)source_ptr);
    21   pU08 dest_ptr = nc_format_buffer;
     21  pU08 dest_ptr = (pU08)&nc_format_buffer;
    2222
    2323  // Fillup loop
     
    3535  *dest_ptr = 0; // Terminate format string
    3636
    37   return nc_format_buffer;
     37  return (pU08)&nc_format_buffer;
    3838}
    3939//-----------------------------------------------------------------------------
  • firmware/FSC/src/w5100_spi_interface.c

    r11681 r11696  
    424424       
    425425        // 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;
    431430                lower_size = NumBytes - upper_size;
    432431                for (U16 i = 0; i < upper_size; ++i)
     
    442441                for (U16 i = 0; i < lower_size; ++i)
    443442                {
    444                         w5100_write(S0_TX_BASE + i, string[upper_size+i]);
     443                        w5100_write(S0_RX_BASE + i, string[upper_size+i]);
    445444                        //usart_write_str((pU08)"wr:");
    446445                        //usart_write_U16_hex(S0_RX_BASE + i);
     
    453452        else // if not data turn over in RX-mem
    454453        {
    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]);
    458457                        //usart_write_str((pU08)"wr:");
    459458                        //usart_write_U16_hex(start_address + i);
     
    463462
    464463                }
    465         //}
     464        }
    466465
    467466        // inform W5100 about how much data was written.
     
    491490void eth_write_str( U08* str ){
    492491
    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               
    496497        }
    497498        w5100_set_TX(eth_write_buffer, eth_write_index);
     
    501502void eth_writeln_str( U08* str ){
    502503
    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                }
    506509        }
    507510        if (eth_write_index < ETH_WRITE_BUFFER_SIZE) {
Note: See TracChangeset for help on using the changeset viewer.