Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hallard authored Jan 20, 2017
2 parents 0cb3516 + 8a536bc commit e086d74
Show file tree
Hide file tree
Showing 27 changed files with 2,188 additions and 24 deletions.
219 changes: 219 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@

*.o

#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml
*.publishproj

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac crap
.DS_Store


#############
## Python
#############

*.py[cod]

# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
4 changes: 4 additions & 0 deletions RHGenericDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ class RHGenericDriver

/// Count of the number of bad messages (correct checksum etc) received
volatile uint16_t _txGood;

/// Channel activity detected
volatile bool _cad;
unsigned int _cad_timeout;

/// Channel activity detected
volatile bool _cad;
Expand Down
5 changes: 5 additions & 0 deletions RHSPIDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bool RHSPIDriver::init()
uint8_t RHSPIDriver::spiRead(uint8_t reg)
{
uint8_t val;
RPI_CE0_CE1_FIX;
ATOMIC_BLOCK_START;
digitalWrite(_slaveSelectPin, LOW);
_spi.transfer(reg & ~RH_SPI_WRITE_MASK); // Send the address with the write mask off
Expand All @@ -42,6 +43,7 @@ uint8_t RHSPIDriver::spiRead(uint8_t reg)
uint8_t RHSPIDriver::spiWrite(uint8_t reg, uint8_t val)
{
uint8_t status = 0;
RPI_CE0_CE1_FIX;
ATOMIC_BLOCK_START;
digitalWrite(_slaveSelectPin, LOW);
status = _spi.transfer(reg | RH_SPI_WRITE_MASK); // Send the address with the write mask on
Expand All @@ -54,6 +56,7 @@ uint8_t RHSPIDriver::spiWrite(uint8_t reg, uint8_t val)
uint8_t RHSPIDriver::spiBurstRead(uint8_t reg, uint8_t* dest, uint8_t len)
{
uint8_t status = 0;
RPI_CE0_CE1_FIX;
ATOMIC_BLOCK_START;
digitalWrite(_slaveSelectPin, LOW);
status = _spi.transfer(reg & ~RH_SPI_WRITE_MASK); // Send the start address with the write mask off
Expand All @@ -67,6 +70,7 @@ uint8_t RHSPIDriver::spiBurstRead(uint8_t reg, uint8_t* dest, uint8_t len)
uint8_t RHSPIDriver::spiBurstWrite(uint8_t reg, const uint8_t* src, uint8_t len)
{
uint8_t status = 0;
RPI_CE0_CE1_FIX;
ATOMIC_BLOCK_START;
digitalWrite(_slaveSelectPin, LOW);
status = _spi.transfer(reg | RH_SPI_WRITE_MASK); // Send the start address with the write mask on
Expand All @@ -81,3 +85,4 @@ void RHSPIDriver::setSlaveSelectPin(uint8_t slaveSelectPin)
{
_slaveSelectPin = slaveSelectPin;
}

16 changes: 16 additions & 0 deletions RHSPIDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
// This is the bit in the SPI address that marks it as a write
#define RH_SPI_WRITE_MASK 0x80

#if (RH_PLATFORM == RH_PLATFORM_RASPI)
#define RPI_CE0_CE1_FIX { \
if (_slaveSelectPin!=7) { \
bcm2835_gpio_fsel(7,BCM2835_GPIO_FSEL_OUTP); \
bcm2835_gpio_write(7,HIGH); \
} \
if (_slaveSelectPin!=8) { \
bcm2835_gpio_fsel(8,BCM2835_GPIO_FSEL_OUTP); \
bcm2835_gpio_write(8,HIGH); \
} \
}
#else
#define RPI_CE0_CE1_FIX {}
#endif


class RHGenericSPI;

/////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit e086d74

Please sign in to comment.