[Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/eyesIFX/byte_radio
UartPhyP.nc, 1.1.2.3, 1.1.2.4
Jan-Hinrich Hauer
janhauer at users.sourceforge.net
Fri Jun 9 05:02:03 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/byte_radio
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21870/tos/platforms/eyesIFX/byte_radio
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
UartPhyP.nc
Log Message:
Bugfix by Andreas Koepke: added pseudo-footer - allow MSP430 to transmit last byte correctly.
Index: UartPhyP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/byte_radio/Attic/UartPhyP.nc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** UartPhyP.nc 8 Jun 2006 15:31:05 -0000 1.1.2.3
--- UartPhyP.nc 9 Jun 2006 12:02:01 -0000 1.1.2.4
***************
*** 56,61 ****
interface RadioByteComm;
interface Alarm<T32khz, uint16_t> as RxByteTimer;
- // interface GeneralIO as Led0;
- // interface GeneralIO as Led1;
}
}
--- 56,59 ----
***************
*** 92,96 ****
void ReceiveNextByte(uint8_t data);
-
/* Radio Init */
command error_t Init.init(){
--- 90,93 ----
***************
*** 124,128 ****
async command bool UartPhyControl.isBusy() {
! return call RxByteTimer.isRunning();
}
--- 121,125 ----
async command bool UartPhyControl.isBusy() {
! return phyState != STATE_PREAMBLE;
}
***************
*** 148,152 ****
async event void RxByteTimer.fired() {
! resetState();
}
--- 145,150 ----
async event void RxByteTimer.fired() {
! // no bytes have arrived, so...
! resetState();
}
***************
*** 161,166 ****
async command void SerializerRadioByteComm.txByte(uint8_t data) {
bufByte = data;
- phyState = STATE_DATA_LOW;
call RadioByteComm.txByte(manchesterEncodeNibble((bufByte & 0xf0) >> 4));
}
--- 159,164 ----
async command void SerializerRadioByteComm.txByte(uint8_t data) {
bufByte = data;
call RadioByteComm.txByte(manchesterEncodeNibble((bufByte & 0xf0) >> 4));
+ phyState = STATE_DATA_LOW;
}
***************
*** 226,236 ****
break;
case STATE_DATA_LOW:
! phyState = STATE_DATA_HIGH;
! call RadioByteComm.txByte(manchesterEncodeNibble(bufByte & 0x0f));
! break;
case STATE_FOOTER_START:
! // maybe there will be a time.... we will need this.
! // phyState = STATE_FOOTER_DONE;
! // break;
case STATE_FOOTER_DONE:
phyState = STATE_PREAMBLE;
--- 224,241 ----
break;
case STATE_DATA_LOW:
! call RadioByteComm.txByte(manchesterEncodeNibble(bufByte & 0x0f));
! phyState = STATE_DATA_HIGH;
! break;
case STATE_FOOTER_START:
! /* Pseudo-Footer: the MSP430 has two buffers: one for
! * transmit, one to store the next byte to be transmitted,
! * this footer fills the next-to-transmit buffer, to make
! * sure that the last real byte is actually
! * transmitted. The byte stored by this call may not be
! * transmitted fully or not at all.
! */
! phyState = STATE_FOOTER_DONE;
! call RadioByteComm.txByte(manchesterEncodeNibble(bufByte & 0x0f));
! break;
case STATE_FOOTER_DONE:
phyState = STATE_PREAMBLE;
***************
*** 257,261 ****
if(data != PREAMBLE_BYTE) {
if (data == SFD_BYTE) {
! signal PhyPacketRx.recvHeaderDone(SUCCESS);
phyState = STATE_DATA_HIGH;
} else {
--- 262,266 ----
if(data != PREAMBLE_BYTE) {
if (data == SFD_BYTE) {
! signal PhyPacketRx.recvHeaderDone(SUCCESS);
phyState = STATE_DATA_HIGH;
} else {
***************
*** 290,297 ****
if(decodedByte != 0xff) {
bufByte |= decodedByte;
- phyState = STATE_DATA_HIGH;
signal SerializerRadioByteComm.rxByteReady(bufByte);
} else {
! resetState();
}
break;
--- 295,302 ----
if(decodedByte != 0xff) {
bufByte |= decodedByte;
signal SerializerRadioByteComm.rxByteReady(bufByte);
+ phyState = STATE_DATA_HIGH;
} else {
! resetState();
}
break;
More information about the Tinyos-2-commits
mailing list