Add FCS comments and text2pcap dump routines of Roger Larsson.

Don't send last two byte to xmit buffer since they will be overwritten by the checksum anyway.
This commit is contained in:
dak664 2010-12-21 04:25:15 +00:00
parent 7b7ad4336e
commit e3e1e04948
2 changed files with 63 additions and 39 deletions

View file

@ -530,7 +530,6 @@ void
//hal_frame_read(hal_rx_frame_t *rx_frame, rx_callback_t rx_callback)
hal_frame_read(hal_rx_frame_t *rx_frame)
{
// uint8_t *rx_data=0;
uint8_t *rx_data;
/* check that we have either valid frame pointer or callback pointer */
@ -542,7 +541,7 @@ hal_frame_read(hal_rx_frame_t *rx_frame)
/*Send frame read command.*/
(void)HAL_SPI_TRANSFER(HAL_TRX_CMD_FR);
/*Read frame length.*/
/*Read frame length. This includes the checksum. */
uint8_t frame_length = HAL_SPI_TRANSFER(0);
/*Check for correct frame length.*/
@ -623,9 +622,11 @@ hal_frame_write(uint8_t *write_buffer, uint8_t length)
dummy_read = HAL_SPI_TRANSFER(length);
/* Download to the Frame Buffer. */
/* Note an autogenerated FCS is inserted into the last two bytes, so there is no
* need to transfer them to the buffer */
do{
dummy_read = HAL_SPI_TRANSFER(*write_buffer++);
} while (--length > 0);
} while (--length > 2);
HAL_SPI_TRANSFER_CLOSE();
}
@ -794,7 +795,6 @@ HAL_RF230_ISR()
#endif
if (rf230_last_rssi >= RF230_MIN_RX_POWER) {
#endif
// hal_frame_read(&rxframe, NULL);
hal_frame_read(&rxframe);
rf230_interrupt();
// trx_end_callback(isr_timestamp);