Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: sx1276/sx1276-arduino-hal.cpp
- Revision:
- 52:4d304485eda0
- Parent:
- 46:e78a1d0391ac
- Child:
- 53:6d3adad59633
--- a/sx1276/sx1276-arduino-hal.cpp Wed May 17 15:40:13 2017 +0200
+++ b/sx1276/sx1276-arduino-hal.cpp Thu May 18 11:07:46 2017 +0200
@@ -389,38 +389,40 @@
return data;
}
-void SX1276Generic::Write( uint8_t addr, uint8_t *buffer, uint8_t size )
+void SX1276Generic::Write( uint8_t addr, void *buffer, uint8_t size )
{
uint8_t i;
+ uint8_t *p = (uint8_t *)buffer;
*_nss = 0; // what about SPI hold/release timing on fast MCUs? Helmut
_spi->write( addr | 0x80 );
for( i = 0; i < size; i++ )
{
- _spi->write( buffer[i] );
+ _spi->write(*p++);
}
*_nss = 1;
}
-void SX1276Generic::Read( uint8_t addr, uint8_t *buffer, uint8_t size )
+void SX1276Generic::Read( uint8_t addr, void *buffer, uint8_t size )
{
uint8_t i;
+ uint8_t *p = (uint8_t *)buffer;
*_nss = 0; // what about SPI hold/release timing on fast MCUs? Helmut
_spi->write( addr & 0x7F );
for( i = 0; i < size; i++ )
{
- buffer[i] = _spi->write( 0 );
+ *p++ = _spi->write( 0 );
}
*_nss = 1;
}
-void SX1276Generic::WriteFifo( uint8_t *buffer, uint8_t size )
+void SX1276Generic::WriteFifo( void *buffer, uint8_t size )
{
Write( 0, buffer, size );
}
-void SX1276Generic::ReadFifo( uint8_t *buffer, uint8_t size )
+void SX1276Generic::ReadFifo( void *buffer, uint8_t size )
{
Read( 0, buffer, size );
}