From: smckown Date: Fri, 8 May 2009 22:27:16 +0000 (+0000) Subject: Return a real error code and actual bytes written in SpiPacket.sendDone. X-Git-Tag: release/2.1.0-1~3 X-Git-Url: https://oss.titaniummirror.com/gitweb?a=commitdiff_plain;h=56ef4a7cec43b0cca7a98ed616aadb4796e54625;p=tinyos-2.x.git Return a real error code and actual bytes written in SpiPacket.sendDone. Be careful with this one. The usart SPI peripheral always returned the length it was given and an error of SUCCESS, so this could create some regressions. --- diff --git a/tos/chips/msp430/usci/Msp430SpiP.nc b/tos/chips/msp430/usci/Msp430SpiP.nc index 0aaf9bd3..b040053a 100644 --- a/tos/chips/msp430/usci/Msp430SpiP.nc +++ b/tos/chips/msp430/usci/Msp430SpiP.nc @@ -164,9 +164,10 @@ implementation { task void signalSendDone() { atomic { - uint16_t len = m_len; + error_t error = (m_pos == m_len) ? SUCCESS : FAIL; + m_len = 0; - signal SpiPacket.sendDone(m_txBuf, m_rxBuf, len, SUCCESS); + signal SpiPacket.sendDone(m_txBuf, m_rxBuf, m_pos, error); } }