Changeset 629:b641b3511145

Show
Ignore:
Timestamp:
08/15/08 19:25:11 (3 months ago)
Author:
David Anderson <dave@…>
Branch:
default
Message:

Make nx_rs485_shutdown only work when the driver is idle.

Shutting down the driver while a communication is in progress is now a
programming error.

Location:
nxos
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • nxos/base/drivers/rs485.c

    r628 r629  
    179179} 
    180180 
    181 bool nx_rs485_stop(void) { 
    182   NX_ASSERT(rs485_state.status != RS485_UNINITIALIZED); 
    183   if (rs485_state.status != RS485_IDLE) { 
    184     return FALSE; 
    185   } 
     181void nx_rs485_shutdown(void) { 
     182  NX_ASSERT(rs485_state.status == RS485_IDLE); 
    186183 
    187184  *AT91C_US0_CR = AT91C_US_RSTTX  |      /* Transmitter reset */ 
     
    193190 
    194191  rs485_state.status = RS485_UNINITIALIZED; 
    195   return TRUE; 
    196192} 
    197193 
  • nxos/base/drivers/rs485.h

    r628 r629  
    4848 * @note Once the RS485 interface is shut down, port 4 may be used as a 
    4949 * normal sensor port again. 
     50 * 
     51 * @warning The RS485 driver should only be shutdown after all 
     52 * in-progress transmissions have completed. 
    5053 */ 
    51 bool nx_rs485_stop(void); 
     54void nx_rs485_shutdown(void); 
    5255 
    5356/** Asynchronously transmit data on the RS485 bus. 
  • nxos/systems/rs485_rx/main.c

    r628 r629  
    5656  } 
    5757} 
    58