Changeset 18182


Ignore:
Timestamp:
05/29/15 00:17:01 (10 years ago)
Author:
dneise
Message:
fixing communication bug and getting rid of compiler warning, and removing unneded repeated reading
File:
1 edited

Legend:

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

    r17631 r18182  
    344344
    345345// returns number of bytes, transmitted into TX - buffer.
    346 U16 w5100_set_TX(U08* string, U16 NumBytes) {
    347 
    348     U08 repetitions;
     346U16 w5100_set_TX(volatile U08* string, U16 NumBytes) {
     347
    349348    U16 freesize;
    350349    U16 last_TX_write_pointer;
    351350
    352351    freesize = get_S0_TX_FSR();
    353     for (repetitions=0 ; repetitions < 3;  ) { // increase is *inside the loop*
    354         if ( freesize != get_S0_TX_FSR()) {
    355             freesize = get_S0_TX_FSR();
    356         }
    357         else {
    358             repetitions++;
    359         }
    360     }
    361352    if (freesize == 0) {
    362353        return 0;
     
    364355   
    365356    last_TX_write_pointer = get_S0_TX_WR();
    366     for (repetitions=0 ; repetitions < 3;  ) { // increase is *inside the loop*
    367         if ( last_TX_write_pointer != get_S0_TX_WR()) {
    368             last_TX_write_pointer = get_S0_TX_WR();
    369         }
    370         else {
    371             repetitions++;
    372         }
    373     }
    374357
    375358    U16 offset = last_TX_write_pointer & S0_TX_MASK;
     
    390373        }
    391374        for (U16 i = 0; i < lower_size; ++i) {
    392             w5100_write(S0_RX_BASE + i, string[upper_size+i]);
     375            w5100_write(S0_TX_BASE + i, string[upper_size+i]);
    393376        }
    394377    }
Note: See TracChangeset for help on using the changeset viewer.