Changeset 629:b641b3511145
- Timestamp:
- 08/15/08 19:25:11 (5 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r628
|
r629
|
|
| 179 | 179 | } |
| 180 | 180 | |
| 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 | | } |
| | 181 | void nx_rs485_shutdown(void) { |
| | 182 | NX_ASSERT(rs485_state.status == RS485_IDLE); |
| 186 | 183 | |
| 187 | 184 | *AT91C_US0_CR = AT91C_US_RSTTX | /* Transmitter reset */ |
| … |
… |
|
| 193 | 190 | |
| 194 | 191 | rs485_state.status = RS485_UNINITIALIZED; |
| 195 | | return TRUE; |
| 196 | 192 | } |
| 197 | 193 | |
-
|
r628
|
r629
|
|
| 48 | 48 | * @note Once the RS485 interface is shut down, port 4 may be used as a |
| 49 | 49 | * normal sensor port again. |
| | 50 | * |
| | 51 | * @warning The RS485 driver should only be shutdown after all |
| | 52 | * in-progress transmissions have completed. |
| 50 | 53 | */ |
| 51 | | bool nx_rs485_stop(void); |
| | 54 | void nx_rs485_shutdown(void); |
| 52 | 55 | |
| 53 | 56 | /** Asynchronously transmit data on the RS485 bus. |
-